2017-07-05 07:17 PM
Hi, all!
I want to program single byte to internal flash, but the standard peripheral library only support 'word' and 'half word', is it possible to program single byte, please?
For example:
mailto:0x11@0x08010000,
0x22@0x08010001My operation as follow:
// for first byte
1. erase page
2. read test_half_word from 0x08010000
3. test_half_word &= 0xFF00
4. test_half_word |= 0x11
5. write test_half_word to 0x08010000
// for second byte
6. read test_half_word from 0x08010000
7. test_half_word &= 0x00FF
8. test_half_word |= 0x22
9. write test_half_word to 0x08010000
Result: the first byte programmed successfully, but the second byte failed.
I think the value of 0x08010000 is 0xFF, it should be programmed, but I'm wrong. Could you help me, please?
(By the way, the ram buffer of 1KB can solve the problem ,but not suitable for my project)
2017-07-06 04:31 AM
Combine the bytes and write as a half-word. You fail to mention a specific STM32 part, but most have a wide flash line containing ecc bits.