Read/Write flash in FRDM KW41Z

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

Read/Write flash in FRDM KW41Z

ソリューションへジャンプ
1,543件の閲覧回数
kunalkotecha1
Senior Contributor II

Hi All,

I am using BLE + thread hybrid application for FRDM KW41Z board. I want to store some details into permanent storage and read them on every reboot. I explored into the SDK but I didn't find any example code demonstrating some read/write operations in permanent storage.

Can anyone help me on how to read and write data in flash? Also, Are there any filesystem API available like fopen, fwrite, etc. ?

FRDM version:

a) BLE HOST v1.2.6
b) IEEE 802.15.4 MAC v5.3.6
c) NXP Thread v1.1.1.20
d) CONNECTIVITY FRAMEWORK v5.3.6

e) Thread SDK: SDK_2.2.0_FRDM-KW41Z_LINUX

Regards,

Kunal

ラベル(3)
0 件の賞賛
返信
1 解決策
1,248件の閲覧回数
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

P-Flash is program flash, which is where you store program code.

D-Flash is data flash, where you store non-volatile data.

I was able to run the example correctly from my side, you might want to check the App_NvmWrite function and to understand more about this topic, please check the BLE Application Developer's Guide putting special attention to the chapter 2.3 Non-Volatile Memory (NVM) access, I believe that might work for your purposes especially as there are already APIs and usage in the connectivity framework. 

Regards, 

Estephania 

元の投稿で解決策を見る

4 返答(返信)
1,248件の閲覧回数
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

By any chance, have you checked the pflash example in the SDK ? Wasn't it helpful for you? If that was not what you were looking for, just let me know. 

Regards, 
Estephania 

0 件の賞賛
返信
1,248件の閲覧回数
kunalkotecha1
Senior Contributor II

Hi estephania_martinez ,

I flashed the default "pflash" example but its not even able to boot. I read the "MCUXpresso SDK API Reference Manual_MKW41Z4.pdf" which says flash driver api's are meant for C90TFS. I added the below lines from pdf.

"The flash provides the C90TFS Flash driver of MCUXpresso SDK devices with the C90TFS Flash module inside. The flash driver provides general APIs to handle specific operations on C90TFS/FTFx Flash
module."

Can you please help me with storing some data in flash and reading them back?Also, What is pflash, dflash and are there are documents explaining them? At what address should I store the data?

Below are the flash properties read from my hybrid application.

kFLASH_PropertyPflashSectorSize: 0x800
kFLASH_PropertyPflashTotalSize: 0x80000
kFLASH_PropertyPflashBlockSize: 0x40000
kFLASH_PropertyPflashBlockCount: 0x2
kFLASH_PropertyPflashBlockBaseAddr: 0x0
kFLASH_PropertyPflashFacSupport: 0x1
kFLASH_PropertyPflashAccessSegmentSize: 0x2000
kFLASH_PropertyPflashAccessSegmentCount: 0x40
kFLASH_PropertyFlexRamBlockBaseAddr: 0x0
kFLASH_PropertyFlexRamTotalSize: 0x0
kFLASH_PropertyDflashSectorSize: 0x0
kFLASH_PropertyDflashTotalSize: 0x0
kFLASH_PropertyDflashBlockSize: 0x0
kFLASH_PropertyDflashBlockCount: 0x0
kFLASH_PropertyDflashBlockBaseAddr: 0x0
kFLASH_PropertyEepromTotalSize: 0x0
kFLASH_PropertyFlashMemoryIndex: 0x0
kFLASH_PropertyFlashCacheControllerIndex: 0x0

Regards,

Kunal

0 件の賞賛
返信
1,249件の閲覧回数
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

P-Flash is program flash, which is where you store program code.

D-Flash is data flash, where you store non-volatile data.

I was able to run the example correctly from my side, you might want to check the App_NvmWrite function and to understand more about this topic, please check the BLE Application Developer's Guide putting special attention to the chapter 2.3 Non-Volatile Memory (NVM) access, I believe that might work for your purposes especially as there are already APIs and usage in the connectivity framework. 

Regards, 

Estephania 

1,250件の閲覧回数
kunalkotecha1
Senior Contributor II

Hello,

Thank you for your suggestions. I have tried with NVM API and able to do read/write operations.

Thanks,

Kunal

0 件の賞賛
返信