FLASH_LDD Erase Documentation Clarification

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

FLASH_LDD Erase Documentation Clarification

跳至解决方案
955 次查看
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.

标记 (3)
1 解答
632 次查看
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

在原帖中查看解决方案

4 回复数
632 次查看
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 项奖励
632 次查看
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 项奖励
633 次查看
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

632 次查看
overdamped
Contributor II

Thank you !

0 项奖励