cancel
Showing results for 
Search instead for 
Did you mean: 

Debug - Print GPIOA->BSSR register

ee06091
Associate III
Posted on September 07, 2013 at 00:56

Hi,

How can I print the GPIOA->BSSR register using gdb? I tried to p using the register address but with no success:

  1. (

    gdb

    )

     n
  2. 67

                  GPIOC->BSRR = 

    GPIO_Pin_9;

  3. (

    gdb

    )

     p/x *

    (

    0x40010800

     + 

    0x10

    )

  4. $6 = 

    0x0

  5. (

    gdb

    )

     n
  6. Breakpoint 

    1

    main

     

    (

    )

     at 

    main.c

    :

    68

  7. 68

                  GPIOC->BRR = 

    GPIO_Pin_9;

  8. (

    gdb

    )

     p/x *

    (

    0x40010800

     + 

    0x10

    )

  9. $7 = 

    0x0

  10. (

    gdb

    )

The pin is configured as the led in the board change the state.

Thanks 🙂
5 REPLIES 5
Posted on September 07, 2013 at 01:16

Just read ODR if you want to know the current driver state. BSRR uses some combinatorial logic to RMW the ODR via a single atomic write, it's not designed to be readable. It's a peripheral register, and may not behave like memory/RAM.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ee06091
Associate III
Posted on September 07, 2013 at 01:29

even with ODR it doesn't work:

  1. (

    gdb

    )

     n
  2. 65

                  GPIOC->BSRR = 

    GPIO_Pin_9;

  3. (

    gdb

    )

     p/x *

    (

    0x40010800

    +

    0x0c

    )

  4. $5 = 

    0xa800

  5. (

    gdb

    )

     n
  6. 66

                  GPIOC->BRR = 

    GPIO_Pin_9;

  7. (

    gdb

    )

     p/x *

    (

    0x40010800

    +

    0x0c

    )

  8. $6 = 

    0xa800

  9. (

    gdb

    )

I'm not trying to read in the software but with GDB

Posted on September 07, 2013 at 04:28

What part is this?

GPIOC->ODR on an F1 is 0x4001100C

GPIOC->ODR on an F3 is 0x48000814
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ee06091
Associate III
Posted on September 07, 2013 at 04:52

Doesn't understand your question :s

sorry my english

Posted on September 07, 2013 at 05:18

I don't think you're looking at the right address for GPIOC->ODR

Which STM32 part are we talking about?
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..