Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4445

General • Clarification on GDB firmware load

$
0
0
I'm tinkering with a Raspberry Pi Pico without using the official SDK (writing my own linker script, build system and drivers).
What I've done up until now works but I've got some doubts about the loading mechanism.
To load up the firmware I connect a GDB instance to an OpenOCD server and run the following commands:

Code:

target extended-remote localhost:3333monitor reset initloadcontinue
I'm building a simple stage 2 bootloader that just flashes the on board LED.
I can load up the binary both in RAM and FLASH and it will work immediately.
This is the linker script I'm using (with FLASH load, just swap FLASH with RAM for the counterpart):

Code:

MEMORY {    FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048k    RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k}SECTIONS {    .text : {        . = ORIGIN(FLASH);        KEEP(*(.boot2_entry));        KEEP(*(.text*));    } > FLASH}
Loading it into RAM obviously works, but unexpectedly the FLASH option works as well.
Shouldn't GDB try to run from the beginning of the text section and fail because the XIP has not been configured yet (my stage2 just blinks the LED here)? Does GDB load the binary directly to the configured memory, or is it always from RAM?

Statistics: Posted by maldus — Fri Apr 12, 2024 11:56 am — Replies 0 — Views 17



Viewing all articles
Browse latest Browse all 4445

Trending Articles