7

I am flashing a Sparkfun edge board with the SparkFun Serial Basic Breakout - CH340G using some of the examples that the IDE provides in the oficial tutorial.

Although, it has properly worked many times, mainly for the examples example1_edge_test and AI on a microcontroller with TensorFlow Lite and SparkFun Edge, sometimes I get this message when flashing:

Connecting with Corvette over serial port /dev/ttyUSB0...
Sending Hello.
Received response for Hello
Received Unknown Message
msgType =  0x131
Length =  0x5800
['0x80', '0x6', '0xf0', '0xa5', '0x31', '0x1', '0x0', '0x58', '0x0', '0x3', '0x0', '0x0', '0x0', '0xa0', '0xff', '0x4', '0x0', '0x2', '0x0', '0x0', '0x0', '0x7', '0x0', '0x0', '0x0', '0x1', '0x0', '0x0', '0x0', '0xff', '0xa3', '0x2d', '0xff', '0xff', '0x5f', '0x5', '0x0', '0x1', '0x0', '0x0', '0x0', '0x3', '0x0', '0xf4', '0x49', '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', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff', '0xff']
!!!Wired Upgrade Unsuccessful!!!....Terminating the script

It seems to happen when the script AmbiqSuite-Rel2.0.0/AmbiqSuite-Rel2.0.0/boards/SparkFun_Edge_BSP/bsp/tools/uart_wired_update_sparkfun.py establishes the connection with the board, which responses with a different (unknown) message than the one expected for a UART flashing: AM_SECBOOT_WIRED_MSGTYPE_STATUS.

I flash the board holding the button '14', pressing 'reset', and then executing 'make bootload' while holding '14'.

EDIT: WORKAROUND

I've continued troubleshooting this issue and it has to be related to the communication timing since when I change the baud rate (initially set to 921600), the error occurs more often.

Innat
  • 16,113
  • 6
  • 53
  • 101
Bub Espinja
  • 4,029
  • 2
  • 29
  • 46
  • Have you looked into these kind of problems: https://learn.sparkfun.com/tutorials/sparkfun-troubleshooting-tips/all – Michael Petch Jun 16 '19 at 12:29
  • @MichaelPetch Oh yes! I could find anything related to this error. – Bub Espinja Jun 16 '19 at 12:55
  • Have you ever got that message (sometimes) or have it started to arise after a FW version upgrade? – danrodlor Jun 17 '19 at 14:27
  • @danlor AFAIK the firmware haven't been updated. But it is true that the first day I "played" with it, the error wasn't shown. – Bub Espinja Jun 17 '19 at 14:30
  • Does the response remain unalterable between executions? – danrodlor Jun 17 '19 at 15:00
  • @danlor not really, a cannot see why the flashing fails sometimes and others is successful. – Bub Espinja Jun 17 '19 at 18:58
  • I just noticed your EDIT, it seems that it is a driver issue. Windows, Linux or Mac? Which driver are you using? Have you tried to install other drivers? Did you checked the bus with an oscilloscope in order to quantify the timing deviation? – danrodlor Jun 28 '19 at 07:47
  • @danlor I'm on Linux and the driver is the CH340G. I do not check the bus. I am not sure if I'll be able to get an oscilloscope... but if so, I'll post the updates! – Bub Espinja Jun 28 '19 at 07:56
  • Nice! Have you tried to issue the same procedure under Windows? OTH, is your device properly recognised by the system (`dmesg`, `lsusb`)? – danrodlor Jun 28 '19 at 08:10

0 Answers0