2021-04-12 05:32 PM
Hello, there
I was not able to use the NJTRST (PB4) pin as a general GPIO input pin. I googled and other people having the same issue using the macro:
__HAL_AFIO_REMAP_SWJ_NONJTRST()
to remap the NJTRST pin. Yet, this macro is not available for the STM32L431 that I am using. I use STM32CubeMX to generate the baseline codes.
My questions are:
Thanks,
Eric
Solved! Go to Solution.
2021-04-13 11:07 AM
Remove Q12 and measure voltage at NRST again, to exclude errors related to the transistor.
2021-04-12 11:27 PM
> I was not able to use the NJTRST (PB4) pin as a general GPIO input pin.
What did you do and how did it fail?
What is your hardware? How do you program/debug it?
JW
2021-04-13 08:03 AM
Hi, JW
The pin is configured as an GPIO input, with no pullup/pulldown. I used the CubeMX to generate the driver. On the PCBA, there is an external pullup to 3.3 V. Yet, the pin always read as in the reset state.
In the screenshot attached, the Pack_Enable_out is connected to the NJTRST (PB4). The Q12 is in its "OFF" state, yet we are measuring 0V, a reset state at its leg 3.
We program the board through PA13 (SWDIO), PA14 (SWCLK) and the NRST pins.
Thanks for your attention, JW, and please let me know if you need any more information.
Eric
2021-04-13 09:07 AM
A lot of STM32 have the errate "Full JTAG configuration without NJTRST pin cannot be used"
2021-04-13 09:45 AM
Hi, Uwe
I am not using the JTAG to debug the system. I want to use the NJTRST as a GPIO input pin.
Thanks,
Eric
2021-04-13 11:07 AM
Remove Q12 and measure voltage at NRST again, to exclude errors related to the transistor.
2021-04-13 01:41 PM
Read out and check/post content of relevant GPIO registers.
JW
2021-04-13 03:36 PM
You are right. The Q12 was the issue. Wrong IC was populated as the Q12.