Badger 2040 / RP2040 "list index out of range" error in /images directory, accidentally deleted /images directory

I am unsure how exactly this happened; I believe that when I had the Badger 2040 connected to Thonny as a backend and had an image open via the /images directory (for 296px*128px images), I deleted the image in the directory while it was still on the Badger screen. I then added a new image to the directory and reset the Badger, and I got a screen error message on the Badger saying, “list index out of range.” I tried resetting the device in a new directory open on the Badger (on the ID badge section) and then return to the images section on the Badger, and I get the same “list index out of range” error.

I then deleted the original /images directory with the original badge text file and badger sample image, and resetting the Badger without that directory tells me that I need to make a new /images directory. I created a new /images directory and included a new image which had worked before I started getting the “list index out of range” error, and it doesn’t work, again giving me the “list index out of range” error.

I am not sure how to fix this; I haven’t seen an error in the code elsewhere, I’ve just updated the firmware and I am able to change the badge image in the ID badge section (the one with the smaller 104*128 frame). There’s no solutions available through other forums or searching. Would appreciate help/guidance/tips!

1 Like

I think it’s probably the state file that remembers what image is being shown that’s causing problems - try deleting the contents of the /state directory using Thonny?