2013-05-31 04:57 AM
I am working on a project using an STM32F103 with 768K of internal Flash. I can successfully erase and program the first bank of internal Flash, but am having problems with bank2.
The problem seems to be that I am having problems accessing the address range of the bank. If I use the JTAG to program the second bank, then try to read it from my code it just reads as all F's. I am unable to program bank 2. The process seems to complete successfully, but when I check via the JTAG the area has not been written. If I program the bank via the JTAG I can erase the area from code, confirmed via the JTAG. Given that I can't seem to read the bank, I was wondering if the problem was the step where I effectively write to the address. Do I have to write to any registers to allow me to access the second bank? My code is running from bank1. Thanks, Stuart #stm32f103-flash2013-05-31 06:25 AM
While there is some magic with XL parts, most of that is achieved by picking the right flash algorithm/applet in the tool chain, and building with the startup_stm32f10x_xl.s and STM32F10X_XL defined.
From a perspective of flashing from within ones own code, you have to deal with the page size, and recognize which bank, registers and control bits need to be used. You should be able to read the memory in a linear fashion, and programming it should work, check that you have verify enabled. You don't mention a tool chain, but you could try other avenues and tools to program the part. The ST-Link utilities and Flash Demonstrator being particularly good sanity checkers.2013-07-04 06:14 AM