Hi,
I am trying to get this working with blink_noboot (https://github.com/usedbytes/pico-blink-noboot2) and the RP2040 serial bootloader (https://github.com/usedbytes/rp2040-serial-bootloader).
I have read through the previous issue thread and changed the bootloader size to 28k.
Are the following memories now correct?
bootloader.ld:
MEMORY { FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 24k RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k }
combined.ld:
MEMORY { FLASH_BL(rx) : ORIGIN = 0x10000000, LENGTH = 24k FLASH_IMGHDR(rx) : ORIGIN = 0x10000000 + 24k, LENGTH = 4k FLASH_APP(rx) : ORIGIN = 0x10000000 + 28k, LENGTH = 2048k - 28k RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k }
blink_noboot2.ld:
MEMORY { FLASH(rx) : ORIGIN = 0x10000000 + 28k, LENGTH = 2048k - 28k RAM(rwx) : ORIGIN = 0x20000000, LENGTH = 256k SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k }
main.c (bootloader):
'#define IMAGE_HEADER_OFFSET (24 * 1024)'
I have also added the following to the end of the while(1) in the bootloader main.c, I believe this should make the bootloader jump to blink_noboot2 when i disconnect BOOTLOADER_ENTRY_PIN?
if (!should_stay_in_bootloader()) { uint32_t vtor = XIP_BASE + (1024 * 28); disable_interrupts(); reset_peripherals(); jump_to_vtor(vtor); }
I am doing the following steps:
1)Build bootloader
2) Copy the .uf2 to the Pi Pico using the mass storage USB bootloader
3) Build blink_noboot2 and copy the .uf2 to desktop
4) Open the command terminal (windows) and run serial-flash COM9 blink_noboot2.uf2 0x10007000
5) I get the following output:
Opened COM9 Synchronising: 1 / 5 [==========>--------------------------------------------] 20.00% 29/s 0s Querying device info: 1 / 1 [======================================================] 100.00% 101/s 0s Erasing: 40960 / 40960 [===========================================] 100.00% 122346/s 0s Writing: 40960 / 40960 [============================================] 100.00% 64226/s 0s Finalising: 1 / 1 [=======================================================] 100.00% 67/s 0s
Error: seal: received error response`
6) RP2040 LED is on. If I disconnect the BOOTLOADER_ENTRY_PIN, the LED stays on, indicating I am not jumping to program?
7) If I power cycle the RP2040 with the BOOTLOADER_ENTRY_PIN disconnected (high), I get a brief flash, then nothing.
Any guidance you can give on this would be much appreciated.