No announcement from Artemis bootloader

Environment: MacOS 10.14.5 / Arduino 1.8.9

Package version: v1.0.1

Board: Artemis Nano

I get the following error when I try to upload Blink example;

Build options changed, rebuilding all
Sketch uses 7352 bytes (0%) of program storage space. Maximum is 960000 bytes.
/Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.1/tools/artemis/macosx/artemis_svl/artemis_svl /dev/cu.usbserial-1430 -f /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_535103/Example1_Blink.ino.bin -b 57600 -v 
Connecting over serial port /dev/cu.usbserial-1430...
Waiting for command from bootloader
No announcement from Artemis bootloader

Same example works on package v0.0.0. This related Github issue https://github.com/sparkfun/Arduino_Apollo3/pull/12 supposed to fix it but may it caused the issue.

Note that Blink example works for Artemis and Artemis ATP boards IF I use 57600 SVL Baud Rate. Otherwise returns “Unknown BL response” error.

Thanks for the report - we have recently identified some differences between MacOSX/Linux and Windows as fard as USB-serial driver operation goes. Currently working on an inmproved bootloader that will ship in v1.0.3.

In the meantime use v1.0.2 and select the “Ambiq Secure Bootloader” option. This will use the failsafe bootloader that operates at 115200 baud. Later when the improvements are made to the second-stage bootloader you can reload it with the “Artemis Bootloader” example sketch. (Examples->Artemis Examples->Advanced->Artemis Bootloader)

I’ve upgraded to v1.0.3. Neither SparkFun Variable Loader and Ambiq Secure Bootloader works. Can you confirm that v1.0.3 works on MacOS? (Not that Artemis Blackboard and Artemis Blackboard ATP can be programmed at 57600 using v1.0.2. Nano doesn’t work at all.)

SVL error:

Build options changed, rebuilding all
Sketch uses 7376 bytes (0%) of program storage space. Maximum is 960000 bytes.
/Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.3/tools/artemis/macosx/artemis_svl /dev/cu.usbserial-1410 -f /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_382149/Example1_Blink.ino.bin -b 115200 -v 
Connecting over serial port /dev/cu.usbserial-1410...
Using Serial timeout: 0.05
Starting Communications at 115200 baud
Try #19. Result: 
Baud Set: lengths did not match
Failed baud set phase
/dev/cu.usbserial-1410 is currently open. Please close any other terminal programs that may be using /dev/cu.usbserial-1410 and try again.

ASB error:

Build options changed, rebuilding all
Sketch uses 7376 bytes (0%) of program storage space. Maximum is 960000 bytes.
/Users/zmp/Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.3/tools/ambiq/macosx/ambiq_bin2board --bin /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_382149/Example1_Blink.ino.bin --load-address-blob 0x20000 --magic-num 0xCB -o /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_382149/Example1_Blink.ino --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.usbserial-1410 -r 2 -v 
Header Size =  0x80
original app_size  0x1cf0 ( 7408 )
load_address  0xc000 ( 49152 )
app_size  0x1cf0 ( 7408 )
w0 = 0xcb001d70
Security Value  0x10
w2 =  0x10008080
addrWord =  0xc000
versionKeyWord =  0x0
child0/feature =  0xffffffff
child1 =  0xffffffff
crc =   0x45bcf34a
Writing to file  /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_382149/Example1_Blink.ino_OTA_blob.bin
testing: /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_382149/Example1_Blink.ino_OTA_blob.bin
Header Size =  0x60
app_size  0x1d70 ( 7536 )
Writing to file  /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_382149/Example1_Blink.ino_Wired_OTA_blob.bin
Image from  0x0  to  0x1d70  will be loaded at 0x20000
Connecting over serial port /dev/cu.usbserial-1410...
Sending Hello.
No response for command 0x00000000
received bytes 3
['0xfc', '0x0', '0x0']
Failed to respond
Fail
Sending Hello.
No response for command 0x00000000
received bytes 3
['0xfe', '0x0', '0x0']
Failed to respond
Fail
Sending Hello.
No response for command 0x00000000
received bytes 3
['0xfc', '0x0', '0x0']
Failed to respond
Fail
Tries = 3
Upload failed

