[Embedded] Can someone sanity check my NOR memory structure for me?
JustEnoughDucks @ JustEnoughDucks @feddit.nl Posts 9Comments 1,035Joined 2 yr. ago

JustEnoughDucks @ JustEnoughDucks @feddit.nl
Posts
9
Comments
1,035
Joined
2 yr. ago
Thanks for taking a look!
Intuitively for me, steps + bpm should be next to each other because the compiler will use
bpm
as the padding for the 24 bitsteps
. I intentionally did it that way. At least when I checked the memory addresses when testing it that was the case (there was no padding added). Wouldn't it be potentially more problematic to have a bit field with a weird bit number, 24, followed by a 16 bit member that can't be "fit" into the 32 bits that the compiler wants to assign? or is that not how it works.I'm not quite sure what you mean by your last point. The flow would go: acquire data -> add to structure -> fill up a page worth of data (or a sector) -> write to memory. Then pulling it out would be: read from memory -> put in structure -> process -> send data via bluetooth. If I change the layout of anything, that would require a reflash of the MCU and previous data would already have been transferred over bluetooth (assuming end-user OTA flashing or just being in a vicinity of a phone and not out and about where memory saving is necessary) and would no longer be needed to be stored/pulled from memory. Or is there another case that I am totally missing?