STM32F030F4P6 Programming issues - Page 1
Forum section: electronics / general

author: CM800
author_rank: Frequent Contributor
timestamp: September 14, 2018, 09:35:07 pm
content: Hi All,I have a new PCB I've put together with an STM32F030F4P6.I've attached the Schematic drawing below for reference.I've checked over the board extensively to confirm all is correct.Normally, to program an STM32F030, like one of the blue pills, all I have to do is attach the 3v3, GND & SCLK / SIO pins.For this board I've made, I have to also connect Reset pin, & attach BOOT0 to 3v3 to get a connection.I suspect it's due to the config internally of the unit, however I have used STM32Cube to set up the ports as Debug Serial Wire, this hasn't made a difference.How can I configure this to allow me to work easily to program the unit without having to mess around with bringing the BOOT pin high and low, (and preferably no Reset line needed)Thanks!

author: mbless
author_rank: Regular Contributor
timestamp: September 15, 2018, 01:11:45 am
content: You haven't said what you are using to program it.I just use a ST-Link and wire up VDD, GND, SWCLK, SWDIO and RST. BOOT0 should be pulled down to ground like in your schematic; setting it high will invoke the bootloader (UART, etc.), which you don't want if you're programming via SWD.You can program with SWD without RST connected to the programmer, but then you have to manually reset to connect.

author: CM800
author_rank: Frequent Contributor
timestamp: September 15, 2018, 08:15:52 am
content: Quote from: mbless on September 15, 2018, 01:11:45 amI've been unable to connect to the MCU the way you've described it (with or without the reset connection)I've ONLY been able to connect to it when the MCU is restarted with BOOT0 high, never when it is low.I'm using an ST-LINK V2 (that works fine on the other boards I've tried, including a protoboard blue pill with the same MCU on it)I'm using Visual GDB too, with Open OCD.

author: JS
author_rank: Frequent Contributor
timestamp: September 16, 2018, 11:29:30 pm
content: Looks like you want a bootloader, seems like your  might have one...JS

author: CM800
author_rank: Frequent Contributor
timestamp: September 17, 2018, 07:22:44 am
content: I'd be surprised if the pill has a bootloader, it's just an STM32F030F4 breakout off ebay:https://www.ebay.co.uk/itm/STM32F030F4P6-ARM-CORTEX-M0-Core-Minimum-System-Dev-Board-UK/292149128160?hash=item440571ebe0:g:pMcAAOSwarNZuJVJBut as mentioned, On my custom board, I can't seem to connect without starting the unit in bootloader mode. Even then, it's kinda unreliable as you have to mess about putting it in and out of bootloader mode (sometimes I loose connection)It's weird.No issues with the Chinese designed board, yet I can't find any hardware faults in mine.

author: newbrain
author_rank: Super Contributor
timestamp: September 17, 2018, 08:24:04 am
content: Quote from: CM800 on September 17, 2018, 07:22:44 amQuote from: JS on September 16, 2018, 11:29:30 pmThe STM32F0 series has (as all STM32F/L/Hx, AFAIK) adefault bootloader.The bootloader on F030x4/6 can only use only USART.To use it, you just need an USB to (TTL, 3.3V) serial andthis ST utility.That said, it's very strange that you cannot connect to the target, NRST is usually not needed.Can you show the OpenOCD log from VisualGDB?

author: ogden
author_rank: Super Contributor
timestamp: September 17, 2018, 09:04:38 am
content: I cannot find NRST pull-up resistor.Anyway if you copied very simple circuit as stm32f030 bluepill and it does not work - then look for difference of both. Bodge your board until it's circuit is IDENTICAL to original, in the way of making your board identical you will find what was wrong.What I am saying - Microcontrollers does not have "bad mood" moments or so. They act very predictable way (if undamaged). It has to beyourerror somewhere.

author: mbless
author_rank: Regular Contributor
timestamp: September 17, 2018, 03:00:12 pm
content: Quote from: ogden on September 17, 2018, 09:04:38 amThere's a ~40k internal pullup