We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I try to trace the GPIO pin status in Keil5 MDK ARM logic analyzer, but it's not successful.
I am using the Nucleo-H743ZI2 board with STLink 3 SWO mode. I can also see the printf output in the "Debug (printf) Viewer" without any issue. The LED on board is on PB0. In the debug mode, I can see the GPIOB ODR is updating, which aligns with the LED status.
But when I type the "PORTB.0" in the Logic Analyzer setup, it said "Unknown signal".
Is there a way to trace the GPIO pin status in the logic analyzer by Keil5 MDK ARM? I tried "PORTB.0", "GPIOB.0", etc, but none of them works. Can anyone give me some guidance how to do the set up?
Thanks in advance.
The Logic Analyzer requires a global program variable of which it can take the address. See also the restrictions page in the manual. For the SFR registers in the chip header files, there are C macros used that dereference addresses. So, there is no way to take an address of them.
As a workaround you can try placing a variable at the location you want to monitor, for example like this:
// GPIOB->ODR is at 0x58020414 unsigned long GPIOB_ODR __attribute__((used,section(".bss.ARM.__at_0x58020414"))) ;
GPIOB_ODR can be added to the Logic Analyzer and then use the "Display Formula" settings to watch only the required bit.
excited to find the resolution, but how do I know the GPIO_ODR's address (0x58020414)? waiting for your response.
You find that in the device manual.