v1.0.3 is sort of an in-between state because the tools have changed to v2 but many people’s boards will still have the original SVL onboard (or none at all). You will need to load the SVL (v2) onto the board using the ASB. You can do that (as long as ASB works) by uploading the ‘Examples->Artemis Examples->Advanced->Artemis Bootloader’ example. (Confirm that the bootloader version is 0x02 as in ‘#define BOOTLOADER_VERSION 0x02’).

I have tested the SVL (v2) on my Mac laptop and it was reliable. Another GitHub user has reported success as well.

Here’s the GitHub issue that has a little more information: https://github.com/sparkfun/Arduino_Apollo3

The problem with ASB is more concerning – this is intended to be the failsafe method of operation. You have an Artemis Nano, so there is no direct access to the ‘Boot’ pin which is used to put the Apollo3 into ASB mode. Do you know what sketch is running on the Artemis Nano right now? There is a possibility that the ASB can be overwhelmed by excessive UART data going over Serial. This may require SparkFun to take a closer look at the tools that Ambiq originally provided - Ideally this could be fixed within the Python script that is used for upload. Maybe allow a longer timeout or perform a serial buffer flush.

Otherwise your ASB command looks good - 115200 baud is correct for the Artemis boards and the ‘ambiq_bin2board’ binary is coming from the right location.

To recap: I think your next steps should be

  1. Understand what is happening on the serial port with the default sketch (if there is a lot of traffic try to find a way to stop it. Nuclear option is to use a SWD programmer to erase flash, and re-flash the ASB settings at 115200 baud)

  2. When ASB works upload the SVL v2 (Artemis_Bootloader example sketch), then change your bootloader tool to SVL.

We’re actively working on making this whole experience a lot better - thanks for your patience!

How do you install boards? Are you using “Boards Manager” option or “Manual Install” option at https://github.com/sparkfun/Arduino_Apo … stallation? I’m using “Boards Manager” maybe that’s the problem?

Also do you have instructions for “use a SWD programmer to erase flash, and re-flash the ASB settings at 115200 baud”?

Using the boards manager is correct. We’ve now released v1.0.4 which was mainly focused on improving the SVL. However everything relies on the ASB so we need to get that working for you first.

My explanation of the SWD option will be hasty, and if you think it looks like an option you want to try then I can help get you through it when you try.

  1. get a J-Link SWD programmer (the educational version is only $20 https://www.sparkfun.com/products/15345, but if you are using it to make money you have to buy the unrestricted version https://www.sparkfun.com/products/15347)

  2. download the AmbiqSuite SDK (https://ambiqmicro.com/static/mcu/files … VeIKav.zip)

  3. go to the directory ‘tools/apollo3_scripts’

  4. use Python to create the ‘info0.bin’ file using ‘create_info0.py’ and passing in the correct arguments (see photo for details)

bootloader.jpg
5. download and install the J-Link tools (https://www.segger.com/downloads/jlink/ … tationPack)

  1. connect the j-link to your board with the 2x5 cortex debug header (https://www.sparkfun.com/products/15362)

  2. connect your board to power (J-link does not provide power and needs to sense VDD)

  3. on the command line use ‘jlink -CommanderScript jlink-prog-info0.txt’ to flash the ‘info0.bin’ file.

Those are the steps needed to reconfigure the ASB. Having the SWD programmer also means you could upload code directly, and will be a failsafe in case the ASB ever gets stuck again.

I’m also considering diving into the ASB code to see if there is a fix on the python side, but don’t hold your breath.

Please keep me posted on what you end up doing!

I’ve tried everything you said and I’m still getting errors (i.e. CPU is not halted):

./create_info0.py --valid 1 info0 --pl 1 --u0 0x1C200c0 --u1 0xFFFF3031 --u2 0x2 --u3 0x0 --u4 0x0 --u5 0x0 --main 0xC000 --gpio 0x0E --version 0 --wTO 5000
0x0E --version 0 --wTO 5000
info0 Signature...
['0x88', '0xad', '0xea', '0x48', '0x37', '0x57', '0x70', '0xc9', '0x58', '0x84', '0x6b', '0xa', '0x74', '0x9d', '0x1a', '0xe4']
Security Word =  0x55fff
Customer Trim =  0xffffffff
Customer Trim2 =  0xffffffff
Override =  0xe
WiredCfg =  0x13884021
UART Config  0x1c200c0 0xffff3031 0x2 0x0 0x0 0x0
Version =  0x0
Main Ptr =  0xc000
SRAM Reservation =  0x0
Permanent Write Protections =  0xffffffff : 0xffffffff
Permanent Copy Protections =  0xffffffff : 0xffffffff
SBL Overridable Write Protections =  0xffffffff : 0xffffffff
SBL Overridable Copy Protections =  0xffffffff : 0xffffffff
Customer Key
['0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde']
chipID 16
['0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0']
wrap mode 0
KEK
['0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0']
['0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff']
['0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa', '0xaa']
['0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55', '0x55']
['0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11', '0x11']
['0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5', '0xa5']
['0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66', '0x66']
['0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde']
AuthKey
['0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0']
['0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0', '0x0']
['0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff']
['0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff']
['0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55']
['0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55', '0xaa', '0x55']
['0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde']
['0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde', '0xef', '0xbe', '0xad', '0xde']
KREV Mask =  0xffffffff
AREV Mask =  0xffffffff
Writing to file  info0.bin
/Applications/SEGGER/JLink/JLinkExe -CommanderScript jlink-prog-info0.txt
/Applications/SEGGER/JLink/JLinkExe -CommanderScript jlink-prog-info0.txt
SEGGER J-Link Commander V6.48a (Compiled Jul 30 2019 15:18:02)
DLL version V6.48a, compiled Jul 30 2019 15:17:51


J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Jul 10 2019 16:32:48
Hardware version: V1.00
License(s): FlashBP, GDB
VTref=3.106V

Selecting SWD as current target interface.

Selecting 1000 kHz as target interface speed

Target connection not established yet but required for command.
Device "AMA3B1KK-KBR" selected.


Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
Cortex-M4 identified.
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Reset: SYSRESETREQ has confused core.
Reset: Using fallback: VECTRESET.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.VECTRESET.
Reset: VECTRESET has confused core.
Reset: Using fallback: Reset pin.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via reset pin
Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
Reset: Reconnecting and manually halting CPU.

**************************
WARNING: CPU could not be halted
**************************

Reset: Core did not halt after reset, trying to disable WDT.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via reset pin
Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
Reset: Reconnecting and manually halting CPU.

**************************
WARNING: CPU could not be halted
**************************

Reset: Failed. Toggling reset pin and trying reset strategy again.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Reset: SYSRESETREQ has confused core.
Reset: Using fallback: VECTRESET.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.VECTRESET.
Reset: VECTRESET has confused core.
Reset: Using fallback: Reset pin.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via reset pin
Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
Reset: Reconnecting and manually halting CPU.

**************************
WARNING: CPU could not be halted
**************************

Reset: Core did not halt after reset, trying to disable WDT.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via reset pin
Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
Reset: Reconnecting and manually halting CPU.

**************************
WARNING: CPU could not be halted
**************************


****** Error: DAP error while reading DP-Ctrl-Stat register.

Sleep(10)

MSP = 0x10000100

Writing 00000000 -> 10000000

Writing D894E09E -> 10000004

Writing FFFFFFFF -> 10000008



****** Error: CPU is not halted

Sleep(50)

Could not read memory.

Writing 00000000 -> 10000000

Writing 00000000 -> 10000004

Writing 00000800 -> 10000008

Writing D894E09E -> 1000000C

Writing FFFFFFFF -> 10000010

Downloading file [info0.bin]...
Writing target memory failed.



****** Error: CPU is not halted

Sleep(50)

Could not read memory.

Writing 0000001B -> 40000004


Script processing completed.

Do you think it’s related to the drivers? Should I upgrade by https://github.com/adrianmihalko/ch340g … s-x-driver

Actual error is: “Error: DAP error while reading DP-Ctrl-Stat register.”

More updates:

Environment:

Sparkfun Arduino Apollo v1.0.5

Arduino v1.8.9

Python v3.7.3

Ambiq v2.2.0

CH34x v1.5

MacOS v10.14.6

  1. I’ve updated drivers via https://github.com/adrianmihalko/ch340g … s-x-driver

  2. Blackboard Artemis ATP works well atm. I’m not sure whether because SWD option worked or not but I can do upload using SVL at 921600 baud rate.

  3. Blackboard Artemis and Artemis Nano don’t work at all.

When I use jlink to program it I get the following error:

****** Error: DAP error while reading DP-Ctrl-Stat register.
...
****** Error: CPU is not halted

When I try to burn bootloader I get;

/Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/tools/ambiq/macosx/ambiq_bin2board --bin /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_683810/Example1_Blink.ino.bin --load-address-blob 0x20000 --magic-num 0xCB -o /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_683810/Example1_Blink.ino --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.wchusbserial1410 -r 2 -v 
Header Size =  0x80
original app_size  0x1ce0 ( 7392 )
load_address  0xc000 ( 49152 )
app_size  0x1ce0 ( 7392 )
w0 = 0xcb001d60
Security Value  0x10
w2 =  0x10008080
addrWord =  0xc000
versionKeyWord =  0x0
child0/feature =  0xffffffff
child1 =  0xffffffff
crc =   0x653516f
Writing to file  /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_683810/Example1_Blink.ino_OTA_blob.bin
testing: /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_683810/Example1_Blink.ino_OTA_blob.bin
Header Size =  0x60
app_size  0x1d60 ( 7520 )
Writing to file  /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_683810/Example1_Blink.ino_Wired_OTA_blob.bin
Image from  0x0  to  0x1d60  will be loaded at 0x20000
Connecting over serial port /dev/cu.wchusbserial1410...
Sending Hello.
No response for command 0x00000000
Failed to respond
Fail
Sending Hello.
No response for command 0x00000000
Failed to respond
Fail
Sending Hello.
No response for command 0x00000000
Failed to respond
Fail
Tries = 3
Upload failed

When I try to upload Examples->Artemis_Botloader I get:

/Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/tools/ambiq/macosx/ambiq_bin2board --bin /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_137299/Artemis_Bootloader.ino.bin --load-address-blob 0x20000 --magic-num 0xCB -o /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_137299/Artemis_Bootloader.ino --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.wchusbserial1410 -r 2 -v 
Header Size =  0x80
original app_size  0x23c8 ( 9160 )
load_address  0xc000 ( 49152 )
app_size  0x23c8 ( 9160 )
w0 = 0xcb002448
Security Value  0x10
w2 =  0x10008080
addrWord =  0xc000
versionKeyWord =  0x0
child0/feature =  0xffffffff
child1 =  0xffffffff
crc =   0x781e6dd7
Writing to file  /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_137299/Artemis_Bootloader.ino_OTA_blob.bin
testing: /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_137299/Artemis_Bootloader.ino_OTA_blob.bin
Header Size =  0x60
app_size  0x2448 ( 9288 )
Writing to file  /var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_137299/Artemis_Bootloader.ino_Wired_OTA_blob.bin
Image from  0x0  to  0x2448  will be loaded at 0x20000
Connecting over serial port /dev/cu.wchusbserial1410...
Sending Hello.
No response for command 0x00000000
Failed to respond
Fail
Sending Hello.
No response for command 0x00000000
Failed to respond
Fail
Sending Hello.
No response for command 0x00000000
Failed to respond
Fail
Tries = 3
Upload failed

When I try to upload blink example I get:

Artemis SVL Bootloader

phase:	setup
	cleared startup blip

phase:	bootload
	have 7392 bytes to send in 4 frames

	error receiving packet
{'len': 0, 'cmd': 0, 'data': 0, 'crc': 1, 'timeout': 1}

Hey devfacet — there’s a lot to respond to here but one thing is more important at the moment. That is that the ‘Examples->Artemis_Botloader’ is no longer valid – I should have removed it but I will do that for the next release.

Instead the proper way to burn the SVL bootloader is to use ‘Tools->Burn Bootloader’ (and make sure that your ‘Tools->Programmer’ is set to ‘Ambiq Secure Bootloader’ first). Of course, this requires the ASB to be working.

Also, when you said “When I try to burn bootloader I get;” your path shows that you’re uploading the “Example1_Blink” sketch. (/var/folders/8s/x2l4zgyj75v01v6s0tz68gg80000gn/T/arduino_build_683810/Example1_Blink.ino.bin) Can you elaborate on what you mean by “burn bootloader?” Definitely in v1.0.5 “Burn Bootloader” should have a path similar to this for the binary:

(Arduino15\packages\SparkFun\hardware\apollo3\1.0.5/bootloaders/artemis/artemis_svl.bin)

Finally in v1.0.5 I modified the ASB script to reset the input UART buffer just before sending the Hello command. This is meant to help combat what happens when the Artemis is sending out lots of UART data that the host computer buffers.

Full logs from “Tools->Burn Bootloader”

/Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/tools/ambiq/macosx/ambiq_bin2board --bin /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl.bin --load-address-blob 0x20000 --magic-num 0xCB -o /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.wchusbserial1410 -r 2 -v 
Header Size =  0x80
original app_size  0x2708 ( 9992 )
load_address  0xc000 ( 49152 )
app_size  0x2708 ( 9992 )
w0 = 0xcb002788
Security Value  0x10
w2 =  0x10008080
addrWord =  0xc000
versionKeyWord =  0x0
child0/feature =  0xffffffff
child1 =  0xffffffff
crc =   0x6442ad39
Writing to file  /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl_OTA_blob.bin
testing: /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl_OTA_blob.bin
Header Size =  0x60
app_size  0x2788 ( 10120 )
Writing to file  /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl_Wired_OTA_blob.bin
Image from  0x0  to  0x2788  will be loaded at 0x20000
Connecting over serial port /dev/cu.wchusbserial1410...
Sending Hello.
Received response for Hello
Bootloader connected
Received Status
length = 0x58
version = 0x3
Max Storage = 0x4ffa0
Status = 0x2
State = 0x7
AMInfo = 
0x1
0xff2da3ff
0x55fff
0x1
0x49f40003
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
Sending OTA Descriptor = 0xfe000
Sending Update Command.
number of updates needed = 1
Sending block of size 0x27e8 from 0x0 to 0x27e8
Sending Data Packet of length 8180
No response for command 0x00000008
Response not valid
Failed to ack command
Fail
Sending Hello.
Received response for Hello
Bootloader connected
Received Status
length = 0x58
version = 0x3
Max Storage = 0x4ffa0
Status = 0x2
State = 0x7
AMInfo = 
0x1
0xff2da3ff
0x55fff
0x1
0x49f40003
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
Sending OTA Descriptor = 0xfe000
Sending Update Command.
number of updates needed = 1
Sending block of size 0x27e8 from 0x0 to 0x27e8
Sending Data Packet of length 8180
No response for command 0x00000008
Response not valid
Failed to ack command
Fail
Sending Hello.
Received response for Hello
Bootloader connected
Received Status
length = 0x58
version = 0x3
Max Storage = 0x4ffa0
Status = 0x2
State = 0x7
AMInfo = 
0x1
0xff2da3ff
0x55fff
0x1
0x49f40003
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
Sending OTA Descriptor = 0xfe000
Sending Update Command.
number of updates needed = 1
Sending block of size 0x27e8 from 0x0 to 0x27e8
Sending Data Packet of length 8180
No response for command 0x00000008
Response not valid
Failed to ack command
Fail
Tries = 3
Upload failed
/Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/tools/ambiq/macosx/ambiq_bin2board --bin /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl.bin --load-address-blob 0x20000 --magic-num 0xCB -o /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port /dev/cu.wchusbserial1410 -r 2 -v 
Header Size =  0x80
original app_size  0x2708 ( 9992 )
load_address  0xc000 ( 49152 )
app_size  0x2708 ( 9992 )
w0 = 0xcb002788
Security Value  0x10
w2 =  0x10008080
addrWord =  0xc000
versionKeyWord =  0x0
child0/feature =  0xffffffff
child1 =  0xffffffff
crc =   0x6442ad39
Writing to file  /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl_OTA_blob.bin
testing: /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl_OTA_blob.bin
Header Size =  0x60
app_size  0x2788 ( 10120 )
Writing to file  /Users/.../Library/Arduino15/packages/SparkFun/hardware/apollo3/1.0.5/bootloaders/artemis/artemis_svl_Wired_OTA_blob.bin
Image from  0x0  to  0x2788  will be loaded at 0x20000
Connecting over serial port /dev/cu.wchusbserial1410...
Sending Hello.
Received response for Hello
Bootloader connected
Received Status
length = 0x58
version = 0x3
Max Storage = 0x4ffa0
Status = 0x2
State = 0x7
AMInfo = 
0x1
0xff2da3ff
0x55fff
0x1
0x49f40003
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
Sending OTA Descriptor = 0xfe000
Sending Update Command.
number of updates needed = 1
Sending block of size 0x27e8 from 0x0 to 0x27e8
Sending Data Packet of length 8180
No response for command 0x00000008
Response not valid
Failed to ack command
Fail
Sending Hello.
Received response for Hello
Bootloader connected
Received Status
length = 0x58
version = 0x3
Max Storage = 0x4ffa0
Status = 0x2
State = 0x7
AMInfo = 
0x1
0xff2da3ff
0x55fff
0x1
0x49f40003
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
Sending OTA Descriptor = 0xfe000
Sending Update Command.
number of updates needed = 1
Sending block of size 0x27e8 from 0x0 to 0x27e8
Sending Data Packet of length 8180
No response for command 0x00000008
Response not valid
Failed to ack command
Fail
Sending Hello.
Received response for Hello
Bootloader connected
Received Status
length = 0x58
version = 0x3
Max Storage = 0x4ffa0
Status = 0x2
State = 0x7
AMInfo = 
0x1
0xff2da3ff
0x55fff
0x1
0x49f40003
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
0xffffffff
Sending OTA Descriptor = 0xfe000
Sending Update Command.
number of updates needed = 1
Sending block of size 0x27e8 from 0x0 to 0x27e8
Sending Data Packet of length 8180
No response for command 0x00000008
Response not valid
Failed to ack command
Fail
Tries = 3
Upload failed

After many tries/reset/power on/offs I was able to do a successful “Burn Bootloader” to Artemis Nano. But when I try to upload Blink example I get:

Artemis SVL Bootloader

phase:	setup
	cleared startup blip

phase:	bootload
	have 7384 bytes to send in 4 frames

	error receiving packet
{'len': 0, 'cmd': 0, 'data': 0, 'crc': 1, 'timeout': 1}

Also how I can determine whether I’ve correct an ASB version or not?

liquid.soulder: I successfully completed the SWD/jlink option using a Windows machine. Seems like MacOS is having issues for SWD/jlink option. After that I switched to MacOS because I can’t install Arduino SparkFun Apollo board on Windows due to following error:

 Error downloading https://static.sparkfun.com/large/win32_aneg-8-2018_2018-q4-major.zip
java.lang.RuntimeException: java.lang.Exception: Error downloading https://static.sparkfun.com/large/win32_aneg-8-2018_2018-q4-major.zip
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:175)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error downloading https://static.sparkfun.com/large/win32_aneg-8-2018_2018-q4-major.zip
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:139)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:73)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:55)
	at cc.arduino.contributions.packages.ContributionInstaller.install(ContributionInstaller.java:109)
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:172)
	... 1 more
