Experience trap

Sometimes previous experience really matters.


 

I have a backend-engineering background and at @qwello.charge I'm involved in embedded development.

This time I'm writing an application that stores data in the chip memory. I've experienced an issue that I couldn't explain for a few days: after hardware reset, everything works. But works only once.

 

The second attempt yields garbage in the memory I try to write to. Debugging doesn't help, all the data I sent to write is correct. The "write operations" seem to be successful. But data in memory is not what I just sent.

 

I've lost a few days trying to figure out, what's wrong. My experience pushed me to check the indexes and addresses several times. "Computer is dumb, it just does what you tell it" right?

The issue was the way the flash memory works. During writing, it writes only "0"s. To write "1"s you need to erase the memory. In this case, the consequent write will write zeros, and the value in the memory will have the intended value.

Comments

Popular posts from this blog

Compilation from macOS(Intel) to linux x86_64 finaly works. Cross compilation of the rust code with bazel. Part 2.

Cross compilation for ARM v7. Cross compilation of the rust code with bazel. Part 3.

Scaling number of supported platforms. Cross compilation of the rust code with bazel. Part 5