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

SDK • Re: Declare a 128Kb array with 128Kb alignment on an rp2040?

$
0
0

UPDATE: Unfortunately with PICO_NO_RAM_VECTOR_TABLE=1, it boots, but then goes straight in panic mode. Caught in debugger, both on RP2040 and RP2350.
OK, it is not needed to build with PICO_NO_RAM_VECTOR_TABLE to get this 128K aligned section working, I just saw that in the source as an example that ROM probably does not care about where the vector table is.

Anyway, I tried it and it seems to work. Modified linker script like

Code:

    .uninitialized_dma_buffer (NOLOAD): {        . = ALIGN(4);        *(.uninitialized_dma_buffer*)    } > RAM        .ram_vector_table (NOLOAD): {        . = ALIGN(256);        *(.ram_vector_table)    } > RAM
Then created blink example and added

Code:

uint8_t volatile dma_buffer[0x20000] __attribute__ ((section (".uninitialized_dma_buffer")));......int main() {    memset((void*)dma_buffer,255,sizeof(dma_buffer));    int rc = pico_led_init();......
and I can see the LED blinking after flashing uf2 file and in blink.dis I see

Code:

 4 .uninitialized_dma_buffer 00020000  20000000  20000000  00004000  2**2                  ALLOC  5 .ram_vector_table 000000c0  20020000  20020000  00004000  2**2                  ALLOC
so the vector table is moved

Statistics: Posted by fanoush — Tue Oct 15, 2024 10:59 pm



Viewing all articles
Browse latest Browse all 6069

Trending Articles