AnsweredAssumed Answered

MCUXpresso C++ Project and SDRAM problems (RT1020-EVK)

Question asked by rshipman on Feb 28, 2020
Latest reply on Mar 5, 2020 by Felipe García

Hi,

 

I'm experiencing a weird difference between an SDK demo project and a new C++ project.

 

First experiment:

 

I created an iled_blinky demo, and set the preprocessor symbols:

 

XIP_BOOT_HEADER_DCD_ENABLE=1

SKIP_SYSCLK_INIT

 

At the first breakpoint, i.e. at the start of main(), I used the MCUXpresso memory viewer to look at 0x80000000.

I can read and write at will.

 

I created a New C/C++ Project - the only setting I changed was to select C++ Project. All the other settings I left as default (i.e. semihost, baremetal etc).

 

When the project was created I set the preprocessor symbols:

 

XIP_BOOT_HEADER_DCD_ENABLE=1

SKIP_SYSCLK_INIT

 

At the first breakpoint, i.e. at the start of main(), I used the MCUXpresso memory viewer to look at 0x80000000.

It is all zero. When I write to it, the values are immediately reset back to zero.

 

 

Second experiment:

 

In both projects, I moved BOARD_SDRAM up to second place just below BOARD_FLASH (in MCU Settings), so that all the data would be in SDRAM, just the code in flash.

When I run the iled_blinky demo, it runs fine.

When I run the C++ project I get a hard fault in SystemInit (near call to SystemInitHook). See attached image.

 

So why do the iled_blinky demo and the C++ project behave differently?

 

Many thanks.

 

 

RT1020-EVK

MCUXpresso IDE v11.1.0 [Build 3209] [2019-12-12]

SDK version 2.7.0

Windows 10

Outcomes