SPARKFUN EDGE 'hello world' PROGRAM FLASHING PROBLEM

Hi,

Request any advice/suggestion on what I am doing wrong. I am trying to run the ‘hello world’ example on my Sparkfun Edge board as described in Chapter 6 of the TnyML book by Pete Warden & Daniel Situnayake. Here is my setup:

  1. laptop: Dell Latitude E7450 running on Ubuntu 18.04 LTS

  2. Attached Sparkfun board with serial basic breakout to a USB port on my laptop

  3. I then ran everything as described in the book as follows:

  4. export DEVICENAME=/dev/ttyUSB0

  5. export BAUD_RATE=921600

  6. Then held down button 14 on the Sparkfun board, reset by pressing RST, and then ran the python program as below.

  7. It prints the ‘Sending Hello’ message, runs some blocks of the code for a bit, and after some time it produces the error message as shown. And the same result with many tries.

Appreciate any input.

nwoke@Tobiee:~/Documents/git_cloned/Github/tflite-micro-sparkfun$ export DEVICENAME=/dev/ttyUSB0

nwoke@Tobiee:~/Documents/git_cloned/Github/tflite-micro-sparkfun$ export BAUD_RATE=115200

nwoke@Tobiee:~/Documents/git_cloned/Github/tflite-micro-sparkfun$ python3 tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py -b ${BAUD_RATE} ${DEVICENAME} -r 1 -f main_nonsecure_wire.bin -i 6

Connecting with Corvette over serial port /dev/ttyUSB0…

Sending Hello.

No response for command 0x00000000

Traceback (most recent call last):

File “tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py”, line 338, in

main()

File “tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py”, line 40, in main

connect_device(ser)

File “tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py”, line 60, in connect_device

response = send_command(hello, 88, ser)

File “tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py”, line 237, in send_command

raise NoResponseError

main.NoResponseError

nwoke@Tobiee:~/Documents/git_cloned/Github/tflite-micro-sparkfun$ export DEVICENAME=/dev/ttyUSB0

nwoke@Tobiee:~/Documents/git_cloned/Github/tflite-micro-sparkfun$ export BAUD_RATE=921600

nwoke@Tobiee:~/Documents/git_cloned/Github/tflite-micro-sparkfun$ python3 tensorflow/lite/micro/tools/make/downloads/AmbiqSuite-Rel2.2.0/tools/apollo3_scripts/uart_wired_update.py -b ${BAUD_RATE} ${DEVICENAME} -r 1 -f main_nonsecure_wire.bin -i 6

Connecting with Corvette over serial port /dev/ttyUSB0…

Sending Hello.

Received response for Hello

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 0x393d8 from 0x0 to 0x393d8

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 8180

Sending Data Packet of length 5416

Received NACK

msgType = 0x8

error = 0x7

seqNo = 0x0

!!!Wired Upgrade Unsuccessful!!!..Terminating the script

Cheers

Nwoke

Try reducing the baud speed to lower, say 115200. Depending on the USB/serial converter it might not be able to handle the high speed ( e.g. a CH340 would not work for me on that speed with Ubuntu 20.04)

The first time it fails, maybe you had not pushed the buttons on time.

@paulvha I tried changing the baud rate but when I do the code doesn’t even compile. Please do you have more suggestions

what error do you get when you compile ?