Hello.
MIMXRT1064-EVK
Please tell me how to assign the array to BOARD_SDRAM?
My own code doesn't seem to work, it's still on SRAM_DTC, please advise! Thank you!
#define SDRAM_BASE_ADDRESS (0x80000000)
uint8_t mySdramBuffer[1000] __attribute__((at(SDRAM_BASE_ADDRESS)));
Hi @haitao178.
Thank you for your interest in the NXP RT product line and we are pleased to be of service to you.
If you are using SDRAM, you need to be careful to enable the DCD enable setting.
If you are using MCUXPresso IDE, please add macro definition to enable DCD (XIP_BOOT_HEADER_DCD_ENABLE=1)
I hope the above helps you
Best Regards
MayLiu
Hi MayLiu.
Thank you for your support.
Already added macro definitions in DCD but still BOARD_SRAM is not allocated after compilation, please help to see the reason for this, the code is as below:
Hi @haitao178.
I have tested and verified that it is possible to correctly define arrays on BOARD_SDRAM, and I suggest you to follow the steps below to test and verify:
HW: MIMXRT1170-EVKB
IDE: MCUXPresso IDE
1: Add macro definition XIP_BOOT_HEADER_DCD_ENABLE=1
2: Add code, please refer to the project screenshot below. I am using RT1170 development board, your development board can still be referenced.
Best Regards
MayLiu
You're welcome, and if you have any questions in the future, feel free to ask them in the NXP community.
Sorry, failed to paste the picture.
The code is as follows:
code:
#define SDRAM_BASE_ADDRESS (0x80000000)
uint8_t mySdramBuffer[4096] __attribute__((at(SDRAM_BASE_ADDRESS)));
int main(void)
{
FRESULT error;
DIR directory; /* Directory object */
FILINFO fileInformation;
UINT bytesWritten;
UINT bytesRead;
const TCHAR driverNumberBuffer[3U] = {SDDISK + '0', ':', '/'};
volatile bool failedFlag = false;
char ch = '0';
BYTE work[FF_MAX_SS];
mySdramBuffer[4000] = 0x99;
......
log:
Memory region Used Size Region Size %age Used
PROGRAM_FLASH: 80224 B 4 MB 1.91 %
SRAM_DTC: 16192 B 128 KB 12.35 %
BOARD_SDRAM: 0 B 30 MB 0.00 %
SRAM_ITC: 0 B 128 KB 0.00 %
SRAM_OC: 0 B 768 KB 0.00 %
NCACHE_REGION: 0 B 2 MB 0.00 %
Finished building target: KL_Osram_Demo.axf
Thanks to MayLiu!