Dear colleagues!
I need to place the heap section to the BOARD_SDRAM. It is on the SRAM_OC currently. How I do?
Bellow is my actual memory use.
Thanks a lot!
Rubens Júnior.
Solved! Go to Solution.
HI Rubens-san
you can change the region of Heap in "Project Poperties->C/C++ Build->Settings->MCU Linker->Managed Linker Script".
Please set Region to "BOARD_SDRAM".
Best Regards,
T.Kashiwagi
HI Rubens-san
you can change the region of Heap in "Project Poperties->C/C++ Build->Settings->MCU Linker->Managed Linker Script".
Please set Region to "BOARD_SDRAM".
Best Regards,
T.Kashiwagi
Hi,
I created a simple project in MCUXpresso v11.1.0 [Build 3209] using the new project wizard with all default settings, and changed the heap to use SDRAM as shown above. However as soon as the heap allocation function is called, the program jumps to HardFault_Handler.
This is tested on the RT1050EVKB. And I have the script found in another in the debug config (see screenshot below).
Here is the main function. Please advice, thanks.
int main(void) {
/* Board pin init */
BOARD_InitPins();
BOARD_InitBootClocks();
/* Update the core clock */
SystemCoreClockUpdate();
float* data1 = (float*)malloc (256); // this will cause the jump to HardFault_Handler
free (data1);
}
Hi Lan-san.
In addition, In the case of the sample project, when HardFault is performed, HardFault_Handler of semihost_hardfault.c is executed.
With Hardfault_Handler, you can analyze the PC and SP for the instruction that caused the hard fault. Please check the values.
Best Regards,
T.Kashiwagi
Hi @takashi kashiwagi,
Thank you very much for your help. The result was positive.
Best Regards,
Rubens Júnior