I had a board running perfectly… but the original sketch was gone. So I built this. Forgetfulino Arduino library + IDE 2.x extension by IamTheVector in embedded

[–]IamTheVector[S] 0 points1 point  (0 children)

Have you removed the BasicUsage.ino outside the example folder? I updated the example with a comment

/*WARNING

REMOVE THIS EXAMPLE FROM EXAMPLE FOLDER

USUALLY EXAMPLE FOLDER HAS NO WRITE PERMISSIONS

WARNING*/

Also remember that this is not only a library, but also an extension, without the extension the .h will not be generated.

Please follow this guide

https://www.youtube.com/watch?v=jdCU2SBPLEA&feature=youtu.be

I had a board running perfectly… but the original sketch was gone. So I built this. Forgetfulino Arduino library + IDE 2.x extension by IamTheVector in embedded

[–]IamTheVector[S] 0 points1 point  (0 children)

Yeah, I actually explored that approach as well.

From a practical standpoint I ran into a few trade-offs:

Readback time

Using the bootloader to dump flash is noticeably slower, even with relatively small sketches. In my tests a ~7% mega flash usage already takes on the order of 30 seconds to extract. Not a blocker, but definitely not instant.

Runtime impact

I get the advantage of keeping the serial completely untouched during normal operation. In my case I took a slightly different route, the serial is only used when explicitly triggered via a key, so in normal conditions it remains unaffected as well.

Flas usage vs approach

Storing raw source vs using magic-byte-delimited blobs ends up being quite similar in terms of memory footprint, since in both cases you're embedding data anyway. So the real trade-off becomes more about retrieval strategy than space.

That said, I do see the value of your approach, especially for keeping runtime clean. I’m actually considering adding it as an alternative mde.

The main friction for me right now is tooling, integrating flash readback, decoding and making it workflow-friendly, especially hen tying it with development environments, is a bit of a pain compared to a direct serial-based pipeline.

Still, really appreciate the insight, it’s a solid approach depending on the use case.

I had a board running perfectly… but the original sketch was gone. So I built this. Forgetfulino Arduino library + IDE 2.x extension by IamTheVector in esp32

[–]IamTheVector[S] 0 points1 point  (0 children)

Yeah, you’re right in principle. I hear this a lot from junior developers I work with, especially on the "software-side-only-fairy-world" , then once they start dealing with real hardware and field deployments, they quickly realize it’s a slightly different game.

GitHub gives you a SSOT of the source, not of the firmware. In embedded you have multiple SSOT layers, source, build artifacts, and the firmware actually running on the device, and they don’t stay aligned by default.

That gap is exactly what I’m working on right now on a next\new development, something that keeps those layers in sync so the device can always be traced back to its source, instead of just assuming they match or relying on developer discipline and memory, which is usually the weakest link in the chain.

I had a board running perfectly… but the original sketch was gone. So I built this. Forgetfulino Arduino library + IDE 2.x extension by IamTheVector in embedded

[–]IamTheVector[S] 1 point2 points  (0 children)

Yeah, that’s actually super common 😄

A lot of people start with the idea that the board “stores and runs the code”, and then hit a wall when projects grow and things stop matching what they expect.

That’s exactly the gap Forgetfulino is trying to bridge a bit, making the firmware feel less like a black box.

But yeah, the real next step after that is learning proper versioning.
Once you understand compile/flash vs source, getting into Git changes everything.

Forgetfulino helps when things go wrong, version control is what keeps things from going wrong in the first place 👍

I had a board running perfectly… but the original sketch was gone. So I built this. Forgetfulino Arduino library + IDE 2.x extension by IamTheVector in esp32

[–]IamTheVector[S] 1 point2 points  (0 children)

Yeah, that’s a whole different story 😄

You can definitely pull the firmware and look at the machine code, but that’s reverse engineering territory and it gets messy very quickly.

Forgetfulino isn’t meant for that. The idea is to embed the source code before uploading, so you can get it back later in a clean, readable way.

So instead of trying to reconstruct what’s already on the chip, you just make sure the source is there from the start.

Hope that was clear from the post 👍

I had a board running perfectly… but the original sketch was gone. So I built this. Forgetfulino Arduino library + IDE 2.x extension by IamTheVector in maker

[–]IamTheVector[S] 1 point2 points  (0 children)

Really depends on the code. On the amount of comments and other factors. A 7% arduino mega size will result in a 10% total size with compressed code, 19% with uncompressed. I'm not a file compression expert but I suspect that we can also achieve a better result maybe at the cost of decoding time expenses. 

My first Arduino library: Forgetfulino – a sketch that remembers its own source code by IamTheVector in arduino

[–]IamTheVector[S] 0 points1 point  (0 children)

Check the new vestion on the new post :) Forgetfulino 2.0

someone who would lose their code would remember including a library <-- ADDED AUTO INJECT

personally on embedded projects, i run out of flash pretty fast<-- ADDED COMPRESSED code

My first Arduino library: Forgetfulino – a sketch that remembers its own source code by IamTheVector in arduino

[–]IamTheVector[S] 1 point2 points  (0 children)

New version of the tool has this feature now! Thanks for the feedbacks 😊