wipe the non-Volatile memory on the nrf52840 chip

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
willwade
 
Posts: 50
Joined: Sat Dec 01, 2018 3:04 pm

wipe the non-Volatile memory on the nrf52840 chip

Post by willwade »

Ive managed to write some data to the nrf52840 no-volatile memory - which is great. The only thing is I was wondering about a nifty trick of deleting this. Any suggestions? (Im on a feather express by the way)

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by mikeysklar »

Are you coding in Arduino or CircuitPython? Can you post an example of the NVRAM code you are using?

User avatar
willwade
 
Posts: 50
Joined: Sat Dec 01, 2018 3:04 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by willwade »


User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by mikeysklar »

There is a public method called "remove" to takeout the file.

https://github.com/adafruit/Adafruit_nR ... leFS.h#L58

User avatar
willwade
 
Posts: 50
Joined: Sat Dec 01, 2018 3:04 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by willwade »

OK. Im really stupid so apologies..

If I add a function say this..

Code: Select all

void delete_devList(void)
{
  Serial.println("at+deletedevlist");
  file.delete(FILENAME);
  Serial.println("SUCCESS. Now turn on and off. ");
}
I get a

Code: Select all

expected unqualified-id before 'delete'
Am I calling that function you note correctly??

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by mikeysklar »

Wouldn't it be remove as opposed to what you tried which was delete?

Code: Select all

    // Delete the file.
    bool remove (char const *filepath);

User avatar
willwade
 
Posts: 50
Joined: Sat Dec 01, 2018 3:04 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by willwade »

:facepalm: You know when you look at something like 30 times.. and then again just before posting...

And I couldn't see that for the life of me. I really am stupid..

Thanks :embarrassed:

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: wipe the non-Volatile memory on the nrf52840 chip

Post by mikeysklar »

@willwade,

It find it hard to keep the terminology straight as well. There are many implementations of littlefs and they each seem to use their own erase, delete or remove solutions.

Were you able to get working code? If so feel free to share it here.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”