I have a system with a bootloader which loads the main application into RAM.
Both the bootloader and the main application are standard Pico SDK applications; the bootloader is copy_to_ram and has a custom linker script that keeps it up at the high end of RAM leaving the low end free; the main application is no_flash (and the standard linker script) so that the code lies at the start of RAM and the stack overlays where the bootloader used to be. This much all works fine.
Entry from bootloader into the main program is by simply jumping to the entry point at 0x20000000 (plus 1 for thumb mode).
The only problem I have with all of this is that the GPIOs are supposed to be set up by the bootloader, but during the SDK startup runtime_init() gets called, and this does a reset_block(...) on most of the functional blocks, including the GPIOs.
This is not just the inconvenience of having to re-do the GPIO initialisation in the main app, but more importantly it means there's a glitch when all the GPIOs go back to floating-input-with-pulldown, which in my case causes external hardware to get reset.
Anyone know of a neat way of bypassing runtime_init() without hacking around inside the SDK?
Both the bootloader and the main application are standard Pico SDK applications; the bootloader is copy_to_ram and has a custom linker script that keeps it up at the high end of RAM leaving the low end free; the main application is no_flash (and the standard linker script) so that the code lies at the start of RAM and the stack overlays where the bootloader used to be. This much all works fine.
Entry from bootloader into the main program is by simply jumping to the entry point at 0x20000000 (plus 1 for thumb mode).
The only problem I have with all of this is that the GPIOs are supposed to be set up by the bootloader, but during the SDK startup runtime_init() gets called, and this does a reset_block(...) on most of the functional blocks, including the GPIOs.
This is not just the inconvenience of having to re-do the GPIO initialisation in the main app, but more importantly it means there's a glitch when all the GPIOs go back to floating-input-with-pulldown, which in my case causes external hardware to get reset.
Anyone know of a neat way of bypassing runtime_init() without hacking around inside the SDK?
Statistics: Posted by arg001 — Sun Apr 28, 2024 8:10 pm