Caused by: java.io.IOException: Received invalid http status code from server: 404
	at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:205)
	at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:132)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:137)
	... 5 more

Basically it’s looking for https://static.sparkfun.com/large/win32 … -major.zip which doesn’t exist.

Questions:

  1. Do I still need to do "Tools->Burn Bootloader` after SWD/jlink?

  2. Can you fix Windows library so I can try it on Windows? (that would also indicate that the issue is on MacOS)

  3. Do you have any idea why I’m getting the following error on MacOS even thought SWD/jlink option was successful?

Artemis SVL Bootloader

phase:	setup
	cleared startup blip

phase:	bootload
	have 7384 bytes to send in 4 frames

	error receiving packet
{'len': 0, 'cmd': 0, 'data': 0, 'crc': 1, 'timeout': 1}

The Arduino packages were unable to install Wednesday and yesterday because of an outage on our website. I have redirected those files to their hosting location at ARM so try installing Windows Aduino core now.

Using the SWD/JLink configures the Ambiq Secure Bootloader so you will still need to “Burn Bootloader” to be able to use the SparkFun Variable Loader.

Does the ASB work now after you’ve configured it? BTW everything appears to be more reliable on Windows so that is a good way to try to confirm that the board and USB-serial bridge are OK.

Still the same error (“error receiving packet”), both on Windows and MacOS. At this point I gave up and will not spend more time on Artemis.

I have followed the ASB configuration instructions in this thread and am getting the same error message when trying to upload code. The boards were working ok before this, so I think it might be an error in the ASB configuration instructions.

This is detailed in a dedicated thread:

viewtopic.php?f=165&t=50783