Place code in internal flash and SPI flash

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

Place code in internal flash and SPI flash

1,127 次查看
leocheng
Contributor II

Our project is based on the old using MCF52258, 512KB flash, 64 K sram + 128K external SDRAM. Now the code is increasing, I am considering that place partial code in SPI flash, then load and run in SDRAM. Here is what I am thinking,

 

file1.c

function1() { }  function2() { }

 

file2.c

function3() { }  function4() { }

 

Objective: placing file1.c in to internal flash, file2.c in to spi flash, when calling function3 and function4, read the code from SPI flash to external ram, then run in ram

 

Is this feasible? How to?

Does Anyone have any advice?

external ram

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

918 次查看
miduo
NXP Employee
NXP Employee

Hi,

Unfortunately, due to the CORE architecture the processor cannot fetch instructions from the SPI bus. So an external spi flash cannot be used same as an internal flash.

0 项奖励
回复

918 次查看
TomE
Specialist II

> the processor cannot fetch instructions from the SPI bus.


That is NOT what the OP asked. He asked how to copy the code from external SPI Flash to RAM and then execute it from there.

That has nothing to do with this CPU. It is a general question that applies equally to all types of CPU.

If the OP is using CodeWarrior, then the question is "how do I configure CodeWarrior so it will generate code I can then copy to RAM"? This question should be moved to the CodeWarrior forum. The question might/should be answered in the Codewarrior documentation. There should be examples on how to do this. Has the OP looked there?

If using a different toolchain, then it should be in the documentation for that.

Tom

0 项奖励
回复