SparkFun Forums 

Where electronics enthusiasts find answers.

User avatar
By ali.sarlak
#249846
Hello,

I've been working on porting the SparkFun Artemis Nano (based on Apollo3 Blue SoC) to the Zephyr Project. I've set up the board directory, modified the necessary files, and successfully built the OS, resulting in a `zephyr.bin` file.

However, when I try to flash this binary to the board using the following command:
Code: Select all
python3 artemis_uploader/artemis_svl.py -f ./build/zephyr.bin /dev/ttyUSB0 -v 

it just says "can't upload" after 3 attempts and then "Upload Failed" with the version number:
Code: Select all
Phase:	Setup
	Cleared startup blip
	
 - Version: 5

	Sending 'enter bootloader' command

Phase:	Bootload
	have 14055 bytes to send in 7 frames
	Sending frame #1, length: 2048
	Sending frame #2, length: 2048
	Sending frame #3, length: 2048
	Sending frame #4, length: 2048
	Sending frame #5, length: 2048
	Sending frame #6, length: 2048
	Sending frame #7, length: 1767
		Retrying...
	Sending frame #7, length: 1767
		Retrying...
	Sending frame #7, length: 1767
		Retrying...
	Sending frame #7, length: 1767
		Retrying...
	Sending frame #7, length: 1767



	
Upload Failed
There are no further error messages to help diagnose the issue. Notably, the flash tool works fine with pre-built binaries from Artemis (example/Blink.bin).

Any guidance or suggestions on how to resolve this issue would be greatly appreciated.

Thank you
By paulvha
#249852
I think your code is overwritten the SVL

The Apollo3 can have 2 bootloaders: ASB and SVL.

The ASB loader is in ROM/OPT and is always started first. It can start loading a program from 0x0000C000 in flash.

When the SVL is used, it is loaded by the ASB from 0x0000C000 and occupies up to 0x00010000. So make sure your user program does not try to store there.
User avatar
By ali.sarlak
#249863
Thanks for the information; I will look into it. However, I am pretty new to the Zephyr project. If you are interested, I forked Zephyr and created a new branch called
Code: Select all
new_board/artemis_nano
. Under
Code: Select all
boards/sparkfun/artemis_nano
, you can find all the files.

https://github.com/AlienSarlak/zephyr/t ... temis_nano

Please note that I have just started, and it is not yet complete (not even close to :) ).
User avatar
By ali.sarlak
#249864
aliarifat794 wrote: Sun Jun 09, 2024 6:37 am you have to properly set up the CMakeLists.txt, prj.conf, and any other configuration files required by Zephyr.
I am trying to port a new board into Zephyr. It is not an application for a specific board, so there is no `CMakeLists.txt` or `prj.conf` as far as I know in my case. By the way, I am a newbie to Zephyr. So, please let me know if you think I have to add or modify the mentioned files.
User avatar
By ali.sarlak
#249865
paulvha wrote: Sun Jun 09, 2024 8:48 am I think your code is overwritten the SVL

The Apollo3 can have 2 bootloaders: ASB and SVL.

The ASB loader is in ROM/OPT and is always started first. It can start loading a program from 0x0000C000 in flash.

When the SVL is used, it is loaded by the ASB from 0x0000C000 and occupies up to 0x00010000. So make sure your user program does not try to store there.
I am aware of ASB and SVL, and your guess should be correct. I also think I tried to overwrite SVL, which I don't want to do, and perhaps that's why it failed to flash the device. Thanks for the info; I will look into it.
User avatar
By ali.sarlak
#249883
I think I am not writing the SVL because I am using the Artemis-Firmware-Upload-GUI for flashing the board. Therefore, it is not possible to overwrite the boot partition since the Artemis-Firmware-Upload-GUI handles uploading the zephyr.bin file.

I realized that if I sum all the frames, they match the size of my image, except the problem occurs only on the last frame. I don't know why it can't write the last frame. Additionally, I have tried flashing larger bin files, and the firmware uploader handles them without any issues.

Currently, I don't have any ideas and would appreciate any thoughts.
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum