2017-02-28 07:22 AM
1:
I have developed a small program for the STM32L031 Nucleo-32 using the example UART_TwoBoards_ComIT. The program run on the STM32L031 Nucleo-32 develop-board. When I load* the program to our own HW it does not start, I have tried with and without the compiler directive USE_STM32L0XX_NUCLEO_32. I suspect the system clock generation, but can’t find where it is setup.
*I load the program using STM flash_loader_demo_v2.8.0.
2:
I want to use the ST-LINK V2 for debug should the data port be connected to PA13?
Do any have a hint or comments that could help me?
-Mads
Solved! Go to Solution.
2017-03-02 12:48 AM
Hi Clive
FYI
1: I forced the program to use the HSE clock now it works.
2 The TDO_SWO is optional now the bugger also works.
Problems solved!
-Mads
2017-02-28 07:36 AM
You would need to connect both SWDIO (PA13) and SWCLK (PA14), VCC and GND would also need connections to the ST-LINK. The connection of NRST would also be desirable.
Make sure BOOT0 pin is pulled low to execute your code.
Then use a debugger to understand what is happening, or GPIO/USART signalling
2017-02-28 08:45 PM
There is already a STLink V2-1 embeded on the
STM32L031 Nucleo-32 (on the bottom side of the PCB) and it is already properly connected unless you (removed some 0 Ohms resistors).
Check
and , you will get a lot of useful information2017-02-28 09:56 PM
>>
When I load* the program to our own HW it does not start
Emphasis mine, the OP is discussing two situations, a working Nucleo, and a non-working custom board needing connectivity to an ST-LINK to debug the situation.
The Nucleo will have an 8 MHz clock source feed from the onboard ST-LINK. This is likely not present on the custom board, so BYPASS mode won't work, and HSE must start succesfully. Settings in SystemInit() need review.
2017-03-01 02:13 AM
Hi Clive
I understand I can't use the SWIM connector, but what about TDO_SWO connection?
ST-LINK/V2
connector
(CN3)
ST-LINK/V2 function
Target connection
(JTAG)
Target connection
(SWD)
STM32L031
1,2
VAPP
Target VCC
MCU VDD(1)
MCU VDD(1)
VDD
3
TRST
JTAG TRST
JNTRST
GND(2)
GND
4
GND
GND
GND(3)
GND(3)
GND
5
TDI
JTAG TDO
JTDI
GND(3)
GND
6
GND
GND
GND(3)
GND(3)
GND
7
TMS_SWDIO
JTAG TMS, SW IO
JTMS
SWDIO
PA13
8
GND
GND
GND(3)
GND(3)
GND
9
TCK_SWCLK
JTAG TCK, SW CLK
JTCK
SWCLK
PA14
10
GND
GND
GND(3)
GND(3)
GND
11
NC
Not connected
Not connected
Not connected
NC
12
GND
GND
GND(3)
GND(3)
GND
13
TDO_SWO
JTAG TDI, SWO
JTDO
TRACESWO(4)
?
14
GND
GND
GND(3)
GND(3)
GND
15
NRST
NRST
NRST
NRST
NRST
16
GND
GND
GND(3)
GND(3)
GND
17
NC
Not connected
Not connected
Not connected
NC
18
GND
GND
GND(3)
GND(3)
GND
19
VDD
VDD (3.3V) (5)
Not connected
Not connected
NC
20
GND
GND
GND(3)
GND(3)
GND
-Mads
2017-03-01 08:37 AM
The Cortex-M0+ is supposedly able to support SWV via SWO, haven't verified myself, doesn't work on Cortex-M0 parts
If you need telemetry via the SWV (Serial Wire Viewer) you could experiment.
2017-03-02 12:48 AM
Hi Clive
FYI
1: I forced the program to use the HSE clock now it works.
2 The TDO_SWO is optional now the bugger also works.
Problems solved!
-Mads