Question
Unable to write to specific addresses in flash
Posted on June 24, 2015 at 14:28
I am working with the
Discovery development board
STM32F407 microcontroller and building using Eclipse/GNU. I trying to reprogram sector 0 (address range: 0x0800 0000 - 0x0800 3FFF; 16 Kbytes total) from within my application, but 6 memory locations does not seem to program properly:
Programming failed at address 0x8000004. Value we would like to write 0x05. Value actually written 0x01Programming failed at address 0x8000401. Value we would like to write 0xFC. Value actually written 0x48Programming failed at address 0x8000403. Value we would like to write 0x20. Value actually written 0x00Programming failed at address 0x8000404. Value we would like to write 0x5D. Value actually written 0x50Programming failed at address 0x8000408. Value we would like to write 0x61. Value actually written 0x00Programming failed at address 0x8000409. Value we would like to write 0x06. Value actually written 0x00All my calls to HAL_FLASH_Program returns HAL_OK. Here are excerpts from my .dump file:08000000 <__startUpVector>: 8000000: 2001fc00 andcs pc, r1, r0, lsl #24 8000004: 08000401 stmdaeq r0, {r0, sl}void __attribute__ ((section(''.jumpToApplication''),used)) __jumpToApplication(void){ JMP(0x08010004); 8000400: 4b01 ldr r3, [pc, #4] ; (8000408 <__jumpToApplication+0x8>) 8000402: 469f mov pc, r3 8000404: 4770 bx lr 8000406: bf00 nop 8000408: 08010004 stmdaeq r1, {r2}I'd be most grateful for any help on this matter. Thanks in advance.