Issue Flashing Zephyr Binary to SparkFun Artemis Nano

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:

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:

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

you have to properly set up the CMakeLists.txt, prj.conf, and any other configuration files required by Zephyr.

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.

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 new_board/artemis_nano. Under ```
boards/sparkfun/artemis_nano


[https://github.com/AlienSarlak/zephyr/t ... temis_nano](https://github.com/AlienSarlak/zephyr/tree/new_board/artemis_nano)

Please note that I have just started, and it is not yet complete (not even close to :) ).

aliarifat794:
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.

paulvha:
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.

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.

The problem was the padding. The file you are preparing for flash should be divisible by 4.