Flash-based Configuration Data Using The ld Linker

Here is an easy way to store and use configuration data in the flash memory of a microcontroller.

This places the configuration data at a specific absolute memory address and uses no special pragmas to enable read access.

This is a slight reworking and consolidation of what MCU on Eclipse suggests, and slightly easier than marking variables with __attribute__((section(".etwas"))) all the time, though that is useful in other cases. Also, the SEGGER J-Link debugger on my development kit was always erasing the configuration data (as I’d placed it between other code and data, at a pretty low flash address), which was the opposite of the problem MCU on Eclipse was having. So, I needed a way to protect specific flash regions from getting erased, as Kinetis Design Studio has no easy options for this.

Continue reading Flash-based Configuration Data Using The ld Linker

Windows Is Depressing

Ok, here’s a super odd bug on Windows. I started getting a bunch of errors in various programs.

CoolTerm said: “Runtime Error” with “Failure Condition: mutex.mLockFile”

CoolTerm error

Process Explorer complained that it was “Unable to extract 64-bit image. Run Process Explorer from writeable directory.”

Process Explorer Error

This of course didn’t make sense, as the program was in a writeable folder, but then it dawned on me that both of these programs could be trying to use my account’s TEMP folder.

So, I’m super annoyed. Somehow my user account’s TEMP folder got wiped out, and replaced as a file instead, which obviously can’t contain more files.

Temp folder is a file now?

The solution in this case was to erase the Temp file and create a new TEMP folder. But it is insane to me that all the programs that rely on a writeable TEMP folder would give such terrible hints that this was the problem’s source. It also would be awesome if Windows would autorepair this condition at startup.