STM32F4 Discovery

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
ales.coppelli
Posts: 5
Joined: Wed Aug 08, 2018 9:15 am

STM32F4 Discovery

Post by ales.coppelli » Wed Aug 08, 2018 9:42 am

Hi to all.

I have installed MiicroPython( v1.9.4-442-g17b5120) on STM32F4 Discovery board ( STM32F407 VGT6 ) .
I can see many class from 'help(pyb)' command ( rng,Switch,Flash, Led, I2C,SPI,UART,ADC,DAC,ecc .ecc. ) but I don't see 'Servo' and 'Accel' class.
Indeed if I try:
>>>from pyb import Servo ( or Accel )
I obtain ImportError.

Someone can help me ?

Thanks

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

Re: STM32F4 Discovery

Post by shaoziyang » Thu Aug 09, 2018 6:04 am

STM32F4 Discovery using different accelerometer sensor, not same as pyboard. You may try import STAccel.

And STM32F4 Discovery also not enable servo module. If you need it, you must modify mpconfigboard.h and add #define MICROPY_HW_ENABLE_SERVO (1), then rebuild source.

ales.coppelli
Posts: 5
Joined: Wed Aug 08, 2018 9:15 am

Re: STM32F4 Discovery

Post by ales.coppelli » Thu Aug 09, 2018 9:59 pm

Thank you very much. I rebuild the firmware.dfu with the #define row after I had modified mpconfigboard.h ( and uploaded the new version of micropython into the board) .Now there is the Servo class ( when I ask >>>help(pyb) ) . I saw in micropython/ports/stm32/boards/STM32F4DISC/staccell.py file and I copied it in "boot.py" file ( PYBFLASH ). I'll try to use the accelerometer tomorrow ( there isn't STAccell class in the list of the command help(pyb) ) .

Post Reply