Heap usage memory RT1050 handling / External SDRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Heap usage memory RT1050 handling / External SDRAM

Jump to solution
2,402 Views
rubensjunior
Contributor IV

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.

pastedImage_1.png

Thanks a lot!

Rubens Júnior.

Labels (1)
1 Solution
2,159 Views
Takashi_Kashiwagi
Senior Contributor I

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".

pastedImage_3.png

Best Regards,

T.Kashiwagi

View solution in original post

4 Replies
2,160 Views
Takashi_Kashiwagi
Senior Contributor I

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".

pastedImage_3.png

Best Regards,

T.Kashiwagi

2,159 Views
ian_l
Contributor II

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);

}

pastedImage_1.png

2,159 Views
Takashi_Kashiwagi
Senior Contributor I

Hi Lan-san.

  • How many is the Heap Size? (The image I uploaded is 0 :smileycry:. Please set a valid value such as 0x1000)

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.

pastedImage_1.png

Best Regards,

T.Kashiwagi

0 Kudos
Reply
2,159 Views
rubensjunior
Contributor IV

Hi @takashi kashiwagi,

Thank you very much for your help. The result was positive.

Best Regards,

Rubens Júnior