greatscottgadgets / saturn-v

DFU bootloader for SAMD11 and SAMD21 microcontrollers
Other
20 stars 11 forks source link

Hold Sideband PHY RESET low on older Cynthions #16

Closed mossmann closed 4 months ago

mossmann commented 4 months ago

~also fix a bug for Cynthion r0.1 and r0.2~

I've tested this on r0.3 and r1.4 but not on r0.2.

mndza commented 4 months ago

I'm not able to make this work on r0.2: I flashed some gateware that shows up in sideband_phy and that's the only thing I'm getting, with and without this PR (and pressing the DFU button).

Is there a difference in the PHY RESET lines between r0.2 and r0.3/r0.4 ?

Also, I had to shorten the manufacturer string due to an 8 byte overflow.

mossmann commented 4 months ago

I'm not able to make this work on r0.2: I flashed some gateware that shows up in sideband_phy and that's the only thing I'm getting, with and without this PR (and pressing the DFU button).

Did you hold DFU while powering on the board? Saturn-V now ignores DFU when RESET is pressed.

mossmann commented 4 months ago

Also, I had to shorten the manufacturer string due to an 8 byte overflow.

I do not see an overflow with arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi. What compiler version are you using?

mossmann commented 4 months ago

Is there a difference in the PHY RESET lines between r0.2 and r0.3/r0.4 ?

The only difference in the hardware design is that the Sideband RESET had an external pull-up resistor in r0.1/r0.2 that was changed to a pull-down in r0.3. However, in the days of r0.2, both the firmware and the hardware design were fairly unstable, and I may have modified the r0.2 board that you now have. Specifically I may have removed or changed R15 and/or R22.

mndza commented 4 months ago

Yes, I tried holding DFU while powering but I still get the gateware to show up. My compiler is gcc version 13.2.0 (Arch Repository).

mossmann commented 4 months ago

Yes, I tried holding DFU while powering but I still get the gateware to show up. My compiler is gcc version 13.2.0 (Arch Repository).

We could actually revert to a 4 KiB bootloader on r0.1/r0.2 because they have much more MCU flash, but I don't want to spend time on that.

I propose that I rework this PR to affect only r0.3/r0.4, leaving Sideband PHY usage somewhat broken on r0.1/r0.2 (as it always has been).

mossmann commented 4 months ago

I made that change and confirmed that the resulting binary for r0.3 was unchanged by the force-push. I also confirmed again that the resulting binary for r1.4 is the same as it is with main.