K65 SDRAM as Default RAM

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

K65 SDRAM as Default RAM

Jump to solution
703 Views
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 Kudos
Reply
1 Solution
466 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
467 Views
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 Kudos
Reply
466 Views
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 Kudos
Reply
466 Views
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 Kudos
Reply