cancel
Showing results for 
Search instead for 
Did you mean: 

"Reset value" does not correspond to the register value in debugging.

JSmit.19
Associate III

Hello,

I am using a STM32L471QGI6 MCU and its reference manual (RM0351) is:

https://www.st.com/resource/en/reference_manual/dm00083560-stm32l47xxx-stm32l48xxx-stm32l49xxx-and-stm32l4axxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

Regards the "Reset value:" written in the RM0351 document I have a specific question:

Let's take this example:

8.5.3 GPIO port output speed register (GPIOx_OSPEEDR)

(x = A to I)

Address offset: 0x08

Reset value: 0x0C00 0000 (for port A)

Reset value: 0x0000 0000 (for the other ports)

My question is:

I assume I have to expect the "Reset value" for the GPIOx_OSPEEDR register at the start of the MCU and before the initialization of the GPIOx? Is that right? Well, this is not what happens! I use IAR Embedded Workbench and when I go into debug I find another value that is 0x000000C0, my question is why?! I emphasize that this is before any initialization in the C program.

Could it be the document is wrong ?!

Thanks

23 REPLIES 23
Jocelyn RICARD
ST Employee

Hello JSmit,

If you find 0x000000C0 instead of 0x0C000000 this probably means you read the content of the 32bits word in big endian.

You can check this with following reset value of PUPDR at offset 0x0C. Default value is 0x64000000.

Best regards

Jocelyn

JSmit.19
Associate III

@Jocelyn RICARD​ Thanks but the endianness is not the issue I have explained in another reply.

It seems that it is related to the JTAG

0x000000C0 indicates that the 6th and 7th bits are raised (OSPEED3), and pin3 is connected to the JTDO. I just cannot find where the configuration takes place for the PB3, RM says after reset it has a floating state! When I enable GPIOB clock in RCC the GPIOB registers reset (according to the RM), but OSPEED3 is already set.

@Community member​ 

Piranha
Chief II

As Jan already pointed out - avoid the debugger and read the register values with code. Double check if the register addresses are according to reference manual.

JSmit.19
Associate III

@Piranha​ Thanks, but did you see my last response?