Page 1 of 1

STM32F4 Discovery

Posted: Wed Aug 08, 2018 9:42 am
by ales.coppelli
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

Re: STM32F4 Discovery

Posted: Thu Aug 09, 2018 6:04 am
by shaoziyang
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.

Re: STM32F4 Discovery

Posted: Thu Aug 09, 2018 9:59 pm
by ales.coppelli
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) ) .