pico-examples icon indicating copy to clipboard operation
pico-examples copied to clipboard

Add simple UART bootloader example

Open will-v-pi opened this issue 1 year ago • 2 comments

Add a UART bootloader example, which reads a binary from the partition table on the main device, and uses the UART bootloader to boot that binary on a separate device. Requires a modified separate board to run, as you need access to the QSPI pins to use them as UARTs for the bootloader (see 5.8 in the datasheet) - the main board can be a normal RP2350 board.

This sample binary flashes the LED and prints "Hello, world" back over the UART interface, which demonstrates setting up QSPI GPIOs as UARTs.

will-v-pi avatar Nov 12 '24 18:11 will-v-pi

I wonder if things like the "splash string", the "knock sequence", the "uart-bootloader baudrate", etc. ought to be defined in a header-file somewhere in pico-sdk? (As I assume they'll always be the same for every RP2350 chip?)

EDIT: Ah, perhaps https://github.com/raspberrypi/pico-sdk/blob/develop/src/rp2_common/boot_bootrom_headers/include/boot/bootrom_constants.h would be a good place for those :slightly_smiling_face:

lurch avatar Nov 14 '24 16:11 lurch

This worked well for me once I'd figured out that the uart binary had to be loaded into the "master" device first. It would be more fun if the binary could be built into a header file to avoid that step

peterharperuk avatar Nov 25 '24 17:11 peterharperuk