2327649_en-US

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

2327649_en-US

2327649_en-US

How to define the array on BOARD_SDRAM?

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


Re: 如何定义数组在BOARD_SDRAM上?

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)

Snipaste_2026-03-06_19-28-10.png

 

I hope the above helps you

Best Regards

MayLiu

回复: 如何定义数组在BOARD_SDRAM上?

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:

 

回复: 如何定义数组在BOARD_SDRAM上?

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.

Snipaste_2026-03-09_11-03-56.png

Snipaste_2026-03-09_11-04-28.png


Best Regards

MayLiu

回复: 如何定义数组在BOARD_SDRAM上?

You're welcome, and if you have any questions in the future, feel free to ask them in the NXP community.

回复: 如何定义数组在BOARD_SDRAM上?

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

回复: 如何定义数组在BOARD_SDRAM上?

Thanks to MayLiu!

Tags (1)
No ratings
Version history
Last update:
‎03-10-2026 04:34 AM
Updated by: