The STM32CubeIDE has a debugger window that lets you look at the SPF (Special Function Registers). Why are the set of GPIO registers not included? I am trying to see if RA2 and RA9 are set up the same. But I do not know how to look at them in the debugger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-27 1:06 PM
This lets me see most registers. Why are the GPIO registers not included?
How do I examine their settings?
Normally I would print them out, but I am trying to debug the serial port so I cannot print them out to a terminal.
Thanks,
- Labels:
-
Bug-report
-
DEBUG
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-27 2:25 PM
I made local variables for each of the GPIO registers and it looks like AFRL = 0x1100 and AFRH is 0x0000,
Looking at the alternate function registers (STM32G051K8T) for PA2 and PA9 PA2 should be AF1 for USART2_TX and PA9 should be AF1 for USART1_TX
It looks like the MX program correctly set AFRL bits to 0001 for PA2, but set them to 0000 for PA9.
Is someone going to tell me that is another known bug with the MX program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-27 2:33 PM
Just added a line
GPIOA->AFR[1] |= 0x10;
to my code and that fixed the issue. USART1 is now transmitting in polling mode. Took about 8 hours to figure out this MX bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-27 2:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-27 2:39 PM
Great it overwrote the main c program. Nothing is easy...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-27 7:55 PM
Maybe this is an opportunity to reconsider merits and demerits of clicking vs. programming.
​
JW​
