micropython on STM32F417

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

micropython on STM32F417

Post by Firas_Baccouri » Fri Jun 10, 2022 7:55 am

Hello guys ,

I need to let micropython running on an STM32F417 controller so I have taked the files of the discovery board ("mpconfigboard.h"," mpconfigboard.mk","pins.csv","staccel.py","stm32f4xx_hal_conf.h" and "board.json" ) I made changes in "mpconfigboard.h" and stm32f4xx_hal_conf.h" to fix the right clock for my controller and I think this is the only change that I need to make , unfortunately I didn´t get the micropython running on my controller .
So I have started debugging and I checked if the micropython firmware is running or not so I have injected some C code into the "main.c" to toggle some PINS and it went well so it´s obvious that the firmware is working , so I go to the second debugging step to check if the HSE clock is setted correctly (to get the USB communication) and I figured out that it was OK . So I was stuck in that point and don´t know what is wrong and how should I proceed to get the micropython running on my controller .

I would be very grateful if you help me on that with any information or hints .
Thank you in advance .

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: micropython on STM32F417

Post by jimmo » Mon Jun 20, 2022 5:39 am

Firas_Baccouri wrote:
Fri Jun 10, 2022 7:55 am
I need to let micropython running on an STM32F417 controller
Which board is the MCU on? Does it have SWD headers? Hooking up GDB would be my next step.

I assume you also changed it to use F417 (not F407) and updated the linker file to match the memory layout?

Firas_Baccouri
Posts: 35
Joined: Wed Apr 27, 2022 7:22 am

Re: micropython on STM32F417

Post by Firas_Baccouri » Mon Jun 20, 2022 10:34 am

Thank you for your reply .
I have checked the datasheets of the two controller and they seems have the same register mapping and the same memory layout , the only difference is that the F417 supports crypto , so that´s why I didn´t work on changing the linker file .
Actually the problem is resolved now and I am running micropython on my customer board , the problem was the use of the USB_Detect_Pin and the I USB_ID_PIN while they are not available in my PCB .

Post Reply