K65 SDRAM as Default RAM

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

K65 SDRAM as Default RAM

跳至解决方案
1,454 次查看
Mike_d
Contributor IV

Hello,

Can somebody show me the steps required to switch the TWR-K65F180 MQX 4.2 configuration to use the external SDRAM instead of internal SRAM?  I'm using the cw10gcc projects.

Thanks,

-Mike

0 项奖励
回复
1 解答
1,217 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Mike

MQX 4.2 BSP has SDRAM support for TWR-K65F180M.  You need to enable BSPCFG_ENABLE_SDRAMC in user_config.h file before building MQX libraries. You can refer to SDRAMC demo under the MQX installation folder.  C:\Freescale\Freescale_MQX_4_2\mqx\examples\sdramc

If you need to use SDRAM as the default RAM, I think you can try the function _mem_extend.

pastedImage_1.png

For example,

_mem_extend(BSP_SDRAM_BASE, BSP_SDRAM_SIZE).

After call _mem_extend, then system will allocate memory from SDRAM space.

I hope it helps.

Regards

Daniel

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,218 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Mike

MQX 4.2 BSP has SDRAM support for TWR-K65F180M.  You need to enable BSPCFG_ENABLE_SDRAMC in user_config.h file before building MQX libraries. You can refer to SDRAMC demo under the MQX installation folder.  C:\Freescale\Freescale_MQX_4_2\mqx\examples\sdramc

If you need to use SDRAM as the default RAM, I think you can try the function _mem_extend.

pastedImage_1.png

For example,

_mem_extend(BSP_SDRAM_BASE, BSP_SDRAM_SIZE).

After call _mem_extend, then system will allocate memory from SDRAM space.

I hope it helps.

Regards

Daniel

0 项奖励
回复
1,217 次查看
Mike_d
Contributor IV

Thanks Daniel, I will try it out.  Where do you recommend I call the _mem_extend function?  Before OS init or before App init?

0 项奖励
回复
1,217 次查看
danielchen
NXP TechSupport
NXP TechSupport

I would suggest you call _mem_extend from a task, then MQX kernel data will be in SRAM and memory pool for dynamic memeory allocation will be in SDRAM.


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复