Page 1 of 1

[STM32f407] Cannot program chip on self designed PCB

Posted: Wed Apr 17, 2019 5:53 pm
by lei29
We have some problem of programing the STM chip on our self-designed pcb. This is the first time I posted on this forum, if any info is not clear please let me know and hope could get some help here.

We are a team of students doing senior design, and we were using micropython on STM32f4 discovery board, and it worked perfectly fine.

So we designed our pcb and tried to solder everything on it and burn our program on the processor by using STlink-v2. But we got some problems that although the STM32F407 chip was found and was connected, we found hard time program our hex file on it. So I wonder that could micropython work on STM32F407 chip on self-designed pcb? And if the answer is yes, which step did we miss and what is the correct way to do it.

Thanks for anyone's help.

Re: [STM32f407] Cannot program chip on self designed PCB

Posted: Wed Apr 17, 2019 6:27 pm
by dhylands
My brother and I have designed boards and gotten then to work.

If you have access to the FS USB and your Crystal and load capacitors work then you don't need stlink. You can program via DFU.

Failing that, there are done other ways of bootloading using the built-in boot loader.

We won't up having to be serial bootloading on one of our boards because the Crystal wasn't wired up properly. I wrote a blog post about it here: http://blog.davehylands.com/serial-bootloading-stm32f4/

This document https://www.st.com/content/ccc/resource ... 167594.pdf covers the details of the built-in bootloader.

Probably the single most important thing to setup is to make sure you have the HSE setup to match whatever Crystal you're using.

Re: [STM32f407] Cannot program chip on self designed PCB

Posted: Wed Apr 17, 2019 9:50 pm
by OutoftheBOTS_
I mainly ST-Link to program STM23 boards.

If your using a cheap clone of ST-Link then you will find the hardware reset line isn't connected although it is broken out so ensure when your flashing program that you use software reset instead of hardware reset and this fixed the problems that I had with flashing to STM32.

Re: [STM32f407] Cannot program chip on self designed PCB

Posted: Fri Apr 19, 2019 4:51 pm
by lei29
Thank you so much for your reply!
I guess the correct question would be is there a way to pre-load our main.py file into the flash file (.hex file) so we can flash it all together using ST-Link?
Thank you!

Re: [STM32f407] Cannot program chip on self designed PCB

Posted: Sat Apr 20, 2019 2:20 am
by dhylands
This topic shows once way to do it, but it requires a board to populate the main.py in the first place.
viewtopic.php?f=3&t=5877

You could also modify main.c and change the default main.py that's generated.