Back to Smartcitizen.me

USB mode not working after Firmware Update attempt

Hello. First of all, I am using Ubuntu 21.10 (XFCE) and I have searched through the forum to see if someone had my same issue, but had not found it. Also, I don’t have an Apple device for testing, only Linux/Unix machines.

I tried the kit (2.1) and worked. Then I decided to update the firmware. The moment I copied the new firmware (SAM) to the USB folder it self unmounted.

Then, I launched screen to access shell and with “version” command I saw that I still had SAM 0.9.6 and not the expected 0.9.8.

I wanted to try again but, alas, pressing twice the reset button I didn’t go into usb mode. Instead, the board seems to shut down (no lights on LEDs).

I did a factory reset (pressing the on/off button 5 + 15 s) and the usb issue persists.

However, I can still connect to the board through the shell and get (for version)

Hardware Version: 2.0
SAM Hardware ID: 454FBC2F50573946302E3120FF0A0F32
SAM version: 0.9.6-3e7b809
SAM build date: 2019-09-09T15:55:30Z
ESP MAC address: 8E:AA:B5:6C:DE:75
ESP version: 0.9.2-a91f850
ESP build date: 2019-08-20T13:17:16Z

When I plug the USB cable (I have tried three of them), I get the following output:

$ lsusb
Bus 003 Device 018: ID 2341:804d Arduino SA Smartcitizen Kit
$ sudo dmesg
[ 2378.624428] usb 3-2: new full-speed USB device number 18 using xhci_hcd
[ 2378.779677] usb 3-2: New USB device found, idVendor=2341, idProduct=804d, bcdDevice= 1.00
[ 2378.779691] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2378.779695] usb 3-2: Product: Smartcitizen Kit
[ 2378.779698] usb 3-2: Manufacturer: Arduino LLC
[ 2378.779701] usb 3-2: SerialNumber: 454FBC2F50573946302E3120FF0A0F32
[ 2378.783738] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
vim /var/log/syslog
Feb  9 12:47:32 localhost kernel: [ 3889.636294] usb 3-2: new full-speed USB device number 20 using xhci_hcd
Feb  9 12:47:32 localhost kernel: [ 3889.791941] usb 3-2: New USB device found, idVendor=2341, idProduct=804d, bcdDevice= 1.00
Feb  9 12:47:32 localhost kernel: [ 3889.791955] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb  9 12:47:32 localhost kernel: [ 3889.791959] usb 3-2: Product: Smartcitizen Kit
Feb  9 12:47:32 localhost kernel: [ 3889.791962] usb 3-2: Manufacturer: Arduino LLC
Feb  9 12:47:32 localhost kernel: [ 3889.791965] usb 3-2: SerialNumber: 454FBC2F50573946302E3120FF0A0F32
Feb  9 12:47:32 localhost kernel: [ 3889.794847] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
Feb  9 12:47:32 localhost mtp-probe: checking bus 3, device 20: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"
Feb  9 12:47:32 localhost mtp-probe: bus: 3, device: 20 was not an MTP device
Feb  9 12:47:32 localhost upowerd[1789]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2
Feb  9 12:47:32 localhost snapd[1196]: hotplug.go:199: hotplug device add event ignored, enable experimental.hotplug
Feb  9 12:47:32 localhost mtp-probe: checking bus 3, device 20: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"
Feb  9 12:47:32 localhost mtp-probe: bus: 3, device: 20 was not an MTP device

Any help would be appreciated.

Hi!

Thanks for posting in the forum. Checking on the outputs you posted, the Hardware Version: 2.0 is a bit puzzling. Could you clarify which hardware and firmware versions you used?

Thanks!

Could you clarify which hardware and firmware versions you used?

I’m happy to, but I provided the output from the “version” command. I’m not sure of any other source of knowing my hw/fw. In the kit’s box it says kit v2.1, SCK Data Board 2.1 and the sensor board says SCK 2.1. How else can I check the firmware version?

Edit: The firmware file I tried to install is SAM_firmware_098.uf2

Hi!

OK, seems enough info. The SAM_firmware_098.uf2 can only be from the smartcitizen-kit-21 repo

Since you are using linux, I would have suggested to first look into the udev rules (more here), but since it worked first time, it seems that probably is an issue with a wrong bootloader? Maybe also do a sudo service udev restart and try again??

Before going into bootloader stuff, I would first give a try to flash the kit using something like platformio. Since you are versed in command line, maybe you could give a try to compile the firmware and flash it using these tools? (guide here) If it doesn’t help, we keep looking.

1 Like

Sorry for the late response.

Maybe also do a sudo service udev restart and try again??

Did not work.

you could give a try to compile the firmware and flash it using these tools?

I cloned the repo with

git clone --recursive https://github.com/fablabbcn/smartcitizen-kit-21
git pull --recurse-submodules

and then, executed

python3 make.py build flash sam -v

The building part seemed OK, but I got this:

ERROR No SCK found

After the last command, I get no light from any LED anymore in the board. Before that command I could access the previous version of the firmware, but now I don’t get any serial port and even lsusb does not show the device.

Looked into docs and would guess that I corrupted the bootloader. In this page the link pointing to this another page seems broken. But I understand that it tries to point to this page instead.

This last page looks really daunting.

I would appreciate any advice. Thank you.

Hi,

That is very weird. The python script will not do anything unless there is a way to create a serial device on the port you have the SCK. This script shouldn’t have done anything if the SCK was not found in the first place…

Some additional background questions:

  • Does the kit light up at all now? Is there any response whatsoever when you connect the USB?
  • Is the behaviour the same with or without the Urban Board, battery… ?

One additional thing to look at, is that at least in some cases, you need to follow these steps for the firmware script to work, since the udev rules are not installed by default in platformio: Frequently Asked Questions — PlatformIO latest documentation

Finally, since this is similar to what we have already done, I would ask about: do you have a pi or a debugger nearby? This would be necessary to Burn the bootloader back on.

Thanks a lot for the reply.

Does the kit light up at all now? Is there any response whatsoever when you connect the USB?

The only response right now is a dim and ephemeral green light from the status LED whenever I press the reset button.

Is the behaviour the same with or without the Urban Board, battery… ?

Exactly the same behaviour with and without the Urban Board.

One additional thing to look at, is that at least in some cases, you need to follow these steps for the firmware script to work, since the udev rules are not installed by default in platformio:

Before building and trying to flash the firmware, the command lsusb recognised the device, although I could not mount it. Now lsusb is not showing anything for the board. But I will study the link you provided.

do you have a pi or a debugger nearby? This would be necessary to Burn the bootloader back on.

I don’t have a debugger and don’t even know what this is :confused: I have an old pi as a home server.

I don’t know if I am asking too much, but I live in Barcelona. Is there any chance I can go somewhere where a debugger is already running so I can use it to burn the bootloader back? Sorry if this is not appropriate.

Many thanks again.

Hi!

Blockquote
I don’t know if I am asking too much, but I live in Barcelona. Is there any chance I can go somewhere where a debugger is already running so I can use it to burn the bootloader back? Sorry if this is not appropriate.

Sure! why not!
Drop an email at support@smartcitizen.me and you can come visit us. We would keep the kit for a couple of days to check it and give it back to you after that if it’s OK.

It is better than OK :smiley:

Thanks a lot. Will surely write soon.