NJTRST (PB4) pin for stm32l431
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-12 5: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:
- I never used JTAG to debug the stm32 before, and I don't recall ever having trouble configuring this particular pin (NJTRST) to be an GPIO input pin. Have I simply been ignorant until now ?
- If there is indeed a need to remap this NJTRST pin before using it as an GPIO input pin, how do I do that without the macro mentioned above ?
Thanks,
Eric
Solved! Go to Solution.
- Labels:
-
DEBUG
-
STM32L4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 11:07 AM
Remove Q12 and measure voltage at NRST again, to exclude errors related to the transistor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 8: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 9:07 AM
A lot of STM32 have the errate "Full JTAG configuration without NJTRST pin cannot be used"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 9: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 11:07 AM
Remove Q12 and measure voltage at NRST again, to exclude errors related to the transistor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 1:41 PM
Read out and check/post content of relevant GPIO registers.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-13 3:36 PM
You are right. The Q12 was the issue. Wrong IC was populated as the Q12.
