about LDD_TError FLASH1_Erase(LDD_TDeviceData *DeviceDataPtr, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size)

cancel
Showing results for 
Search instead for 
Did you mean: 

about LDD_TError FLASH1_Erase(LDD_TDeviceData *DeviceDataPtr, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size)

Jump to solution
1,156 Views
jason_zhang
Contributor III

Hi

 

I used PE generated the LDD_TError FLASH1_Erase(LDD_TDeviceData *DeviceDataPtr, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size).

 

Could you kindly explain  the difference between the below two methods:

 

1.

(void)FLASH1_Init(NULL);

FLASH1_Erase(NULL,ERASE_START_ADD,ERASE_SIZE);

 

2.

void *pFlash_Device;

pFlash_Device = FLASH1_Init(NULL);

FLASH1_Erase(pFlash_Device,ERASE_START_ADD,ERASE_SIZE);

 

Thanks!

Jason

Labels (1)
0 Kudos
1 Solution
156 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jason,

For the 2 ,  in the function of FLASH1_Init(), first  initialize something of the data structure ,

then return it . And in the function of FLASH1_Erase(), we use this structure .

While for the 1, after initialize , in the FLASH1_Erase(), it does not use that result of initialize, only use one NULL structure.

And also in the note of the function  , it has tell us how to use parameter of the function FLASH1_Erase() :

pastedImage_0.png

So, please use the second method you mentioned. Also you can refer to the "Typical Usage" of "help on component "

pastedImage_1.png

pastedImage_2.png

Hope it helps


Have a great day,
Alice Yang

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

View solution in original post

0 Kudos
3 Replies
157 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jason,

For the 2 ,  in the function of FLASH1_Init(), first  initialize something of the data structure ,

then return it . And in the function of FLASH1_Erase(), we use this structure .

While for the 1, after initialize , in the FLASH1_Erase(), it does not use that result of initialize, only use one NULL structure.

And also in the note of the function  , it has tell us how to use parameter of the function FLASH1_Erase() :

pastedImage_0.png

So, please use the second method you mentioned. Also you can refer to the "Typical Usage" of "help on component "

pastedImage_1.png

pastedImage_2.png

Hope it helps


Have a great day,
Alice Yang

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

View solution in original post

0 Kudos
156 Views
jason_zhang
Contributor III

Hi Alice

Thank you for your reply.

I'll confirm the detail in  the "Typical Usage" of "help on component ".

By the way, dose the "method 1" works?

It seems works not correctly in my demo.

Jason

0 Kudos
156 Views
TICS_Fiona
NXP Employee
NXP Employee

Hello Jason

Method 1 is not the correct way.

The Device data structure is necessary when calling the flash operation functions in FLASH_LDD component, it saves the data for operation status and routine buffers. This structure is initialized in FLASH1_Init().

Best Regards

Fiona Kuang

Technical Information & Commercial Support

0 Kudos