Rak5010 Flash Memory and Storage

Issue:

Setup:

Details: I just had a question regarding the storage in the flash memory. I wanted to know how can I access, read and write from the flash memory after wake up from sleep. I also wanted to how how this read and writing mapping mechanism works in the flash memory.

Hi,

In rui.h, you can find these two API. It allows to write and read 128 bytes in flash. Use RUI_FLASH_USER mode.
/***************************************************************************************

  • @brief This API is flash write and read.
  • @return RUI_RETURN_STATUS
  • @param uint8_t *str
    uint8_t len: should less than 128 byte
    RUI_FLASH_MODE mode: user data or origin data
    ***************************************************************************************/
    RUI_RETURN_STATUS rui_flash_write(RUI_FLASH_MODE mode, uint8_t *str, uint8_t len);

/***************************************************************************************

  • @brief This API is auto send data timeout callback by lora.
  • @return RUI_RETURN_STATUS
  • @param uint8_t *str
    uint8_t len: should less than 128 byte
    RUI_FLASH_MODE mode: user data or origin data
    ***************************************************************************************/
    RUI_RETURN_STATUS rui_flash_read(RUI_FLASH_MODE mode,uint8_t *str, uint8_t len);

Hey @nero going more on that. Lets say I have a send_data variable whose value I first save/write in the flash memory, sleep, wakeup and then read the value of the send_data from the flash memory again; then how do I that exactly go about doing that and also is there a specific keyword that I need to write next to it that marks it as a flash variable or something.

Hi,
The buffer of user data is completely for user. So You can decide the format of your data. The only thing to worry about is the size of the buffer.

Thank you so much. I really appreciate your help.