CCLib icon indicating copy to clipboard operation
CCLib copied to clipboard

Write anywhere

Open Sjord opened this issue 9 years ago • 1 comments

The flash is addressable as 32-bit words, so we can only write on 32-bit boundaries. If the offset parameter to writeCODE is not divisible by 4 (bytes), we will write to the wrong location. Put 0xff on the front of data so that data is still written to the correct location.

Also, make sure the size of the data is also divisable by 4, as the documentation states: "note that the block size, LEN in configuration data, must be divisible by 4; otherwise, the last word is not written to the flash".

This is not really an ideal solution because we will now also check the 0xff padding when verifying the write. This should not happen.

Sjord avatar Jan 09 '17 10:01 Sjord

Worked for me for https://github.com/mtornblad/zstack-1.2.2a.44539/blob/master/CC2531/CC2531ZNP-Pro-Secure_LinkKeyJoin.hex but not for https://github.com/zigbeer/documents/blob/master/zigbee-shepherd/CC2531ZNP-Test.rar

AndrewLinden avatar Sep 26 '17 09:09 AndrewLinden