stm32l4 port and cmake
stm32l4 port and cmake
Hi all,
Have just started using micropython and very keen to work on a port for the STM32Lxxx series (the low power range for ST). Any ideas about why this would be a bad idea or things to watch out for?
I created a cmake build of the pyboard v11 at https://github.com/stiege/cmake_micropython ; it still uses the makefiles for the code generation parts that relate to the pyboard.
Have just started using micropython and very keen to work on a port for the STM32Lxxx series (the low power range for ST). Any ideas about why this would be a bad idea or things to watch out for?
I created a cmake build of the pyboard v11 at https://github.com/stiege/cmake_micropython ; it still uses the makefiles for the code generation parts that relate to the pyboard.
Re: stm32l4 port and cmake
There is a board definition file for the STM32L476 already in the repository.
The L series have different sized flash blocks. Most of the differences are abstracted by the HAL.
The L series have different sized flash blocks. Most of the differences are abstracted by the HAL.
Re: stm32l4 port and cmake
Oops!
Thanks for pointing that out!
Thanks for pointing that out!
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: stm32l4 port and cmake
I have port micropython to ST's SensorTile kit, it using STM32L476JG mcu.stiege wrote:Hi all,
Have just started using micropython and very keen to work on a port for the STM32Lxxx series (the low power range for ST). Any ideas about why this would be a bad idea or things to watch out for?
I created a cmake build of the pyboard v11 at https://github.com/stiege/cmake_micropython ; it still uses the makefiles for the code generation parts that relate to the pyboard.
Re: stm32l4 port and cmake
Hi @shaoziyang,
I just tried uploading a port to the STM32L476 discovery board that I ordered and it almost seems to work - unfortunately Windows is having a problem with the USB device (Invalid Device Desciptor, Code 43). I can't see immediately why this would have any problems while the pyboard works fine. Your SensorTile port isn't yet in the master branch from what I can see?
I just tried uploading a port to the STM32L476 discovery board that I ordered and it almost seems to work - unfortunately Windows is having a problem with the USB device (Invalid Device Desciptor, Code 43). I can't see immediately why this would have any problems while the pyboard works fine. Your SensorTile port isn't yet in the master branch from what I can see?
Re: stm32l4 port and cmake
I think my issue may be:
I managed to connect via the ST link USB instead. I get a serial port with a REPL at least but no file system access. Also a bit of work for me to do on the port I think...
_______
My issue was not erasing on first flash to force the initialisation of the file system.
https://github.com/micropython/micropython/issues/2852
Unsure though.In order to connect the OTG_FS_VBUS and OTG_FS_ID signals from the connector CN7 to
the OTG FS hardware IP of STM32L476VGT6, remove the LCD from its socket U5, and
close SB24 and SB25.
I managed to connect via the ST link USB instead. I get a serial port with a REPL at least but no file system access. Also a bit of work for me to do on the port I think...
Any attempt at tab completion results in the same.MicroPython v1.8.7 on 2017-02-08; L476-DISCO with STM32L476
Type "help()" for more information.
>>> dir()
[
FATAL ERROR:
HardFault
_______
My issue was not erasing on first flash to force the initialisation of the file system.
https://github.com/micropython/micropython/issues/2852
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: stm32l4 port and cmake
You may find my SensorTile kit port at:stiege wrote:Hi @shaoziyang,
I just tried uploading a port to the STM32L476 discovery board that I ordered and it almost seems to work - unfortunately Windows is having a problem with the USB device (Invalid Device Desciptor, Code 43). I can't see immediately why this would have any problems while the pyboard works fine. Your SensorTile port isn't yet in the master branch from what I can see?
https://github.com/shaoziyang/MicroPyth ... SensorTile
It work fine, and I am working on the sensor in the board now, it almost finished.
Re: stm32l4 port and cmake
Thanks for that.
I still have some problems with the stm32l4 port.
If I use `dfu-util -a 0 -s :mass-erase:force -D firmware.dfu` then I no longer get the dir() hard fault. I can also see that on first boot the LEDs stay on for longer (presumably initialising the file system). Unfortunately though Windows still has problems recognising the filesystem.
If I use the STM32 ST-LINK utility and perform the erase/program this way then there's no problem.
Any ideas on what's going wrong with my dfu-util command?
______
I suspect maybe the mass erase is not working on the MCU, modifying the firmware.dfu objcopy makefile instructions to include "--gap-fill 0xFF --pad-to 0x8004000" (bin0) and "--gap-fill 0xFF --pad-to 0x8100000" (bin1) fixed the issue - albeit takes a lot longer to program now.
I still have some problems with the stm32l4 port.
If I use `dfu-util -a 0 -s :mass-erase:force -D firmware.dfu` then I no longer get the dir() hard fault. I can also see that on first boot the LEDs stay on for longer (presumably initialising the file system). Unfortunately though Windows still has problems recognising the filesystem.
If I use the STM32 ST-LINK utility and perform the erase/program this way then there's no problem.
Any ideas on what's going wrong with my dfu-util command?
______
I suspect maybe the mass erase is not working on the MCU, modifying the firmware.dfu objcopy makefile instructions to include "--gap-fill 0xFF --pad-to 0x8004000" (bin0) and "--gap-fill 0xFF --pad-to 0x8100000" (bin1) fixed the issue - albeit takes a lot longer to program now.
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: stm32l4 port and cmake
dfu-util has bug on STML4 mcu, so you can only using STM32 ST-LINK utility now.stiege wrote:Thanks for that.
I still have some problems with the stm32l4 port.
If I use `dfu-util -a 0 -s :mass-erase:force -D firmware.dfu` then I no longer get the dir() hard fault. I can also see that on first boot the LEDs stay on for longer (presumably initialising the file system). Unfortunately though Windows still has problems recognising the filesystem.
If I use the STM32 ST-LINK utility and perform the erase/program this way then there's no problem.
Any ideas on what's going wrong with my dfu-util command?
______
I suspect maybe the mass erase is not working on the MCU, modifying the firmware.dfu objcopy makefile instructions to include "--gap-fill 0xFF --pad-to 0x8004000" (bin0) and "--gap-fill 0xFF --pad-to 0x8100000" (bin1) fixed the issue - albeit takes a lot longer to program now.
Re: stm32l4 port and cmake
Does pydfu.py work any better? (found in the micropython/tools directory)