EMbitz
EBlink on STM32F205, wrong flash size - Printable Version

+- EMbitz (https://www.embitz.org/forum)
+-- Forum: EBlink (https://www.embitz.org/forum/forum-3.html)
+--- Forum: Bug report (https://www.embitz.org/forum/forum-9.html)
+--- Thread: EBlink on STM32F205, wrong flash size (/thread-34.html)

Pages: 1 2


EBlink on STM32F205, wrong flash size - PDonchev - 24-01-2021

EBlink version 3.8-[59] by Gerard Zagema

Interface USB# : 57FF71067265575726451867
Interface type : STlink/V2
STlink connect : Under reset
Target voltage : 3.23V
Interface speed: 4000KHz
Target detected: Cortex-M3 (r2p0)
HW breakpoints : 6
HW watchpoints : 4
Fault unwind  : Active break (level 2)
STmicro family : STM32F2xx
Detected FLASH : 0x3FFF000
Configured RAM : 0x20000
GDB listening (127.0.0.1 @ 2331)
GDB connected
Flashing 480 sectors ERROR: writing sector 56 failed! [Flash errors]
Reset: system


RE: EBlink on STM32F205, wrong flash size - embitz - 26-01-2021

Thanks for the report!

A bit more info please, what is wrong and what should it be?

P.s. you can try to fix it yourself in the stm32f2x.script and share your solution.
Also, you can override the flash size on the cli with -D FLASH_SIZE=xxxxx


RE: EBlink on STM32F205, wrong flash size - Mink - 26-01-2021

(24-01-2021, 09:38 PM)PDonchev Wrote: Detected FLASH : 0x3FFF000
This is 64 MB. In STM32F205 not so many flash memory.
How much flash reported ST-LINK Utility?


RE: EBlink on STM32F205, wrong flash size - PDonchev - 27-01-2021

Sorry for the lack of details. It has 1MB flash. I will try to fix the problem in the stm32f2x.script.

Edit:
Now is fixed (stm32f2x.script attached).
Code:
EBlink version 3.8-[59] by Gerard Zagema

Interface USB# : 57FF71067265575726451867
Interface type : STlink/V2
STlink connect : Under reset
Target voltage : 3.23V
Interface speed: 4000KHz
Target detected: Cortex-M3 (r2p0)
HW breakpoints : 6
HW watchpoints : 4
Fault unwind   : Active break (level 2)
STmicro family : STM32F2xx
Detected FLASH : 0x100000
Configured RAM : 0x20000
GDB listening (127.0.0.1 @ 2331)
GDB connected
Flashing sector  0, address: 0x08000000, length: 0x0008
Flashing sector  3, address: 0x0800C000, length: 0x4000
Flashing sector  4, address: 0x08010000, length: 0x10000
Flashing sector  5, address: 0x08020000, length: 0x20000
Flashing sector  6, address: 0x08040000, length: 0x20000
Flashing sector  7, address: 0x08060000, length: 0x20000
Flashing sector  8, address: 0x08080000, length: 0x6044
Flashing sector 11, address: 0x080E0000, length: 0x20000
Reset: system



RE: EBlink on STM32F205, wrong flash size - embitz - 27-01-2021

Nice!
That's the whole point of this EBlink project. Let users quickly add or modify device support.
Hence Squirrel because it is close to all the users because of the C-like nature.

I will update the script on github.


RE: EBlink on STM32F205, wrong flash size - embitz - 27-01-2021

@PDonchev
Could you test this script file?
If it's working I will commit it.

Cheers.


RE: EBlink on STM32F205, wrong flash size - Mink - 27-01-2021

Why
Code:
flash_size = intrfApi.value32 >>16
Here is the register Flash size
   
0 - 15 bits are used.
It should be.
Code:
flash_size = intrfApi.value32 & 0xFFFF



RE: EBlink on STM32F205, wrong flash size - embitz - 27-01-2021

(27-01-2021, 03:21 PM)Mink Wrote: Why
Code:
flash_size = intrfApi.value32 >>16
Here is the register Flash size

0 - 15 bits are used.
It should be.
Code:
flash_size = intrfApi.value32 & 0xFFFF

Yes, I saw that this morning. However, for the stm32f4 the same applies according the ref manual but we also use as 16 shift right in the F4 script. And I'm pretty sure that that script is working because I use it with a F429.

That's the reason I asked the original poster to try my script to be sure.


RE: EBlink on STM32F205, wrong flash size - PDonchev - 27-01-2021

Except the missing bracket on line 92, the script is working.
I guess the reading is done on 4 byte aligned addresses and the last 2 bits from the address are ignored. I can change the address to 0x1FFF7A20, but the result is the same.
That's why the shift is required.


RE: EBlink on STM32F205, wrong flash size - embitz - 27-01-2021

Thanks!!

It's some time ago that I build those scripts and I can't remember everything why it is as it is. 
Also some algo's are copied from openOCD because I don't have those devices to test.