raspberrypi-rp2040/rp2040.ld
David Sugar 20e4c9f8f6
Flash from user code (#35)
* support for a subset of the bootrom functions added: fast bit count/ manipulation functions (tested), fast bulk memory fill/ copy functions (tested), flash access functions (NOT tested), debugging support functions (not implemented), miscellaneous functions (not implemented).

* added support for erasing and programming flash from user code. between the first and last call in a programming sequence, the SSI is not in a state where it can handle XIP accesses, so the code that calls the intervening functions must be located in SRAM. this is why I added the time_critical section to rp2040.ld (maybe one should create a dedicated section in ram that is rwx and keep data rwNx).

* flash_program.zig example added
2023-04-05 17:29:08 -07:00

60 lines
992 B
Plaintext

/*
* This file was auto-generated by microzig
*
* Target CPU: ARM Cortex-M0+
* Target Chip: RP2040
*/
ENTRY(microzig_main);
MEMORY
{
flash0 (rx!w) : ORIGIN = 0x10000000, LENGTH = 0x00200000
ram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
}
SECTIONS
{
.boot2 : {
__boot2_start__ = .;
KEEP (*(.boot2))
__boot2_end__ = .;
} > flash0
ASSERT(__boot2_end__ - __boot2_start__ == 256,
"ERROR: Pico second stage bootloader must be 256 bytes in size")
.text :
{
KEEP(*(microzig_flash_start))
*(.text*)
*(.rodata*)
} > flash0
.ARM.exidx : {
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} >flash0
.flash1 :
{
*(.flash1)
} > flash1
.data :
{
microzig_data_start = .;
*(.time_critical*)
*(.data*)
microzig_data_end = .;
} > ram0 AT> flash0
.bss (NOLOAD) :
{
microzig_bss_start = .;
*(.bss*)
microzig_bss_end = .;
} > ram0
microzig_data_load_start = LOADADDR(.data);
}