Can one program "corrupt" the memory for another?

Please tell us which board you are using.
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
dlinsalata
 
Posts: 33
Joined: Sat Jul 22, 2017 5:55 pm

Can one program "corrupt" the memory for another?

Post by dlinsalata »

Hey all - Apologies for the likely misuse of the term "corrupt," but I can't think of a better word. I'm running into something funky with my nRF52840, and I'm trying to figure out how to debug.

I'm building a lamp that is a nightlight at night in one color, a wake-up light in the morning at a different color, and off during the day. I've run into a problem where my main file seems to brick the device - I can't even get to a debug println in setup - so I'm puzzling through that.

However, now that's causing weird behavior I can't understand: a separate file that I've used successfully for months to set the RTC suddenly doesn't work. Rather, I can upload it fine, and it seems to initialize fine (the time starts printing every second to serial monitor), but then it freezes when I try to input the new time via serial monitor.

As a newbie, I just assumed that uploading a new file erased everything in the Feather's memory. But now I'm wondering if it erases just as much as is needed, and therefore something I've broken in my old file could still be there causing problems. Is that a thing? If so, any tips on either how to fully erase the memory on an upload, or what I should be looking for in my broken file that could be causing this?

(I can upload the files if helpful - and goodness knows I'd love the help - but that's like 400 lines of code.)

Thank you!

User avatar
dlinsalata
 
Posts: 33
Joined: Sat Jul 22, 2017 5:55 pm

Re: Can one program "corrupt" the memory for another?

Post by dlinsalata »

Fun new change! For some reason (without changing any code), I was able to load the first file, set the time, and then load the second file successfully! ...of course, the program froze partway through, and resetting doesn't un-brick it.

This seems to further imply I'm doing something horribly wrong :)

User avatar
dlinsalata
 
Posts: 33
Joined: Sat Jul 22, 2017 5:55 pm

Re: Can one program "corrupt" the memory for another?

Post by dlinsalata »

(Sorry, I'd edit my reply, but I can't find the option right now)

Further update: I can upload the first file on to the Feather, but now that program freezes when I try to input a new time to set it (something that worked earlier, without any code changes)!

I feel like I'm taking crazy BANNED here.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Can one program "corrupt" the memory for another?

Post by adafruit_support_mike »

dlinsalata wrote: Wed Jan 18, 2023 1:52 pm As a newbie, I just assumed that uploading a new file erased everything in the Feather's memory.
You're right. It does.
dlinsalata wrote: Wed Jan 18, 2023 1:52 pm But now I'm wondering if it erases just as much as is needed, and therefore something I've broken in my old file could still be there causing problems. Is that a thing?
Nope. There's no good reason to leave partial code behind. On top of that, it would be harder.. erasing everything is easy and secure.

It's possible that your CircuitPython install has gotten corrupted though. That can happen as a result of hardware issue.. usually spikes in the supply power at just the wrong time.

Try installing a fresh version of the latest CircuitPython on the board and see if that helps:

https://learn.adafruit.com/welcome-to-c ... cuitpython

User avatar
dlinsalata
 
Posts: 33
Joined: Sat Jul 22, 2017 5:55 pm

Re: Can one program "corrupt" the memory for another?

Post by dlinsalata »

Thanks for the response! Good to confirm my thinking.

I loaded a new version of CircuitPython, but I'm using Arduino, so I don't think that would help, right? (I've now overwritten it again with Arduino.)

I suspect I've buggered this RTC (or potentially my feather - I hope not!), since I'm now getting to the point where the RTC setting file is crashing at different times each reset - e.g. after setting the minutes one reset, then after setting the seconds, then hour, then back to seconds, etc. I've checked all the solder points for continuity, and nothing is shorting across, and I've pulled up both the IPCs for the RTC, so I'm all out of ideas.

Thanks for the help, though!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Can one program "corrupt" the memory for another?

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

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

Return to “Feather - Adafruit's lightweight platform”