nucleo F401RE cannot import name Servo

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
chipxx
Posts: 14
Joined: Mon Oct 21, 2019 8:55 am

nucleo F401RE cannot import name Servo

Post by chipxx » Thu Oct 31, 2019 9:06 am

Hello everyone, I have a stm32 F401RE and I installed the firmware Micropython, at least I hope I did .:).Using putty I observed that some modules of pyb are unknown to him . Most of the modules see them, but it gives me error on pin named X1.Any idea?
Even using Thonny same problem.
I attach putty jpeg connected with the card.
Thank you
chipxx


ps
I installed the firmware with St-link but did not use the jumper on 5V and boot the card. I am new to this card.
The firmware downloaded from the Microputhon site is as follows:
NUCLEO-F401RE board : NUCLEO_F401RE-20190529-v1.11.dfu
then, I extracted the .hex file
Attachments
1.jpg
1.jpg (28.89 KiB) Viewed 4504 times
2.jpg
2.jpg (39 KiB) Viewed 4504 times
3.jpg
3.jpg (41.79 KiB) Viewed 4504 times

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: nucleo F401RE cannot import name Servo

Post by shaoziyang » Thu Oct 31, 2019 1:27 pm

nucleo F401RE firmware doesn't enable servo default, you can enable it by add

#define MICROPY_HW_ENABLE_SERVO (1)

to mpconfigboard.h and recompile source code.

chipxx
Posts: 14
Joined: Mon Oct 21, 2019 8:55 am

Re: nucleo F401RE cannot import name Servo

Post by chipxx » Thu Oct 31, 2019 4:13 pm

Thanks for the answer, but it's too complicated for me.
chippx

chipxx
Posts: 14
Joined: Mon Oct 21, 2019 8:55 am

Re: nucleo F401RE cannot import name Servo

Post by chipxx » Sun Nov 03, 2019 9:59 am

Hello everyone, I'm trying to recompile micropython-master because I would like to add the Servo library that on my F401RE with micropython 1.11 is not implemented. Under shaoziyang's suggestion
I modified the mpconfigboard.h file related to my card joining:

Code: Select all

#define MICROPY_HW_ENABLE_SERVO (1).
Now I have loaded everything in Eclipse, with the toolchain, but I did not understand if I have to recompile everything or just some sources.
Thanks
chippx

seems easy...
Attachments
Eclipse- Micropython-master.png
Eclipse- Micropython-master.png (214.05 KiB) Viewed 4441 times

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

Re: nucleo F401RE cannot import name Servo

Post by jimmo » Mon Nov 04, 2019 12:09 am

Hi,

Unfortunately MicroPython is not an Eclipse project. You can edit the files and browse the project in Eclipse of course, but the way to build the STM32 firmware is via arm-none-eabi-gcc and the Makefiles.

The instructions are here: https://github.com/micropython/micropyt ... /README.md

Unfortunately I don't know much about how to do this from Windows... hopefully someone else can chime in. You should just need git, arm-none-eabi-gcc and a way to run the Makefile... perhaps cygwin? Unlike other platforms (like ESP32), the STM32 port has no other dependencies. Try searching this forum, I'm sure other people have done it.

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: nucleo F401RE cannot import name Servo

Post by chrismas9 » Mon Nov 04, 2019 5:26 am

The easiest way to build MicroPython is to load Ubuntu from the Microsoft Store. Type bash in the search box to launch a Ubuntu bash shell using WSL (Windows subsystem for Linux). Then follow the MicroPython readme for building under Ubuntu.

I use Tortoise Git and a Windows programmer's editor to manage files on a Windows drive and mount that drive in the shell (eg cd /mnt/c/mypath). Make sure editor handles Linux line endings (eg Notepad++).

You can build under Eclipse if you install MSYS 2 and the toolchain. Then import a makefile project instead of building an Eclipse project.

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

Re: nucleo F401RE cannot import name Servo

Post by OutoftheBOTS_ » Mon Nov 04, 2019 6:38 am

chrismas9 wrote:
Mon Nov 04, 2019 5:26 am
You can build under Eclipse if you install MSYS 2 and the toolchain. Then import a makefile project instead of building an Eclipse project.
I originally started building STM32 projects like this but found it easier to use "system workbench". System workbench is basically a modified version of eclipse with all the needed tools for building STM32 projects and is maintained by the STM32 community

chipxx
Posts: 14
Joined: Mon Oct 21, 2019 8:55 am

Re: nucleo F401RE cannot import name Servo

Post by chipxx » Mon Nov 04, 2019 6:27 pm

Guys thanks for the support but I solved it by buying a STM32F405 PyBoard Clone.
I have to enjoy programming not being a scientist... :lol:
:)
chipxx

Post Reply