cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent boot with STM32L412

JesFo
Associate

Hello.

I'm struggling to get a plain STM32L412KBT6 to boot consistently into the user program. I'm working with the PlatformIO environment in VSCode. I've tried both the STM32-Cube, and the Arduino framework with similar results. Here is my platformio.ini:

[env:nucleo_l412kb]
platform = ststm32
board = nucleo_l412kb
framework = arduino
upload_protocol = stlink

My setup consists of a very basic breakout PCB for the MCU:

po4gYhfg.png

Which is roughly hooked up as follows:

viwHjro7.png

Platformio output when uploading using STLinkV2:

CURRENT: upload_protocol = stlink
Uploading .pio\build\nucleo_l412kb\firmware.elf
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x1fff31f8 msp: 0x20001bb0
** Programming Started **
Warn : Adding extra erase range, 0x08002a80 .. 0x08002fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked

And the config flags in STM32CubeProg:

FTFwaBVo.png

The issue:

The MCU doesn't boot directly into the user program when powered up. Only when I wait around 2-minutes after powering the board and then give the NRST-pin a low signal for reset, the user program starts executing. The program also sometimes starts executing after uploading the program through STLink, but resetting the board results in having to power it down and repeat the 2-minute wait method mentioned above. I've tried this with 3 MCU:s with identical results. 

3 REPLIES 3
Uwe Bonnes
Principal III

The loop Chip VDD/Pin1 via C1 to chip VSS Pin32 seems large. Insufficient decoupling may lead to inconsistant behaviour.

 

Better do your first experiments with Nucleo boards, as they have all the infrastructure needed.

KnarfB
Principal III

Compared to the reference schematics in " Getting started with STM32L4 Series and STM32L4+ Series
hardware development" App. Note: NRST does not have a pull-up R. NRST is a bidir pin which is pulled down from inside on reset. You may monitor NRST level with a scope. 

hth

KnarfB 

 

dear @JesFo 


Indeed Reset circuit should be updated , please remove R1 and R2 resistors .

Cheers

STOne-32