MCUXPresso, K66F

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,466件の閲覧回数
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,314件の閲覧回数
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,424件の閲覧回数
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,393件の閲覧回数
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,380件の閲覧回数
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,315件の閲覧回数
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,446件の閲覧回数
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,437件の閲覧回数
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,432件の閲覧回数
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 件の賞賛