Skip to main content
Associate
June 18, 2023
Question

STM32 not working on custum pcb

  • June 18, 2023
  • 10 replies
  • 3452 views

Hi,
I created a custum PCB based on STM32L431RCT6,
The debugger find the MCU and my code transmitted to my stm32 successfully,
even variables are shown in debugger live section.

But .. stm32 could not do some simple work suck as "blinking a led"
using debugging technics it turns out that mcu could not do a single operation inside while loop
I tried this but nothing:

  1. Use the same code that works on other stm32
  2. Check for pcb routes connections 

here is my main.c 

    This topic has been closed for replies.

    10 replies

    Rodo
    Senior
    June 18, 2023

    Can u show your schematic?

    lilianeAuthor
    Associate
    June 20, 2023

    Schematic_HarmonyTechnology.png

    Explorer
    June 19, 2023

    I think there is something wrong with your PCB, can you share your schematic?

    lilianeAuthor
    Associate
    June 20, 2023

    Schematic_HarmonyTechnology.png

    Bob S
    Super User
    June 20, 2023

    BOOT0 needs to be GND by default, high will usually force the built-in bootloader to run (depending on config bits).

    Graduate II
    June 20, 2023

    Agree. Also the Reset switch should be grounding, parallel to C9. Now it doesnt do anything since there is also internal pullup in the NRST line.

    gbm
    Super User
    June 20, 2023

    Is AVdd the same as Vin? It should be, otherwise the circuit will not work.

    My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
    Bob S
    Super User
    June 20, 2023

    2nd look - you may need Vin connected to the VBAT pin, I don't recall if that can be left floating.  Also, you have no bypass caps on the STM32 chip's VDD pins.

    AScha.3
    Super User
    June 20, 2023

    come on - Vin is 12 V , kill every cpu.

    Vbat goes to lipo battery, nothing else.

    AVdd goes to Vdd , 3.3 V , nothing else. otherwise cpu is dead. (so if already connected, to vin, use new cpu.

    this one is very dead . )

    If you feel a post has answered your question, please click on " Best Answer ".
    MM..1
    Super User
    June 20, 2023

    Vin is out from1117 3v3 then this is ok and loading into MCU over stlink is too ok.

    But your reset and boot circouit is complete fail. And for primary testing build sw with HSI not HSE