cancel
Showing results for 
Search instead for 
Did you mean: 

NJTRST (PB4) pin for stm32l431

ELin.4
Associate II

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:

  1. 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 ?
  2. 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

1 ACCEPTED SOLUTION

Accepted Solutions
Uwe Bonnes
Principal III

Remove Q12 and measure voltage at NRST again, to exclude errors related to the transistor.

View solution in original post

7 REPLIES 7

> 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

ELin.4
Associate II

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.

0693W000008zQfYQAU.png 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

Uwe Bonnes
Principal III

A lot of STM32 have the errate "Full JTAG configuration without NJTRST pin cannot be used"

ELin.4
Associate II

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

Uwe Bonnes
Principal III

Remove Q12 and measure voltage at NRST again, to exclude errors related to the transistor.

Read out and check/post content of relevant GPIO registers.

JW

You are right. The Q12 was the issue. Wrong IC was populated as the Q12.