cancel
Showing results for 
Search instead for 
Did you mean: 

Problemwith SWD debugging on STM32L011D4P6

Rhodes.Keith
Associate II
Posted on November 22, 2016 at 23:09

Hi,

We are bringing up a new design using this CPU. Aside from other issues, we have an inconsistency between different boards when trying to program using SWD. 

On one working board, the SWD clock (pin 2 on the 10 pin JTAG connector) properly shows a clean signal. The circuit connects PA14 on the CPU to pin 2 of the 10 pin JTAG connector.

On other boards, it looks like someone else is driving this pin. On the scope, it shows 2 or 3 different levels of the signal, like the CPU is driving it for some reason.

Could this be that PA14 has been programmed to the Alternate function by default? Is there a way to reset the CPU so that the SWD pins work properly during reset/download?

We've used other STM32F parts and not had the same issues as the STM32L0 part.

Thanks...Keith

3 REPLIES 3
troy1818
Senior
Posted on November 23, 2016 at 11:30

The MCU will never drive a pin by default. That would be stupid. If you do not configure a pin it will be set as input (probably with pullup). If you have custom hardware I would check the HW thoroughly so that you do not have a short anywhere that can affect the pin you have problems with.

Rhodes.Keith
Associate II
Posted on November 23, 2016 at 12:24

I agree it would be crazy for the CPU to drive these pins, but that is what seems to be happening. 

I have 10 boards with the same parts on all. They all have the same L011 revision (Z, not A).

If I take a board that is working and move the CPU from it to a board that is not working with a different CPU, the board that had failed, now works. In other words, once I find a working CPU, it works on whatever board I put it on.

As far as I can tell, there are no shorts on any of the boards. 

Either I have 9 failing CPUs and 1 working, or something else is driving this pin.

Rhodes.Keith
Associate II
Posted on November 24, 2016 at 19:30

I figured it out. The problem is that I expected the STML011 to behave like the STMF series. For both boards we use the 10 pin micro JTAG connector and need an interconnect board to connect to the Segger JLink probe. 

For the STMF4, the interconnect board would connect nRESET on the 10 pin connector on pin 10 to the 20 pin connector on pin 3 (TRST).

For the STML011  you need to connect nRESET on pin 10 of the 10 pin connector to pin 15 (RESET) on the 20 pin connector.

The STMLink probe drops the RESET line right before sending the clocks and data on their respective pins. If you don't connect the RESET line to nRESET the STM32L011 processor will drive the JTAG clock pin and not allow the debug interface to work properly.