MCUXPresso, K66F

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

MCUXPresso, K66F

Jump to solution
1,878 Views
a8Chcx
Contributor V

Hi,

I am using MK66FN2M0VLQ18 MCU and MCUXpresso IDE v11.5.0 [Build 7232] [2022-01-11] for my testing. My board are designed with 32M SDRAM(ADDR=0x70000000) and 32M FLASH(ADDR=0x60000000). I want to use SDRAM as HEAP, and some application and use FLASH as program.

Can anyone tell me how configure SDARM and FLASH by using MCUXpresso IDE?

Thanks,

Christie

 

0 Kudos
Reply
1 Solution
1,726 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

You can try by modifying the Reset_ISR function and running your SDRAM initialization code from here.

You can find the Reset_ISR function in the file located in the startup folder of your project.

Can you please try this on your code?

Just be careful when modifying these parts of code because any strange change may cause problems in the MCU.

Regards, Daniel.

View solution in original post

0 Kudos
Reply
7 Replies
1,836 Views
a8Chcx
Contributor V

Hi,

I tried to use the following definition to set variables in specified SDRAM section:

#include <cr_section_macros.h>
__DATA(RAM4) char data_buffer[1024]; // in SDRAM section

It is all right after I compiled and checking the map file.

But, when I start running, I got hard-fault. 

When I use SDRAM as heap stack, it works fine...

I think it may be related to SDRAM initialization because SDARM initialization is done later(after startup)?

Can anyone tell me how to fix this issue, initialize SDRAM earlier, or initialize variables later?

Thanks,

Christie

 

0 Kudos
Reply
1,805 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

Could you please verify that you have the SDRAM Controller enabled?

You can take a look on chapter 35 of the reference manual for more information about the Synchronous DRAM Controller Module.

Here are some links that might help you:

https://www.nxp.com/docs/en/application-note/AN5095.pdf

https://community.nxp.com/t5/Kinetis-Microcontrollers/MK66-SDRAM-databus-lost/td-p/619453

https://community.nxp.com/t5/Kinetis-Microcontrollers/K66F-16-bit-SDRAM/td-p/616441

Best regards, Daniel.

0 Kudos
Reply
1,792 Views
a8Chcx
Contributor V

Hi Daniel,

if I use __NOINIT(RAM4) instead of __BSS(RAM4), it works fine because SDRAM is not initialized in start_up routine.

I did SDRAM initialization after start_up routine, then I can initialize variables in SDRAM.

How can do SDRAM initialization before start-up routine, then all variables in BSS can be initialized in start-up routine?

Thanks,

Christie

 

0 Kudos
Reply
1,727 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

You can try by modifying the Reset_ISR function and running your SDRAM initialization code from here.

You can find the Reset_ISR function in the file located in the startup folder of your project.

Can you please try this on your code?

Just be careful when modifying these parts of code because any strange change may cause problems in the MCU.

Regards, Daniel.

0 Kudos
Reply
1,858 Views
jay_heng
NXP Employee
NXP Employee

You can refer to my two blogs (it is in Chinese) on MCUX linker file topic

https://www.cnblogs.com/henjay724/p/15244983.html

https://www.cnblogs.com/henjay724/p/15254174.html

0 Kudos
Reply
1,849 Views
a8Chcx
Contributor V

Hi Jay,

Thank you. Looks work  for me...

Have you to test the speed difference between SRAM and static SRAM?

Thank,

Christie

 

0 Kudos
Reply
1,844 Views
a8Chcx
Contributor V

Hi Jay,

Can you tell me how to configure the application(variables) to use the specified RAM, like SDRAM, instead of default RAM?

Thanks,

Christie

Tags (1)
0 Kudos
Reply