How to read flash memory?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read flash memory?

Jump to solution
7,783 Views
pengliang
Contributor III

Hi everyone,

I write data to flash memory(eeprom emulation) using FRDM-KL25Z. however, I want to check what data I wrote(since I dont have LCD). Is there a way to check the data that I wrote using codewarrior IDE?

Thanks in advance

Labels (1)
0 Kudos
1 Solution
2,425 Views
pengliang
Contributor III
0 Kudos
6 Replies
2,425 Views
亚男张
Contributor I

I'm still confused about writing into the flash, the FLASH1Pointer should be what ?  and in the  Erasing Flash sectors in KL25 on the Freedom Board. the user memories area setting is grey, and in cw10.5 the flash_ldd component doesn't have a FLASH1_GetOperationStatus function?

0 Kudos
2,425 Views
kendang
Contributor I

I try the same thing on FRDM-KL25Z board. I use processor expert bin FLASH to create basic read and write function.

Only one thing I still confuse is absolute flash address to write to. Processor expert set in FLASH property address 0 that does make sense?? any idea? How did you set address to write in Flash of KL25Z ?

I can try and give you my result.

Thanks for any share information?

0 Kudos
2,426 Views
pengliang
Contributor III
0 Kudos
2,425 Views
vfilip
NXP Employee
NXP Employee

Hello,

regarding PEx, this link could help:

EEPROM use with processor expert and K20

best regards

Vojtech Filip

Processor Expert Support Team


0 Kudos
2,425 Views
kendang
Contributor I

Thanks for information. I believe I am not alone try to implement EEprom emulation on Kinetis.

With K20 that has Flex memory it seems not to difficult to do it. How about KL ?

We accepted to use KL15 with 128K to use in current product. The only one thing holding me is implementing EEprom on the new chip.

Is there anybody ever did it on KL ?

I appreciate any your help

Ken dang

Escort Manufacturing Corporation

0 Kudos
2,425 Views
LuisCasado
NXP Employee
NXP Employee

Hi.

You can use Processor Expert to read and write the flash:

Read:

 

FLASH1_Read(FLASH1Pointer,0x1F000, &savedData, sizeof(savedData));

do {

FLASH1_Main(FLASH1Pointer);

OpStatus = FLASH1_GetOperationStatus(FLASH1Pointer);

} while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));

 

Erase:

void EraseFlash() {

FLASH1_Erase(FLASH1Pointer, 0x1F000, 1024);

do {

FLASH1_Main(FLASH1Pointer);

OpStatus = FLASH1_GetOperationStatus(FLASH1Pointer);

} while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));

return;

}

 

Write:

void WriteToFlash(LDD_TData *FromPtr, LDD_FLASH_TDataSize Size) {

FLASH1_Write(FLASH1Pointer, FromPtr, 0x1F000, Size);

do {

FLASH1_Main(FLASH1Pointer);

OpStatus = FLASH1_GetOperationStatus(FLASH1Pointer);

} while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));

return;

}

Best Regards,

0 Kudos