K82: usage of internal flash memory

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

K82: usage of internal flash memory

1,447 次查看
EugeneHiihtaja
Senior Contributor I

Hello !

I would like to implement small nonvolatile storage what utilize 2 sectors ( 2*4KB) of internal flash memory.

I can see SDK example pflash can be used for start.

But what is not so clear if MCU can execute code from one sector, when I erase/write to other one.

Does MCU stall during write/erase operation to flash memory ?

Or may be even better to execute critical code from RAM while erase is ongoing.

Ow what is drawback when internal flash memory erase/write during operation of MCU in RUN mode ?

Regards,

Eugene

0 项奖励
回复
3 回复数

1,351 次查看
EugeneHiihtaja
Senior Contributor I

Hi Mark !

So K82 have one flash bank  256KB and erase/write of any sector ( 4KB ) cause freezing  of all execution from flash memory ?

Or each sector ( 4KB ) is fully independant and if I use empty sectors and track end of write/erase operations by interrupts, it can be completely invisible for MCU timing and etc.

Or what you means FlashBlock in case of K82 ?

Regards,

Eugene

0 项奖励
回复

1,351 次查看
mjbcswitzerland
Specialist V

Eugene

Your device has a single block (or bank, or plane) which means that you MUST run all flashing operation in RAM.

Sectors are the smallest chunks of Flash than can be deleted but each operation blocks the compete bank that it is in.

Regards

Mark

0 项奖励
回复

1,351 次查看
mjbcswitzerland
Specialist V

Hi Eugene

You need to disable interrupts and run Flash routines in SRAM since a complete Flash block will be inaccessible for executing code from whenever you program a word/phrase or erase a sector.

The Kinetis has no stall mechanism but you can run code in a different Flash block while writing/erasing in another one.


Regards

Mark

http://www.utasker.com/kinetis/FRDM-K82F.html
File system and fail safe parameter system that is compatible with all Kinetis Flash types: http://www.utasker.com/docs/uTasker/uTaskerFileSystem_3.PDF

0 项奖励
回复