tonarino / panel-firmware

Firmware for the volume control hardware, targeting an STM32F4 board
MIT License
74 stars 10 forks source link

Firmware won't enter DFU bootloader mode if volume dial and +12V barrel jack are connected #27

Open bschwind opened 3 years ago

bschwind commented 3 years ago

This is a pretty strange issue. I noticed that the firmware will never enter DFU bootloader mode if both the volume dial and +12V barrel jack are connected.

If it's just the volume dial or just the +12V barrel jack, it will enter bootloader mode.

The overhead lighting connectors also don't seem to have any influence on this behavior.

efyang commented 3 years ago

Have you tested this with the volume dial and 12V jack connected, but neither of the overhead lighting connectors connected? This is a wild guess but the datasheet says: "The bootloader is located in system memory. It is used to reprogram the Flash memory by using USART1(PA9/10), USART2(PD5/6), USB OTG FS in device mode (PA11/12) through DFU (device firmware upgrade), I2C1(PB6/7), I2C2(PB10/3), I2C3(PA8/PB4), SPI1(PA4/5/6/7), SPI2(PB12/13/14/15) or SPI3(PA15, PC10/11/12)." I think possibly a combination of an encoder high signal + leakage current from the 12V jack through the transistor to the gate (since the gate doesn't have a pulldown resistor) might be making the microcontroller think it should boot into some other mode. Again, total shot in the dark. It might be useful to get some voltages on all the pins when DFU is working and when it isn't as well.

efyang commented 3 years ago

See: this example circuit (courtesy falstad circuit simulator) with pulldown on gate: image and without pulldown on gate: image

bschwind commented 3 years ago

The transistor leakage current theory sounds pretty likely!

The weird thing is, I was able to remotely update one of the panels remotely in our staging environment, so it's at least somewhat functional.