diff --git a/radio/src/definitions.h b/radio/src/definitions.h index 52b4e2096..32e447a18 100644 --- a/radio/src/definitions.h +++ b/radio/src/definitions.h @@ -61,6 +61,12 @@ #define __DMA __ALIGNED(4) #endif +#if defined(CCMRAM) && !defined(SIMU) + #define __CCMRAM __attribute__((section(".ccm"), aligned(4))) +#else + #define __CCMRAM +#endif + #if defined(SDRAM) && !defined(SIMU) #define __SDRAM __attribute__((section(".sdram"), aligned(4))) #define __NOINIT __attribute__((section(".noinit"))) diff --git a/radio/src/rtos.h b/radio/src/rtos.h index e4bd1aae7..d21094eef 100644 --- a/radio/src/rtos.h +++ b/radio/src/rtos.h @@ -296,7 +296,8 @@ template return (RTOS_GET_TIME() * RTOS_MS_PER_TICK); } - #define RTOS_DEFINE_STACK(name, size) TaskStack __ALIGNED(8) name // stack must be aligned to 8 bytes otherwise printf for %f does not work! + // stack must be aligned to 8 bytes otherwise printf for %f does not work! + #define RTOS_DEFINE_STACK(name, size) TaskStack __ALIGNED(8) name __CCMRAM #define TASK_FUNCTION(task) void task(void * pdata) #define TASK_RETURN() return diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index c8f09b868..0d5379256 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -155,11 +155,12 @@ set(RADIO_DEPENDENCIES set(FIRMWARE_DEPENDENCIES datacopy) -add_definitions(-DPCBHORUS -DSTM32F429_439xx -DSDRAM -DCOLORLCD -DHARDWARE_KEYS) +add_definitions(-DPCBHORUS -DSTM32F429_439xx -DSDRAM -DCCMRAM -DCOLORLCD -DHARDWARE_KEYS) add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK) add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE}) add_definitions(-DPWR_BUTTON_${PWR_BUTTON}) add_definitions(-DHARDWARE_TRAINER_JACK) + set(SDRAM ON) if(DEFAULT_THEME) diff --git a/radio/src/targets/horus/stm32f4_flash_bootloader.ld b/radio/src/targets/horus/stm32f4_flash_bootloader.ld index afe81d1e0..d8f55855a 100644 --- a/radio/src/targets/horus/stm32f4_flash_bootloader.ld +++ b/radio/src/targets/horus/stm32f4_flash_bootloader.ld @@ -105,6 +105,16 @@ SECTIONS PROVIDE_HIDDEN (__fini_array_end = .); } >FLASH + .ccm_ram (NOLOAD) : + { + . = ALIGN(4); + _sccm_ram = .; + *(.ccm) + . = ALIGN(4); + . = . + _Main_Stack_Size; + _eccm_ram = .; + } >CCM + /* used by the startup to initialize data */ _sidata = .; @@ -140,7 +150,7 @@ SECTIONS *(.noinit) } >RAM - /* collect all uninitialized .ccm sections */ + /* collect all uninitialized .ram sections */ .ram (NOLOAD) : { . = ALIGN(4); @@ -153,7 +163,6 @@ SECTIONS { . = ALIGN(4); . = . + _Min_Heap_Size; - . = . + _Main_Stack_Size; . = ALIGN(4); } >RAM