[STM32f407] Cannot program chip on self designed PCB

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
lei29
Posts: 2
Joined: Wed Apr 17, 2019 5:34 pm

[STM32f407] Cannot program chip on self designed PCB

Post by lei29 » Wed Apr 17, 2019 5:53 pm

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.

User avatar
dhylands
Posts: 3211
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

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

Post by dhylands » Wed Apr 17, 2019 6:27 pm

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.

OutoftheBOTS_
Posts: 640
Joined: Mon Nov 20, 2017 10:18 am

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

Post by OutoftheBOTS_ » Wed Apr 17, 2019 9:50 pm

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.

lei29
Posts: 2
Joined: Wed Apr 17, 2019 5:34 pm

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

Post by lei29 » Fri Apr 19, 2019 4:51 pm

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!

User avatar
dhylands
Posts: 3211
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

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

Post by dhylands » Sat Apr 20, 2019 2:20 am

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.

Post Reply