A very short story

ARGH typed my password when the moochine wasn't asking for it and it took me waaay too long to find that I had typed it into my code.

a7

3 Likes

What's the longest you ever debugged a file before you realized that you just forgot to save it before you compiled?

Or better yet, what's the longest you ever spent debugging a new function you just wrote when the problem was that you forgot to call it. I do that one a LOT.

Be glad you did not post it for help:-)

2 Likes

I suppose you could, as a poka-yoke, try writing the call for the function first, and then writing the function itself. This way, if you forget to write the function, the compiler will complain.

1 Like

I did not follow any reasonable A, B, C steps along the path of the most likely causes.

If I had just calmly read through the compiler output, and stayed calm when I thought I knew what it was telling me, I would have found the problem in short order.

It pains me to say that this was a large-ish project from many years ago, for which I had to do indescribable work to locate the sketch folder.

The closest code I found would not compile, never mind what a simple matter that turned out to be.

So day one left me very happy to have located, verified, uploaded and tested a version that seemed to have exactly the functions and limitations and defects as the original.

Oh, BTW, the device was fine, and the task was to finally fix the defects and possibly not be able to resist adding a feature or two. So the first thing that happened was displacing the working long ago uploaded code.

I might have spent a moment thinking that might happen, and figuring out how to grab a copy so in the not unlikely event that I get into trouble, I could also recover somewhat.

But I haven't ever done, and I shouldn't need to do anyway, so it didn't occur to me.

A mere 24 hours later, the located code - now exalted, zipped and carefully marked and placed on multiple devices - fails to compile…

I feel like I should fire myself. :expressionless:

Passwords on my desktop machines have always caused me more problems then the ones they just are needed to solve.

a7

Once working in assembly language and feeling very tired I spent ages trying to find the 'bug' that was causing the code right after a call to execute when the called code returned.

I was recently getting back into z80 assembler and after a frustrating session I figured I'd got it right. I burnt a PROM and couldn't figure out why I was getting absolutely no response from my system at all.

After more frustration I discovered that the z80 can't execute the actual source code that I'd accidentally programmed instead of the binary!

2 Likes

How many questions do we get from newbies wanting to know how they can recover the code from a processor so they can edit the source code?

2 Likes

LOL, I coulda used that… but having been here for some time knew better than to ask about that route.

I'm not expecting to develop any discipline at all at this point in my life, but if I could just learn to write down the name of the sketch folder for what is on an Arduino board currently somewhere on the physical device, I would be.

I have tried adding an informative setup() print statement, but like comments any I have done are usually wrong by the time I'd need them.

a7

  1. Use Serial.println(__FILE__) in your setup() code.
  2. edit this into the "BareMinimum.ino" sketch that the IDE uses to start with when choosing New Sketch.

Other compile time constants to inject in setup() are __DATE__ and __TIME__

3 Likes

I think you just described a good portion of the "why won't this compile" questions on this forum.

3 Likes

You'll find a parity between these and the ones who want to know how to lock the chip up to prevent someone from doing the same.

1 Like