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
Solved! Go to Solution.
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() :
So, please use the second method you mentioned. Also you can refer to the "Typical Usage" of "help on component "
Hope it helps
Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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() :
So, please use the second method you mentioned. Also you can refer to the "Typical Usage" of "help on component "
Hope it helps
Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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
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