Can't get an IDE to work with Badger2350. Can anyone help?

I’m trying to port an app from a broken Badger 2040W, which I originally coded using Thonny and VS Code with MicroPico on Ubuntu.
Just trying to do anything at all with the Badger 2350 and not having much luck.
Thonny on Ubuntu doesn’t connect at all.
Tried the Thonny ‘alternative badgeware workflow’ example from Windows 11, but the shell just shows ‘MPY: soft reboot’ and nothing else happens.
Tried VS Code/MicroPico from Windows, it connects but running anything gives errors, e.g. running main.py gives:
Traceback (most recent call last):
File "", line 7, in
NameError: name 'State' isn't defined

Has anyone managed to get a functioning IDE workflow with Badger2350?

They say: " Our recommended process for working with Badgeware devices is to set the board as a USB disk… …and then copy over your files" - are they serious? We should write a bug free app and expect it to run without a debugger?

I found the Badger 2040W fairly straightforward, but getting nowhere so far with Badger 2350.

Thanks,

Rob.

I also note that even with a fresh install of firmware, the clock app on the Badger2350 fails to run with AttributeError: 'module' object has no attribute 'require'

Mainline MicroPython (and prior versions of PimoroniPython) use the serial interface to copy files to the device. VSC and Thonny use this under the hood. The new Badger2350 exposes an additional USB “drive”, so you don’t have to go through serial anymore for copying files. This is a great gain, since you can just copy whole directory trees in one go and even use advanced methods to only copy changed files (xcopy has this, or rsync). Added benefit: you edit locally on your PC (where you also have a solid backup) and then deploy when you think you are ready. No more direct on device editing with loosing everything if the device has problems.

The Badger2350 firmware has a very specific architecture: it provides the “main” program and you provide an “app” as a sort of plugin that the main program calls. If you don’t like this approach, get rid of the main program, write your own and only use the badge module which provides some basic methods you need to interface with the hardware.

I don’t own a Badger, but I do have a Tufty 2040 and 2350. On my Pi 5 I connect via Thonny. Then in Thonny, I open the file I want to tinker with, and save it to the Pi5. I do all my run’s, saves, edits on that file in Thonny and save to the Pi 5. If I try to save it to the Tufty 2350 from Thonny I get an error, so once I’m done editing I put the Tufty in Disk mode and copy it over that way. No error and my edited file is the one on the Tufty.
It’s a bit of a pain, but it’s what works. I just run my one app as main.py.

Hello, thanks for the replies.

Edit locally on the PC and deploy when ready sounds fine as long as I can run and debug from the PC, and I haven’t been able to get that to work. Is it known to be possible with Badger2350? The examples seem to mostly use Tufty, so I’m wondering if Badger isn’t properly supported.
At the moment, just getting any “Hello World” to run from the PC would be a good start.

If anyone could confirm that running and debugging on Badger2350 from a PC is possible, and give clear, simple steps to run or debug a “Hello World” from either Thonny or VS Code on either Ubuntu or Windows 11, I’d be most grateful.

Many thanks,

Rob.

I’ve not got VS Code setup for debugging - I really should as I transfer from Thonny into VS Code to push my code to GitHub and it’ll be faster.

I’m able to debug using Thonny with my Badger 2350, it can be a little funny I’ve noticed but with the badge open and running the main menu screen, with Thonny open, if I plug it in I can select it from the device list in Thonny (bottom right) and it interrupts as expected:

Traceback (most recent call last):
  File "main.py", line 22, in <module>
  File "/system/main.py", line 17, in <module>
  File "badgeware/__init__.py", line 115, in launch
  File "/system/apps/menu/__init__.py", line 81, in <module>
  File "badgeware/__init__.py", line 41, in __init__
  File "badgeware/__init__.py", line 51, in __call__
  File "/system/apps/menu/__init__.py", line 78, in update
  File "badgeware/__init__.py", line 75, in wait_for_button_or_alarm
KeyboardInterrupt: 
MicroPython bw-1.28.0-3, badger  on 2026-08-18; Pimoroni Badger 2350 with RP2350
Type "help()" for more information.
MicroPython bw-1.28.0-3, badger  on 2026-08-18; Pimoroni Badger 2350 with RP2350

Type "help()" for more information.

>>> 

I’m using a Mac, but I’ve just tried running some code with Thonny on Badger and it seems to be working fine for me.

screen.pen = color.white
screen.clear()

screen.pen = color.black

screen.font = font.smart
screen.text("hello world", 10, 14)

badge.update()

The clock app also seems to run without errors for me when run through Thonny, so I wonder if there might be some mismatch between your firmware and the example files stored on the device? Might be worth clearing the flash memory completely by copying this .uf2 to your board, then copying across the latest Badger firmware again?

The code I used above also worked ok in micropico / vscode, though I did need to add an ‘import badgeware’ at the top - Thonny seems to get those globals from boot.py, but Micropico does not.

I don’t know if you are doing this, but don’t put it into boot mode when wanting to connect via IDE.
Just have it on and running, then see if Thonny see’s it.

Thanks for the suggestions.
I think I should get the board into a known working state before I tried and do anything else.
I’ve tried clearing the flash as suggested by hel by copying universal_flash_nuke.uf2 in bootloader mode, followed by copying badger-v3.1.1-micropython-with-filesystem.uf2
Trying to run the clock app (just from the Badger directly, not connected by usb) still gives an error AttributeError: 'module' object has no attribute 'require'

However, it looks like the flash wasn’t actually cleared as it still seems to remember previous state, and looking at ‘board filesystem’ in VS Code I can see files I added the other day.

Any other ideas to properly reset the board?

Thanks.

Yes, Unplug the USB cable, remove the case and unplug the battery. Then push the reset button to drain any residual power. Once it’s completely powered off, power it back up and try a flash nuke and firmware flash with the battery still disconnected. Then plug the battery in and see what’s up.
My Tufty 2350 had a similar type glitch and that was how I cleared it.

Thanks.
I’ve tried alphanumeric’s suggestion, but I still get the same result.

Copying the .uf2 file is clearly doing something; after copying universal_flash_nuke.uf2 nothing works, and if I copy badger-v3.1.1-micropython.uf2 rather than badger-v3.1.1-micropython-with-filesystem.uf2, I see a ‘can’t mount filesystem’ error.
But after copying badger-v3.1.1-micropython-with-filesystem.uf2, state has persisted: ticks in checklist are still there, the weather app can still connect to my wifi. So evidently the board hasn’t been completely reset. And I still get the AttributeError if I try to run the clock app.

Any other ideas for getting it to a clean working state?

Thanks.

Are you leaving it long enough for flash_nuke to finish working? Mine churned away for 30 seconds - 1 min before it popped back up as the empty RP2350 drive.

(When it did it seemed to have correctly cleared all the state files though).

Success! I’ve managed to reset the board and run some code from an IDE (VS Code in Ubuntu).

I hadn’t waited long enough for flash_nuke to complete, thanks to hel for the tip.

And key to getting things to run from the IDE is realising that you need to add some imports to the examples. main.py needs import badgeware, as does the example at https://badgewa.re/docs/introduction/your-first-app.md. Thanks to hel for pointing me in that direction.
I tried running a couple of the built in example apps directly, and with import badgeware added they still failed with NameError: name 'rom_font' isn't defined, so I guess I need to figure out some more imports to get them to run.

Thanks to all for helping me to get started, now that I’ve got some idea of how to make things work I hope I should be able to proceed with porting my app.

I think rom.font is now screen.faunt?
I have the following in use on my Tufty2350
screen.font = font.ignore