Place main and tasks stacks in CCM

This commit is contained in:
Raphael Coeffic
2021-05-29 13:31:50 +02:00
committed by Raphael Coeffic
parent c1979338ab
commit 836733618c
4 changed files with 21 additions and 4 deletions
+6
View File
@@ -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")))
+2 -1
View File
@@ -296,7 +296,8 @@ template<int SIZE>
return (RTOS_GET_TIME() * RTOS_MS_PER_TICK);
}
#define RTOS_DEFINE_STACK(name, size) TaskStack<size> __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<size> __ALIGNED(8) name __CCMRAM
#define TASK_FUNCTION(task) void task(void * pdata)
#define TASK_RETURN() return
+2 -1
View File
@@ -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)
@@ -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