Malloc failed in RT1060-EVK project CSI_RGB565
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We are evaluate RT1060 performance with RT1060 evk.
The first step we have to do now is to use the OV7725 and caputre the YUV422 data.Then extract the Y data to the buff. So will use malloc to apply for a buffer, and the buffer address should be in 0x8000xxxx。
There is no problem when using malloc(100), but malloc(480*272) will fail. With print, malloc(480*272) return 0, but malloc(100) will return 0x80000300. Our project base on the example CSI_RGB565 build with IAR ,and configuration is sdram_debug. Evk board have 256Mbit SDRAM, what cause this issuse happend?
Did I not open SDRAM in the code?
In fsl_commom.c, there is SDK_Malloc but the same result. Do I create memory management myself?
thanks !


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In case of the malloc function, it is usually not recommended in embedded systems, because it uses the default RAM memory, which is limited and may cause issues with the Heap/Stack.
In case of the i.MX RT, when creating MCUXpresso projects for EVKB-MIMXRT1050 board, it usually includes 4 RAM sections: SRAM_DTC (128KB), SRAM_ITC (128KB), SRAM_OC (256KB) and BOARD_SDRAM (32MB).
You could change which segment is the default one on the Project properties -> C/C++ Build -> MCU Settings.
You could also define variables inside specific memory segments. For this approach, you could refer to the following links:
Controlling data and function placement in memory
Defining Variables at Absolute Addresses with gcc | MCU on Eclipse
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Carlos.
I solved this problem by using simple heap management replace malloc.
Best regards!
