Hi All,
The chip I use is JN5189, the SDK version I use is SDK2.6.2_JN5189DK6, and the routines I use are zigbee_ed_rx_on and zigbee_coordinator.
Now I need to write the user data into Flash. My save/read method is to refer to the flash_demo routines provided in the SDK. For example, use FLASH_Init(), FLASH_ErasePages(),FLASH_Program() and nv_safereadfromFlash () to read and write to Flash.
After testing, call FLASH_ErasePages() to erase flash and then read flash, read out all the values are 0.Call FLASH_Program() to write data to flash and then read flash, and the value that is read is the same as the value that was written.It is worth mentioning that pu32Start has a value of 0x10000 (the same as in flash_demo).
Now I have the following questions:
1. Why do I call FLASH_ErasePages() to erase the flash and then read the corresponding flash, but read out the value of 0 instead of 1?
2. As the protocol stack itself has related operations with Flash, such as using PPDM_eSaveRecordData() to save data, using PDM_eReadDataFromRecord()to read data.But I don't know which page of Flash PDM_eSaveRecordData() operates on, so will I accidentally tamper with the data saved with PDM_eSaveRecordData() when I use FLASH_Program() to write data to the starting address of 0x10000?
3. Is it recommended to use the flash API in flash_demo to read and write the flash in the protocol stack?If not, what is the recommended way?
BR,
Viki