Hi,
I am saving data in flash memory but when I read after restarting the device it shows FF.
How can I read from flash after restarting the device? and how can I check that there is already data?
Thanks
Hi,
I am saving data in flash memory but when I read after restarting the device it shows FF.
How can I read from flash after restarting the device? and how can I check that there is already data?
Thanks
My initial guess is that you are not waiting for the read finished callback before you print what you have read. Can you share some code showing how you read the data? What are you using to read? Fstorage? FDS? I suggest you check out the examples flash_fstorage or flash_fds, depending on which one you use.
Best regards,
Edvin
Is it from an interrupt? If so, try to set some flag in the interrupt that you use to call this function from your main() loop to move it out of the interrupt.
Can you please tell me how can I check is there any interrupt running?
If you are in a function called directly from your main() function, then you are not in an interrupt. But if you are in some sort of event handler, you are in an interrupt. You can also check this using
uint8_t current_priority = current_int_priority_get();
If the current_priority that is returned is 15, then you are in the main context. If the number is smaller than 15, you are in an interrupt.
If you are in a function called directly from your main() function, then you are not in an interrupt. But if you are in some sort of event handler, you are in an interrupt. You can also check this using
uint8_t current_priority = current_int_priority_get();
If the current_priority that is returned is 15, then you are in the main context. If the number is smaller than 15, you are in an interrupt.