Homemade is stuck in USB boot mode

Hello! Super excited about the Arduboy. I was looking for plans to build a simple button board around my favorite dev kit, the D1 mini, that my kids could learn to program on when I discovered Arduboy instead.

I went right to building a homemade system on breadboard using a bare 32u4, SPI OLED and flash cart. I used a combination of Billy Cheung’s ArduBaby schematic, MyAlexro’s EasyEDA design and the official schematic. One exception: I am powering the whole board from a USB breakout. Trying to minimize the power circuitry and use removable USB power banks.

I uploaded a bin of games using Mr. Blinky’s Python scripts and I burned the Cathy3k bootloader using an UNO as ISP.

My problem is, everything works fine as long as I drive the homemade system using the UNO as ISP. Once I disconnect it and apply power to the USB breakout, the system gets stuck at the USB boot mode. Pressing A or B drops me to the last game I was playing but I can’t get back to the menu unless I re-attach the UNO and disconnect the USB.

One thing of troubleshooting I did was to pull the UNO one wire at time and it seems like the SCK line is the one that, if connected, allows the system to boot to menu instead of the USB boot symbol.

I’m thinking the Cathy3k has some logic to detect a device on USB and is preventing the system from booting to menu or I just have something wired wrong. Any suggestions?

Thanks so much for the help.

The Cathy3k requires the external flash mod W25Q128 to be installed, if you’re seeing that boot menu that means it can’t find the flash.

Also you need to pay attention to the old vs new wiring as that changes the flash CS pin, I’m not sure how to define that but maybe @mr.blinky can add

For a test you could try to run the activator sketch to see if that finds the flash chip but I suspect it won’t…

Oh, also I realized, you need to put data on the flash chip!! If it’s still blank this is normal, run the activator and upload a flash image.

Can you show a picture of your setup and /or have a drawing of how you’ve wired things up? One of my first guesses would be that there is a power issue with the USB breakout and the setup only get’s (enough) power when you hook up the Uno.

Also curious how you’ve wired up a bare 32u4.

When using Cathy3K bootloader a flashchip is not mandatory. The USB logo shows when it can not find a flash chip or the flashchip is not initialized or it’s contents is corrupted. Also the flash chip doesn’t exactly has to be an W25Q128 but it’s recommended.

OK, I’m going to try replying by email and include a pic since I’m at work and the site is blocked by my firewall.

The Cathy3k requires the external flash mod W25Q128 to be installed, if you’re seeing that boot menu that means it can’t find the flash.

The w25q128 is installed and presumably working since I can write to it, read from it and self-program the 32u4, when the UNO is plugged up to the system. I also tested the flash chip using the UNO and the examples from the SPIMemory library. I’m using @mr.blinky’s Python scripts to write the provided bin file with reported success from the command prompt (Win 10).

Also you need to pay attention to the old vs new wiring as that changes the flash CS pin, I’m not sure how to define that but maybe @mr.blinky can add

I’m trying to use the SDA pin but I have tried the RX pin too. No change there.

For a test you could try to run the activator sketch to see if that finds the flash chip but I suspect it won’t…

I’m not sure of what the activator sketch is but I have run @mr.blinky’s Python scripts and the SPIMemory examples to identify the chip.

Oh, also I realized, you need to put data on the flash chip!! If it’s still blank this is normal, run the activator and upload a flash image.

Oh, then I guess I did that with the bin file.

Can you show a picture of your setup and /or have a drawing of how you’ve wired things up? One of my first guesses would be that there is a power issue with the USB breakout and the setup only get’s (enough) power when you hook up the Uno.

I’ll get a picture up of my breadboard if you really feel like looking at spaghetti :slight_smile: I don’t yet have the 3V3 regulator shown in my schematic. Instead I’m running the flash chip and the logic level converter from a separate power supply with a common ground to the rest of the system. So I don’t think it’s a power problem.

Also curious how you’ve wired up a bare 32u4.

