Tests on ST evkits F091RC and L432KC
Posted: Sat Jan 26, 2019 10:29 am
Hi,
A bit newbee with micropython. I was seeking for a small ST micropython compatible MCU to write a piece of software in a simple way (i was a fan of the excellent Chibios but ...). I download a fresh repo and libraries, and compile and test today with genuine STM 32 evboards timer callback and RTC, with exactly the same behaviour (i paste the second set of test).
>>> from pyb import LED
>>> led=LED(1)
>>> led.toggle()
>>> from pyb import Timer
>>> tim = Timer(1, freq=1000)
>>> tim.freq(0.5)
>>> tim.callback( lambda t: pyb.LED(1).toggle())
>>> uncaught exception in Timer(1) interrupt handler
NameError:
>>>
PYB: soft reboot
MicroPython v1.10 on 2019-01-26; NUCLEO-L432KC with STM32L432KC
Type "help()" for more information.
>>> from pyb import RTC
>>> rtc = RTC()
>>> rtc.datetime((2019, 1, 26, 6, 11, 5, 0, 0))
>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>>
Same test on PYBV11 405RG compilation is of course fine and successfully did theses tests.
What's the trick ?
A bit newbee with micropython. I was seeking for a small ST micropython compatible MCU to write a piece of software in a simple way (i was a fan of the excellent Chibios but ...). I download a fresh repo and libraries, and compile and test today with genuine STM 32 evboards timer callback and RTC, with exactly the same behaviour (i paste the second set of test).
>>> from pyb import LED
>>> led=LED(1)
>>> led.toggle()
>>> from pyb import Timer
>>> tim = Timer(1, freq=1000)
>>> tim.freq(0.5)
>>> tim.callback( lambda t: pyb.LED(1).toggle())
>>> uncaught exception in Timer(1) interrupt handler
NameError:
>>>
PYB: soft reboot
MicroPython v1.10 on 2019-01-26; NUCLEO-L432KC with STM32L432KC
Type "help()" for more information.
>>> from pyb import RTC
>>> rtc = RTC()
>>> rtc.datetime((2019, 1, 26, 6, 11, 5, 0, 0))
>>> rtc.datetime()
(2000, 1, 1, 1, 0, 0, 0, 0)
>>>
Same test on PYBV11 405RG compilation is of course fine and successfully did theses tests.
What's the trick ?