Skip to content

Conversation

@Sjord
Copy link
Contributor

@Sjord Sjord commented Jan 9, 2017

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 added 3 commits January 9, 2017 11:04
When erasing, we would write different values to 0x6271 (flash address) than
are needed to write the data. Move the write after the erase so they don't
interfere with each other.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants