cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2XX Flash PGPERR and PGSERR set just after reset

jbookout
Associate II
Posted on April 09, 2013 at 20:35

The specific device: STM32F205RG

Issue: I have a small boot code region that I'm using to jump from 0x0800000 to 0x08020000 the intervening blocks are to be used for static data... Unfortunately once I've jumped to 0x08020000 and start executing (even if I just infinite loop) I end up with the PGPERR and PGSERR bits set and if I clear them they just get reset. Code to make the jump from 08000000 to 08020000:

HWM_reset_handler PROC
EXPORT HWM_reset_handler
; Go to boot loader.
ENTRY
ldr r0, =0x08020000
ldr r1, [r0]
msr msp, r1 ; Initialize Stack for boot loader
add r0, r0, #4 ; r0 now has addr of reset handler in boot loader
ldr r0, [r0] ; Load the Reset Handler Address
orr r0, r0, #1 ; Ensure thumb mode
bx r0 ; jump to boot loader image
ENDP
ALIGN

I'm using the RVCT 3.1 compiler and assembler. (RVDS toolchain) So I can't exactly use the ST example libraries except as code examples... I also attempted to set the flash parallelism before making the jump, but this didn't help. I have a feeling it's not related to my code, as I'm not yet writing flash anywhere, rather related to the tool chain configuration...any ideas?
14 REPLIES 14
jbookout
Associate II
Posted on April 17, 2013 at 17:57

library source code...

I was looking at F1XX source when I mentioned I had a reference before and I realize now it's a bad example for F2xx flash. A few days ago I tried to find a more recent F2XX library source but had no luck...do you have a link to an app. note or something where I could download it?

Posted on April 17, 2013 at 19:35

http://www.st.com/web/en/catalog/tools/PF257898

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
o239955_st
Associate II
Posted on September 17, 2014 at 12:16

Hello all,

I've got same trouble with STM42F415RGT6 using Attolic and Segger Jlink ultra+

Using debug mode with segger probe, the flash has a correct state but after a Power On reset (without segger probe) the flash status has surely PGSERR bit set and sometime PGPERR bit set.

Don't know where it came from.

Olivier

Posted on September 17, 2014 at 13:46

Ok, and is this a problem? Can you clear the error/status like the ST examples do and proceed?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
o239955_st
Associate II
Posted on September 17, 2014 at 21:26

Maybe not a problem, I clear all pending flag before doing any flash writing (with eeprom emulation from ST).