Flash vs RAM build configuration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Flash vs RAM build configuration

ソリューションへジャンプ
2,354件の閲覧回数
egoitztoledo
Contributor III

Hello everybody,

I just downloaded Codewarrior V11.0 and making some trial projects I’ve seen that there is the option to choose RAM or FLASH.

pastedImage_1.jpg

I’ve been looking information about this but I couldn’t find anything, so I wonder if someone could help me explaining what is this option for and what is the difference between choosing one or the other.

Thank you and regards.

タグ(1)
1 解決策
1,697件の閲覧回数
briceagbebe-cos
Contributor II

Hello Egoitz,

Normally, those options represent the target where your code will be loaded by a loader (either RAM or Flash).

RAM target is used in general for fast debugging and when you cannot write or you do not have a flash memory(ROM only). Once your code was loaded in RAM, you need to load the code each time when a reset occurrs (RAM loses its content being a volatile memory).

Flash target on the other side, is used to keep your code for a long time even after a reset will occur. 

As a summary, loading your code in RAM and executing it from there is faster than executing it from Flash.

You need to pay attention here, because your code must be linked as position independent or linked in RAM's address space.

For instance, if you wrote a scatter file or a loader file and linked some code to a fixed address, executing from RAM and referencing from Flash will crash. 

元の投稿で解決策を見る

2 返答(返信)
1,698件の閲覧回数
briceagbebe-cos
Contributor II

Hello Egoitz,

Normally, those options represent the target where your code will be loaded by a loader (either RAM or Flash).

RAM target is used in general for fast debugging and when you cannot write or you do not have a flash memory(ROM only). Once your code was loaded in RAM, you need to load the code each time when a reset occurrs (RAM loses its content being a volatile memory).

Flash target on the other side, is used to keep your code for a long time even after a reset will occur. 

As a summary, loading your code in RAM and executing it from there is faster than executing it from Flash.

You need to pay attention here, because your code must be linked as position independent or linked in RAM's address space.

For instance, if you wrote a scatter file or a loader file and linked some code to a fixed address, executing from RAM and referencing from Flash will crash. 

1,697件の閲覧回数
egoitztoledo
Contributor III

Hello Briceag Bebe-Cosmin,

Understood!!


Just for try out, I debugged a very simple blinking LED program with both configurations Flash and RAM and it occurred as you say when ressetting.


If I’m not wrong, the Flash memory has a limited amount of write cycles rather smaller than the RAM, so taking this into account, I think that debugging the programs in the RAM until having them finished (or almost) and make the last checks at the Flash would be a good practice that I’m going to adopt, mostly for complex projects where having no code errors from the beginning is not easy job.


It's been a very clarifying and useful answer!


Thank you and regards.