Trouble with flashing firmware

Hello!

Yes in step 8 you are trying to connect to the bridge from a new terminal. The bridge has its own serial CLI that can be used to update it.

The reboots from the Spotter are its way of attempting to recover a missing/broken peripheral, so yes, it is the Spotter that is ending the serial connection.

It sounds like the bridge is in a really poor state, and by that I mean it is stuck in its MCUBoot bootloader. I can explain more on how it got into this state if interested but I will go ahead and list the steps needed to recover it. For this you will need to open up the ebox even more and once again if you are uncomfortable with these steps we can coordinate getting the ebox back to Sofar where we will fix it for you and send it back.

For this you will need dfu-util on your computer and a T-10 screwdriver like this:

You can install dfu-util on a mac using the following command in the terminal.

brew install dfu-util

For linux check out the dfu-util page: https://dfu-util.sourceforge.net/

Steps:

  1. unplug the battery from the bottom of the ebox
  2. using the T-10 screwdriver, unscrew the 4 ebox screws and remove the PCBs from the ebox.
  3. you should now have a PCB board stack that looks like this from the top:

and this from the bottom:

  1. Plug the battery back into the ebox

  2. connect the usb-micro to the bridge and the usb-c to the spotter. You should have something looking like this:


  3. Orient the board stack such that you have access to these buttons on the bottom:


    Take note of the BOOT1 button to the right of the micro-usb and the RST1 button on the far left!

  4. Turn on the spotter

  5. Open two terminal windows. In one terminal, connect to the Spotter CLI. Once again wait until the spotter is done resetting itself, then issue “gpio set 3v3_bridge_en” to turn on power to the bridge

  6. Press and hold the BOOT1 button, then without releasing BOOT1, tap on the RST1 button, then you can release BOOT1. This will put the bridge into its ROM bootloader and from there we can update it with dfu-util.

  7. In the second terminal window check to make sure the bridge is accesible to dfu-util by issuing:

dfu-util -l

you should see something like:

dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [0483:df11] ver=0200, devnum=5, cfg=1, intf=0, path="0-1.4", alt=2, name="@OTP Memory   /0x0BFA0000/01*512 e", serial="208937834D30"
Found DFU: [0483:df11] ver=0200, devnum=5, cfg=1, intf=0, path="0-1.4", alt=1, name="@Option Bytes   /0x40022040/01*64 e", serial="208937834D30"
Found DFU: [0483:df11] ver=0200, devnum=5, cfg=1, intf=0, path="0-1.4", alt=0, name="@Internal Flash   /0x08000000/256*08Kg", serial="208937834D30"

If you dont see the last three lines then the bridge is not in the ROM bootloader and I would double check that 1. it is getting power and 2. the button sequence was pressed correctly.

  1. If the bridge is present, then issue the following command to update the bridge (make sure the file path is pointing to where you have your bridge.bin file)
dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s 0x8000000:leave -D ~/Downloads/bridge_v4_0-bridge.elf.unified.bin
  1. You should see the following after dfu-util is complete:
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Warning: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release
Opening DFU capable USB device...
Device ID 0483:df11
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash   "
Downloading element to address = 0x08000000, size = 250120
Erase   	[=========================] 100%       250120 bytes
Erase    done.
Download	[=========================] 100%       250120 bytes
Download done.
File downloaded successfully
Submitting leave request...
dfu-util: Error during download get_status

(don’t mind the error at the end)
11. You should then be able to see the following in your available serial ports:

---  3: /dev/cu.usbmodem000022DFB3741 'Bristlemouth'
---  4: /dev/cu.usbmodem000022DFB3743 'Bristlemouth'
---  5: /dev/cu.usbmodem1301 'Spotter'
  1. You can connect to the 3: /dev/cu.usbmodem000022DFB3741 'Bristlemouth' device and type info and verify that it says it is a “bridge”
  2. You can then toggle the on switch for spotter to reset it and reconnect to its CLI then check post to verify that bridgeErrorState is now “OK”.