I’m working with a flash based part and the project requires some configuration variables to be stored in the device flash memory.  Ideally these values can be changed at runtime, but there’s an issue with their locations.  The flash is organized in 512 byte blocks that must be completely erased and reprogrammed to change a single byte value.  However, if the code builds so that the memory aligns the configuration block such it contains any code, it seems pretty dangerous to erasing and reprogramming the code segment.  This would be an especially SIGNIFICANT issue if code to reprogram the flash memory happens to align with the block that contains the actual data…


I was wondering if there is any way to configure a build with SDCC to handle this situation automatically.  I found the information about absolute addressing, but this doesn’t sound as this would help unless I exclude a segment of the code memory and handle the allocation of this block myself.