MCUXPresso, K66F

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MCUXPresso, K66F

跳至解决方案
1,907 次查看
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 项奖励
回复
1 解答
1,755 次查看
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 项奖励
回复
7 回复数
1,865 次查看
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 项奖励
回复
1,834 次查看
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 项奖励
回复
1,821 次查看
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 项奖励
回复
1,756 次查看
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 项奖励
回复
1,887 次查看
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 项奖励
回复
1,878 次查看
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 项奖励
回复
1,873 次查看
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

标记 (1)
0 项奖励
回复