Mounted it on a breakout PCB of my own design per the schematic above.

Thanks so much for your help, @mr.blinky and @bateske.

What?

Sounds like maybe the flash chip isn’t getting power when it’s on it’s own? Or some other connection is otherwise getting interrupted.

32u4 in top left corner, USB breakout next to it. Reset button bottom right with level converter, flash and OLED to the right. That power supply is set at 3.3.

If you are supplying it with 3.3 volts but communicating with it at 5v logic could potentially be the problem, is it powered by 5v when the uno is attached?

Nope, got the logic level converter right next to the flash chip. SPI from 32u4 is going through it. I really think the problem lies with the clock signal since it works fine when clock is supplied by the Uno.

I put together another 32u4 breakout board, this time with the crystal plugged into the breadboard but that didn’t change anything.

Do you mean that when the UNO is connected to the ICSP header the 32u4 and flash chip as the Arduboy FX works as intended? Like the bootloader menu comes up and you can flash the memory through the usb interface of the 32u4?

Because, the UNO shouldn’t be creating any kind of CLK signal and in fact it would be impossible for any of this to work if it was, because it would interfere with the one generated by the 32u4.

You can test if it’s power related if you independantly power the “Arduboy” circuit and the 32u4 side, and then do not connect the power connection of the UNO, only the ground and the data pins.

You should observe the behavior then as this will isolate the power.

Thanks for sharing the diagram and picture. I haven’t had a good look at them yet. But I’d like to say the SCK (and MOSI) are fine as they are also used to write data to the OLED if SCK was bad then you’d be looking at a black screen.

when the Uno is programmed as ISP then the ISP pins should be in input mode and SCK shouldn’t have an effect (Not sure if internal pullup is enabled though). If it was in output mode then it would interfere with the 32u4 clock and the display would most likely not display anything. Two things that come to mind atm:

  • Bad breadboard connection. When inserting the SCK wire the other wire just connected a bit better.
    -> try inserting the SCK wire like you did but don’t connect it at the Uno side.

  • The level shifters board pullup resistor on SCK is bad or has a bad connection. The Uno’s internal pullup replaces it when you connect the SCK wire.
    -> Try pulling SCK up with a 10K resistor.

You could also try a spare levelshifter board if you have one.

@Mr.Blinky is an expert on bad breadbords

1 Like

@Mr.Blinky is an expert on bad breadbords

Then I found the right person to talk to. I ripped up the whole board last night, moved components around, shortened the run between the 32u4 and the logic level converter and flash memory pair. I made the SPI bus look more like a star radiating from the 32u4 to llc and oled display rather than an actual bus like I had it before. Electrically nothing changed but I thought the star topology might reduce the introduction of noise or resistance from the breadboard.

This morning before leaving for work I applied power, 5v on the USB breakout and the Uno for 3v3 to the llc and memory, and it booted up just like it’s supposed to. I get the Arduboy menu and I flashed a few games - things seem to be working well.

I have an intermittent problem with the screen being only partially re-drawn when I press reset. I’m also concerned about why some title screens look fuzzy and some are sharp. Probably more breadboard woes but if I can’t figure it out I’ll open another thread.

Next steps: I’ve got 3v3 regulators coming in the mail so I can ditch the Uno. Also, while troubleshooting this problem, I discovered the txb0104 in @Mr.Blinky’s schematics. That will save me a bunch of soldering and PCB space. Ultimate goal here is to get this thing onto PCB.

1 Like

Make a PCB!

Probably should have posted this first but I only got around to taking this picture tonight.

I have this thing too that I threw together just for fun.

Anyway, thanks again for your help. I have one of those 2.42" OLED displays coming in the mail. I want to see how that works out before making ordering some PCBs.

1 Like

Good choice of game!

3 Likes

Lol, thank you. I see you are one of the devs. Thanks very much for the work you put into the game. One of my kids just LOVES it.