Badger2040w firmware issue

Hi Team,

Working with Badger2040w and I am seeing some strange issues with firmware.

I had previously been running pimoroni-badger2040w-v0.0.3-micropython-with-badger-os.uf2

For some reason my badger stopped responding so I decided to flash the firmware and start from scratch

It enters bootloader mode fine.

Oddly, it now won’t respond when I provide the same v0.0.3 firmware (either the version with or without the badger-os files).

Rolling back, it also won’t take the v0.0.2
Trying v0.0.1 works and provides functional Badger-os.

Then tried to add v0.0.2 back and it won’t do anything. System freezes.
Same issue trying to add v0.0.3 from a baseline of v0.0.1

Anyone got any ideas or can replicate this behaviour?

If you haven’t already, I would flash_nuke it to be sure there aren’t any files left over.
Raspberry Pi Documentation - Raspberry Pi Pico and Pico W

1 Like

Hi @alphanumeric Thanks so much for the hint.
I’ve given that a shot, but sadly it didn’t work. I wonder if there’s a similar file for the badger side, rather than for the Pico component…

It wipes clean the flash memory used by the RP2040, that should be good enough to reset the badger and make it a blank slate.

One option is to post this as an issue on GitHub.
Issues · pimoroni/badger2040 (github.com)
Or give Pimoroni Tech Support an e-mail.
Contact Us for Raspberry Pi Technical Support - Pimoroni

Hmm, can you talk to the board via Thonny? Does running main.py throw any useful errors?

Here’s my process.

  • Flash nuke
  • Flash pimoroni-badger2040w-v0.0.1-micropython-with-badger-os.uf2
  • Run main.py - No messages, no errors. All seems correct
  • Flash nuke
  • Confirm no button pushes do anything
  • Flash pimoroni-badger2040w-v0.0.3-micropython-with-badger-os.uf2
  • Bootloader volume vanishes
  • Badger LED comes on and stays on
  • Pressing reset button makes LED go off and come back on again
  • Pressing A + C does nothing
  • Thonny can’t see anything on /dev/cu.usbmodem14301

What’s interesting is that a few days ago this was working. I was able to run v0.03. I have noticed quite a lot of system hangs that have needed me to reflash the OS.

Thanks for the details! That’s very odd - just tried flashing v0.0.3 and it’s working fine for me. Please could you drop an email to support@pimoroni.com with your order details and we’ll see if we can organise getting yours back for testing?

2 Likes

I’ve been connecting to the RTC on the pico and I wonder if this is something to do with the problem.

  • Running v0.01 of the firmware and badger-os
  • This code runs fine until I hit the part that calls the rtc time from the crystal on the pico (at which point it hangs)
import machine
import badger2040
import utime
from pcf85063a import PCF85063A

# Create Badger2040 instance
display = badger2040.Badger2040()

# Create Pico's RTC instance
rtc = machine.RTC()

# Create PCF85063A RTC instance
i2c = machine.I2C(0, scl=machine.Pin(5), sda=machine.Pin(4))
rtc_pcf85063a = PCF85063A(i2c)

# Clear screen
display.set_pen(15)
display.clear()
display.set_pen(1)

# Display system's time
display.text(f"system_time: {utime.localtime()}", 10, 0, 1)
display.update()
utime.sleep(0.02)

# Display Pico's RTC
display.set_pen(15)
display.clear()
display.set_pen(1)
display.text(f"pico_RTC: {rtc.datetime()}", 10, 0, 1)
display.update()
utime.sleep(0.02)

# Display PCF85063A's RTC
display.set_pen(15)
display.clear()
display.set_pen(1)
display.text(f"PCF_RTC: {rtc_pcf85063a.datetime()}", 10, 0, 1)
display.update()
utime.sleep(0.02)

debugging this, everything is fine until I call rtc_pcf85063a.datetime()
this command is linked to the PCF85063A.

hmmm… did I fry the pico somehow?

Ooh, a faulty / glitched RTC could definitely explain the problems you’re seeing.

There’s a RTC demo you could try here to see if it unsticks things:

If you’ve got a battery connected you could also try unplugging that and USB to give the RTC a chance to reset.

I disconnected from all power sources, left it overnight, then tried to flash the system

Same behaviour as before.

On the example code it gets as far as "initialise rtc…”

Debugging by hashing out shows that it stalls at this line

rtc = PCF85063A(i2c)

which is similar to what I saw in my own code.

Sorry that didn’t help - suspect you might have a failed RTC in that case?

If you send it back to us we’ll get a replacement sorted :)

1 Like

On the way to you. Hopefully we can update once any information emerges from your disgnostics

I really appreciate your support @hel

2 Likes

To close this thread up for the time being, I wanted to feed back that @hel reproduced this. unexpected behaviour and that this is being written off as a one-off part/device failure. I think it will be worth reviewing this so please respond below if you fund that you see similar errors, especially around using the RTC.

Thanks @Hel for brilliant help and support.

1 Like

I had an identical issue the other day with rtc on Inky Frame. I2C read/write commands to it stalled (blocking) and the bus_scan example from Pico SDK also stalled. Not sure what made it working again.

I have some other issues with my Inky Frames related to sleep and waking up, also around rtc. I expected it to work like my Enviro Indoor which sleeps and wakes up without issues.