Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

stm32h7: update linker scripts for ELF boot

Use flash & AXI SRAM for the bootloader, ITCM/DTCM and
SDRAM for Rockbox. Hardly the most optimal use of SRAMs
but it's good enough to get started.

Fixes the Echo R1 app build, which wasn't fitting in
AXI SRAM.

Change-Id: I4f7e5f618d27b553e5ff8dec1d5c4c61ac9d8eb0

authored by

Aidan MacDonald and committed by
Solomon Peachy
98990df0 174b33cc

+39 -64
+26 -52
firmware/target/arm/stm32/app.lds
··· 1 1 #include "cpu.h" 2 2 3 - /* 4 - * TODO: this is temporary and has not been tested 5 - */ 6 - 7 - ENTRY(main) 3 + ENTRY(crt0_start) 8 4 OUTPUT_FORMAT(elf32-littlearm) 9 5 OUTPUT_ARCH(arm) 10 6 STARTUP(target/arm/stm32/crt0-stm32h7.o) 11 7 12 8 MEMORY 13 9 { 14 - SRAM_AXI (rwx) : ORIGIN = STM32_SRAM_AXI_BASE, LENGTH = STM32_SRAM_AXI_SIZE 15 - DTCM (rwx) : ORIGIN = STM32_DTCM_BASE, LENGTH = STM32_DTCM_SIZE 16 - ITCM (rwx) : ORIGIN = STM32_ITCM_BASE, LENGTH = STM32_ITCM_SIZE 17 - SDRAM (rwx) : ORIGIN = STM32_SDRAM1_BASE, LENGTH = MEMORYSIZE * 1024 * 1024 18 - } 19 - 20 - /* 21 - * to control section alignment (only affects on-disk alignment): 22 - * -Wl,-z,max-page-size=0x1 23 - */ 24 - 25 - PHDRS 26 - { 27 - sram_rx PT_LOAD ; 28 - sram_ro PT_LOAD ; 29 - sram_rw PT_LOAD ; 30 - itcm PT_LOAD ; 31 - dtcm PT_LOAD ; 32 - sdram_rx PT_LOAD ; 33 - sdram_rw PT_LOAD ; 10 + DTCM (rw) : ORIGIN = STM32_DTCM_BASE, LENGTH = STM32_DTCM_SIZE 11 + ITCM (rx) : ORIGIN = STM32_ITCM_BASE, LENGTH = STM32_ITCM_SIZE 12 + SDRAM (rwx) : ORIGIN = STM32_SDRAM1_BASE, LENGTH = MEMORYSIZE * 1024 * 1024 34 13 } 35 14 36 15 SECTIONS 37 16 { 38 - .text : 39 - { 40 - loadaddress = .; /* only needed to keep ROLO happy */ 41 - 42 - *(.init*) 43 - *(.text*) 44 - } > SRAM_AXI :sram_rx 45 - 46 - .rodata : 47 - { 48 - *(.rodata*) 49 - } > SRAM_AXI :sram_ro 50 - 51 - .data : 52 - { 53 - _databegin = .; 54 - *(.data*) 55 - _dataend = .; 56 - } > SRAM_AXI :sram_rw 57 - _datacopy = LOADADDR(.data); 58 - 59 17 .itext : 60 18 { 61 - KEEP(*(.vectors.arm)) 62 - KEEP(*(.vectors.platform)) 19 + KEEP(*(.vectors.arm)); 20 + KEEP(*(.vectors.platform)); 63 21 *(.icode*); 64 - } > ITCM :itcm 22 + } > ITCM 65 23 66 24 .stack (NOLOAD) : 67 25 { ··· 72 30 stackbegin = .; 73 31 . += 0x2000; 74 32 stackend = .; 33 + } > DTCM 75 34 76 - *(.stack); 77 - } > DTCM :dtcm 35 + .text : 36 + { 37 + loadaddress = .; /* only needed to keep ROLO happy */ 38 + 39 + *(.init*); 40 + *(.text*); 41 + } > SDRAM 42 + 43 + .rodata : 44 + { 45 + *(.rodata*); 46 + } > SDRAM 47 + 48 + .data : 49 + { 50 + *(.data*); 51 + } > SDRAM 78 52 79 53 .bss (NOLOAD) : 80 54 { ··· 82 56 *(.bss*); 83 57 *(COMMON); 84 58 _bssend = .; 85 - } > SDRAM :sdram_rw 59 + } > SDRAM 86 60 87 61 audiobuffer = ALIGN(32); 88 62 audiobufend = ORIGIN(SDRAM) + LENGTH(SDRAM) - CODEC_SIZE - PLUGIN_BUFFER_SIZE;
+13 -12
firmware/target/arm/stm32/boot.lds
··· 7 7 8 8 MEMORY 9 9 { 10 - SRAM_AXI (rwx) : ORIGIN = STM32_SRAM_AXI_BASE, LENGTH = STM32_SRAM_AXI_SIZE 11 - DTCM (rwx) : ORIGIN = STM32_DTCM_BASE, LENGTH = STM32_DTCM_SIZE 12 - FLASH1 (rx) : ORIGIN = STM32_FLASH_BANK1_BASE, LENGTH = STM32_FLASH_BANK1_SIZE 10 + SRAM_AXI (rw) : ORIGIN = STM32_SRAM_AXI_BASE, LENGTH = STM32_SRAM_AXI_SIZE 11 + FLASH1 (rx) : ORIGIN = STM32_FLASH_BANK1_BASE, LENGTH = STM32_FLASH_BANK1_SIZE 13 12 } 14 13 15 14 SECTIONS 16 15 { 17 16 .text : 18 17 { 19 - KEEP(*(.vectors.arm)) 20 - KEEP(*(.vectors.platform)) 21 - *(.init*) 22 - *(.text*) 23 - *(.rodata*) 18 + KEEP(*(.vectors.arm)); 19 + KEEP(*(.vectors.platform)); 20 + *(.init*); 21 + *(.text*); 22 + } > FLASH1 23 + 24 + .rodata : 25 + { 26 + *(.rodata*); 24 27 } > FLASH1 25 28 26 29 .data : 27 30 { 28 31 _databegin = .; 29 - *(.data*) 32 + *(.data*); 30 33 _dataend = .; 31 34 } > SRAM_AXI AT> FLASH1 32 35 _datacopy = LOADADDR(.data); ··· 48 51 stackbegin = .; 49 52 . += 0x2000; 50 53 stackend = .; 51 - 52 - *(.stack); 53 - } > DTCM 54 + } > SRAM_AXI 54 55 } 55 56 56 57 EXTERN(__vectors_arm);