2022-06-27 01: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,
2022-06-27 02: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?
2022-06-27 02: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.
2022-06-27 02:38 PM
2022-06-27 02:39 PM
2022-06-27 07:55 PM
Maybe this is an opportunity to reconsider merits and demerits of clicking vs. programming.
JW