FLASH_LDD Erase Documentation Clarification

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

FLASH_LDD Erase Documentation Clarification

Jump to solution
940 Views
overdamped
Contributor II

I'm currently working on storing some data into flash on the K60D without FlexNVM, and I was hoping to get a clarification of the documentation for the FLASH1_Erase parameter. The documentation in Processor Expert 10.4 states:

  • Size:LDD_FLASH_TDataSize - Size of the flash memory area (in bytes) to be erased. The flash memory is erased by the erase sectors. The first erased sector is a sector the address specified by the input parameter Address belongs to. The last erased sector is a sector the address calculated like an addition of the address specified by the input parameter Address and the size specified by the input parameter Size belongs to.

Breaking down into code, I notice that it will attempt to re-issue a sector erase if the size is greater than 4. In otherwords, If I made the following call:

FLASH1_Erase(FLASH1_DeviceDriver, SOME_ADDRESS, BLOCK1_ERASABLE_UNIT_SIZE);


On my setup, I then get a read collision error/read while write error (RWW) which confuses me as the code calling the erase is definitely safe and called with interrupts disabled. Any help would be greatly appreciated.

Tags (3)
1 Solution
617 Views
DavidS
NXP Employee
NXP Employee

Hi overdamped,

The LDD_DLASH_TDataSize has units of sectors.  You figure out how many sectors you need to erase and enter that number of sectors in bytes.  I tested this on a TWR-K70F120M using MQX4.1.1 and the PE FLASH_LDD Component.

When I wanted to erase 2 sectors I enter in a size of 2*0x1000 since a sector is 0x1000 in size.

Regards,

David

View solution in original post

4 Replies
617 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

Thank you for reporting of this issue. We would like to analyze the problem but we need to know what Processor Expert product are you using and we need you project (project settings, memory map setting and the source code).

I suppose that you are using the Processor Expert Driver Suite 10.4. Could you provide us you application for the issue analysis, please?

Best Regards,

Marek Neuzil

0 Kudos
617 Views
overdamped
Contributor II

I fixed the problem. Erase was trying to erase the same block that some interrupt code was executing in. I guess my remaining question is what does size in the Flash1_Erase mean? Is it sector size? Byte size?

0 Kudos
618 Views
DavidS
NXP Employee
NXP Employee

Hi overdamped,

The LDD_DLASH_TDataSize has units of sectors.  You figure out how many sectors you need to erase and enter that number of sectors in bytes.  I tested this on a TWR-K70F120M using MQX4.1.1 and the PE FLASH_LDD Component.

When I wanted to erase 2 sectors I enter in a size of 2*0x1000 since a sector is 0x1000 in size.

Regards,

David

617 Views
overdamped
Contributor II

Thank you !

0 Kudos