saving data on KL43Z in ROM or FLASH during runtime

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

saving data on KL43Z in ROM or FLASH during runtime

跳至解决方案
1,740 次查看
thiagopalmieri
Contributor III

Hello,

I have a project that need to persist some data (1 or 2 bytes) during restarts/reboots/resets. It is a configuration information that can be changed during runtime by the user.

Is it possible to share the booitloader ROM space for that or use the flash?

If so, is there any application note or example code that I can look at?

Thanks

标签 (1)
0 项奖励
回复
1 解答
1,467 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Please download C90TFS_FLASH_DRIVER(TFS Flash Driver Software for Kinetis and ColdFire+ MicroControllers) from here, which includes the KL46 product Flash erase/program operation (customer could refer to storage some data to Flash memory).

Wish it helps.


Have a great day,
Ma Hui

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

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,468 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Please download C90TFS_FLASH_DRIVER(TFS Flash Driver Software for Kinetis and ColdFire+ MicroControllers) from here, which includes the KL46 product Flash erase/program operation (customer could refer to storage some data to Flash memory).

Wish it helps.


Have a great day,
Ma Hui

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

0 项奖励
回复
1,467 次查看
thiagopalmieri
Contributor III

Just one last question, how do I read back the data stored ??

Do I use FlashReadResource ??

0 项奖励
回复
1,467 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Read data from Flash memory just like read a data from a dedicated address, please refer below code as an example:

//from flash address 0x1000, read 16 bytes back

destination = 0x1000;  // flash address 0x1000

#define BUFFER_SIZE_BYTE          0x10

UINT32 programvalue[BUFFER_SIZE_BYTE];

                for (i = 0; i<BUFFER_SIZE_BYTE; i=i+4)

                {

                    programvalue[i] = *((UINT32 *)(destination+i)) ;

                    printf("\n programvalue[%d] = 0x%4x \n", i, programvalue[i]);

                }

Wish it helps.


Have a great day,
Ma Hui

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

0 项奖励
回复
1,467 次查看
thiagopalmieri
Contributor III

Hello Hui_Ma,

Thank you very much.... I have tried your driver and it works great !!

Regards,

Thiago

0 项奖励
回复
1,467 次查看
mjbcswitzerland
Specialist V

Hi

Any Flash sector can be used to save updateable parameters to (as long as the same sector is not used for code).

See http://www.utasker.com/docs/uTasker/uTaskerFileSystem_3.PDF

See also µTasker FRDM-KL43Z support - parameters can be modified and saved to Flash using the command line menu.In the "I/O menu" flash reads, writes and deletes can be experimented with.

Regards

Mark

Kinetis: µTasker Kinetis support

KL43: µTasker FRDM-KL43Z support  / µTasker TWR-KL43Z48M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 项奖励
回复