"Unknown signal" when trace GPIO pin status in Keil5 logic analyzer (Nucleo-H743ZI2)

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.