JTAG signals on STM32L433 [RESOLVED]
Hello,
for the project I am developing I am using a STM32L433.
We have connected a motor encoder signals to PA15 and PB3, that are CH1 and CH2 for timer1 TIM2 configured in encoder mode.
We used CubeMX to configure the HW, and that worked perfectly for another encoder on other pins.
We use a ST link HW interface for FW run/debug, using the SWD interface.
I have a problem with the encoder in timer1 to count while the motor is spinning in some cases.
Compiled both in release mode or debug mode and running it or debugging it the FW shows a random behavior with the timer1 often not counting the encoder signals. Behavior may change after a reset or a power on/off cycle.
I have verified that in all cases the input signal is received correctly by periodically reading one of encoder signal status and driving a LED accordingly. If I manually spin the motor the LED blinks, which means the toggling signals are correctly received by the microprocessor. But the timer1 cannot count them.
As we have no problems with the other encoder on timer2 TIM1, we suspect that the problem lies in the multiplexing of signals PA15 and PB3 with JTAG JTDI and JTDO functionality. I have gone through the manual but beside the table describing the JTAG signals pin allocation, there not a description on how to disable them. CubeMX generated code seems not to address this problem.
I have also looked on the forums and the proposed solution seems to use this macro:
__HAL_AFIO_REMAP_SWJ_NOJTAG();
Unfortunately for this microprocessor I cannot find this macro anywhere.
And there's also no AFIO register to directly bit bang.
So how can I disable the JTAG functionality and have the PA15 and PB3 signals be directed to timer1 TIM2 instead of the JTAG controller?
Thanks in advance
Mauro
