SparkFun Edge Development Board - Diagnosis

Hi,

I’m attempting to verify if my new SparkFun Edge board is dead (on arrival), as I’ve followed all the available information to “make bootload” on the first ‘example 1’ code, however the board always times out at “Sending Hello”. I’ve read all the forum posts but they’re either user error, incomplete responses, or aimed at FTDI.

The ‘example 1’ code builds fine.

Setup:

I’ve exhausted all my known options:

  • - Checked the CH340G driver
  • - Tried the alternative CH34x Driver mentioned in the forums
  • - Successfully performed a loopback echo on the Serial Basic board, disconnecting the Edge and shorting Rx1 and Tx0 pins then ``` echo "abcde" > /dev/ttyUSB0 && cat /dev/ttyUSB0 ```
  • - Used Coin Cell Battery / Used USB power to power device
  • - Tried modifying the Makefile to send at 115200 baud rate
  • - Tried altering the file **uart_wired_update_sparkfun.py** to modify the
         with serial.Serial(args.port, args.baud, timeout=12) as ser:
            time.sleep(0.25) # delay for 250ms
            ser.reset_input_buffer()
            ser.reset_output_buffer()
            connect_device(ser)
    
  • - Tried Windows 10 using PUTTY
  • - Tried Arduino IDE on Ubuntu 19.04 to bootload
  • - I've reinstalled the O/S, to make sure that I hadn't broken anything
  • - I've held down the 14 Btn whilst using the '**make bootload**' and experimented with the RST Btn - with no visible indication that anything is responsive, either in make bootload or on the board.
  • - The Yes/No preloaded code has never worked, but as the forums suggest it isn't particularly solid anyway
  • - Measured the voltage on VDD pin at 3.3V using my CRO
  • I see no LED lights flicker. Not a blip. (With the exception of the loopback echo test - Serial Basic board Rx1)

    At what point should I throw in the towel? This seems unusually difficult, considering the other success I have on other Arduino boards.

    Generally, I also feel that the documentation and guides are heavily angled toward Windows and OSx users, and ignorant of Linux (Ubuntu) users.

    Here’s a typical response when ‘make bootload’ runs, while holding down the 14 Btn.

    make bootload
    ../../../../../tools/apollo3_scripts/create_cust_image_blob.py --bin bin/example1_edge_test.bin --load-address 0xC000 --magic-num 0xCB -o bin/main_nonsecure_ota --version 0x0
    Header Size =  0x80
    original app_size  0x4620 ( 17952 )
    load_address  0xc000 ( 49152 )
    app_size  0x4620 ( 17952 )
    w0 = 0xcb0046a0
    Security Value  0x10
    w2 =  0x10008080
    addrWord =  0xc000
    versionKeyWord =  0x0
    child0/feature =  0xffffffff
    child1 =  0xffffffff
    crc =   0x5d23625a
    Writing to file  bin/main_nonsecure_ota.bin
    ../../../../../tools/apollo3_scripts/create_cust_wireupdate_blob.py --load-address 0x20000 --bin bin/main_nonsecure_ota.bin -i 6 -o bin/main_nonsecure_wire --options 0x1
    Header Size =  0x60
    app_size  0x46a0 ( 18080 )
    Writing to file  bin/main_nonsecure_wire.bin
    Image from  0x0  to  0x46a0  will be loaded at 0x20000
    ../../../bsp/tools/uart_wired_update_sparkfun.py -b 115200 '/dev/ttyUSB0'  -r 1 -f bin/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 "../../../bsp/tools/uart_wired_update_sparkfun.py", line 343, in <module>
        main()
      File "../../../bsp/tools/uart_wired_update_sparkfun.py", line 44, in main
        connect_device(ser)
      File "../../../bsp/tools/uart_wired_update_sparkfun.py", line 63, in connect_device
        response = send_command(hello, 88, ser)
      File "../../../bsp/tools/uart_wired_update_sparkfun.py", line 240, in send_command
        raise NoResponseError
    __main__.NoResponseError
    make: *** [Makefile:197: bootload] Error 1
    

    your experience is close to mine (ubuntu 18). Tried the whole lot. Removed CH341 drivers (which worked well with other boards) :rmmod ch 341. Got the 341ser.linux, which generate the CH34x drivers. It seems however that every time after reboot I need to do a ’ make unload’ and ‘make load’ of these drivers before I can connect to the board after reboot and before connecting the USB. And even then it is not stable… Have not figured it out completely, but the CH341 chip drivers are a pain-in-the-neck.

    Sparkfun, dump these cheap Chinese chips or get the right drivers for each operating system posted. They are under mining the value of your work and boards

    Paulvha, we appreciate your feedback and completely understand your experience and concerns associated with the CH340C chip. We are working diligently to make this chip as user friendly as possible and drivers are certainly an area that we are concentrated on. This is a versatile chip that will be integrated into numerous SparkFun original boards. It is certainly in our best interest to make sure our products work as seamlessly as possible across multiple operating systems.

    westy:

    I pinged our engineer on this issue… he is busy working on the Arduino core for the Artemis boards. When he finishes up, he’ll jump back in the forums to assist with the more technical issues.

    Unfortunately, unlike Windows 7/10 or Mac OSX… Linux (all distros) is harder to support. [short answer]

    paulvha:

    As a workaround, you could potentially try uploading with an FTDI breakout board instead. I’ll also pass along the information.

    After many times of failure to flash SparkFun Edge via my Ubuntu 18.04 laptop, now the board can be re-flashed in a very stable way. I would report my steps as below if these could provide a little bit helps :slight_smile:

    1, Go steps until https://codelabs.developers.google.com/ … sorflow/#5, to prepare flash binary.

    2, Go through https://learn.sparkfun.com/tutorials/ho … vers#linux, to setup ch34x driver.

    3, 1) Plug USB cable to laptop. 2) Press button 14 and RST, to turn board off.

    1. Type

    python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/uart_wired_update.py -b ${BAUD_RATE} ${DEVICENAME} -r 1 -f main_nonsecure_wire.bin -i 6 [enter]

    at terminal.

    If the following log comes on terminal:

    "Connecting with Corvette over serial port /dev/ttyUSB0…

    Sending Hello.

    Received response for Hello

    Received Unknown Message

    msgType = 0x8080

    Length = 0x8080

    …"

    We could believe the connection among USB cable, SparkFun Serial Basic board and SparkFun Edge board is OK.

    4, Re-build flash binary through the commands as below:

    1. make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_edge micro_speech_bin [enter]

    2. python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/create_cust_image_blob.py --bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/micro_speech.bin --load-address 0xC000 --magic-num 0xCB -o main_nonsecure_ota --version 0x0 [enter]

    3. python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/create_cust_wireupdate_blob.py --load-address 0x20000 --bin main_nonsecure_ota.bin -i 6 -o main_nonsecure_wire --options 0x1 [enter]

    5, Unplug then re-plug the USB cable to laptop again, go through the steps as below.

    1. sudo chmod a+rw /dev/ttyUSB0 [enter]

    2. python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/uart_wired_update.py -b ${BAUD_RATE} ${DEVICENAME} -r 1 -f main_nonsecure_wire.bin -i 6 (NOT PRESS [enter])

    3. Hold button 14, press button RST quickly (LED blue will be off then), press [enter] at terminal (keep holding buttion 14! )

    4. The following messages should display at terminal:

    "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

    Sending Reset Command.

    Done.

    "

    1. The flashing is successful if such message displays :slight_smile:

    Awesome! Thanks for sharing your experience, I think it will help others.

    Also on large uploads the COM port timeout is too small. This will be fixed in the next release of the core

    A note that may be necessary

    On my Ubuntu 18.04 case, the system will restore default USB serial driver, which is ch31, when it reboots.

    So, re-installing the ch34x driver is required, the steps of which are on https://learn.sparkfun.com/tutorials/ho … vers#linux. There is another solution probably, which is to install the ch34x driver into Linux system permanently.

    Let me sum up the steps to re-flash SparkFun Edge board after my Ubuntu 18.04 reboots.

    1, Make sure the re-flashing can work as I described on my last post.

    2, Rebooting the Linux system, then open a terminal, go through the steps as below.

    1. Following https://learn.sparkfun.com/tutorials/ho … vers#linux,

    cd into the directory where the ch34 driver was built.

    1. Type command

    sudo make load[enter]

    1. Plug and unplug the USB A-C cable, the other terminal of which connects SparkFun Serial Basic board, to laptop.

    2. Type the command as below,

    dmesg [enter]

    The results on my laptop are:

    “[ 436.033172] usb 3-3: ch34x converter now attached to ttyUSB0

    [ 436.056135] usbcore: registered new interface driver ch341

    [ 436.056166] usbserial: USB Serial support registered for ch341-uart

    [ 438.028741] usb 3-3: USB disconnect, device number 8

    [ 438.029153] ch34x ttyUSB0: ch34x converter now disconnected from ttyUSB0

    [ 438.029213] ch34x 3-3:1.0: device disconnected”

    1. Plug the USB cable to laptop again, type the following command:

    sudo chmod a+rw /dev/ttyUSB0 [enter]

    1. cd into the directory of tensorflow-aa47072ff4e2b7735b0e0ef9ef52f68ffbf7ef54, type the command:

    python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/uart_wired_update.py -b ${BAUD_RATE} ${DEVICENAME} -r 1 -f main_nonsecure_wire.bin -i 6 (NOT PRESS [enter])

    1. Hold button 14, press button RST quickly (LED blue will be off then), press [enter] at terminal (keep holding buttion 14! )

    2. The following messages should display at terminal:

    "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

    Sending Reset Command.

    Done.

    "

    1. The flashing is successful if such message displays

    For Ubuntu 18.04 I used https://github.com/OLIMEX/ch340-dkms so that the driver automatically recompiles on kernel updates.