Cube 32 MX IDE leaves out FreeRTOS options, and kills code in files to fix the problem.
I'm putting the FreeRTOS heap in extended memory in an F469I-Disco board.
Got the memory working properly (needs to be there for the LTDC display to work).
FreeRTOS needs the configAPPLICATION_ALLOCATED_HEAP option to be set to 1. CubeMXIDE setup options (in version 1.8.0) do not give that option anywhere and default to a 0 for this parameter.
Setting the variable in FreeRTOS.h works, but lasts until a change is made and code regenerated from the IOC file.
In addition, the heap4c file needs to be modified to allow FreeRTOS (@line 58) to search a named block of extended memory.
This gets wiped out when regenerating code as well.
An easy fix would be to have the last section (static heap) be conditional only on the variable == 0.
Then the user could add their own code in a user section with a preprocessor directive.
An alternative to that would be to add a user code section with the existing structure when user heap is needed.
Code needed to be added (apologies for lack of formatting, not available when asking a question) is:
#if( configAPPLICATION_ALLOCATED_HEAP == 1 )
/* The application writer has already defined the array used for the RTOS
heap - probably so it can be placed in a special segment or address. */
// extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] __attribute__ ((section (".freertos_data")));
#else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
So two fixes needed, one in the IDE code options for user heap, the second for changes to heap4c (likely needed for other implementations).
No, hadn't considered using heap 5C because I don't want the heap split, just gracefully relocated.
