Hello,
I am Huy. Currently I am working on a project. I am trying to run MicroPython on STM32L4R9I - Disco.
As I did some researches, MicroPython doesnt not support STM32L4R9I - Disco. So i want to ask is there any solution for this issue??? one of the approaches i found was to build custom firmware for the board.
Thank you very much!!!
[Solved]Build firmware for MicroPython
[Solved]Build firmware for MicroPython
Last edited by ndhuy on Thu Dec 05, 2019 1:32 am, edited 1 time in total.
Re: Build firmware for MicroPython
Hi,
I don't know much about the L4+ family, but MicroPython does support the L4, and ST says "Applications developed for the earlier STM32L4 microcontrollers can run unchanged on the new devices", so hopefully it's not too much work.
That said, I don't see any mention of the STM32L4RAI series in the L4 HAL (which is part of the stm32lib submodule), so I think it would need to be updated first (it's on 1.8.1, the latest version is 1.14.0). https://github.com/micropython/stm32lib
Once that's done, the starting point is to create a board definition, which is a directory in ports/stm32/BOARDS, and set up mpconfigboard.h, mpconfigboard.mk, pins.csv and stm32l4xx_hal_conf.h. Start with one of the existing L4 boards as an example.
You'll likely need a linker script too, which you reference from mpconfigboard.mk.
It would probably help to have an existing STM32 board that has MicroPython support just so you can get familiar with things on a working board first.
I don't know much about the L4+ family, but MicroPython does support the L4, and ST says "Applications developed for the earlier STM32L4 microcontrollers can run unchanged on the new devices", so hopefully it's not too much work.
That said, I don't see any mention of the STM32L4RAI series in the L4 HAL (which is part of the stm32lib submodule), so I think it would need to be updated first (it's on 1.8.1, the latest version is 1.14.0). https://github.com/micropython/stm32lib
Once that's done, the starting point is to create a board definition, which is a directory in ports/stm32/BOARDS, and set up mpconfigboard.h, mpconfigboard.mk, pins.csv and stm32l4xx_hal_conf.h. Start with one of the existing L4 boards as an example.
You'll likely need a linker script too, which you reference from mpconfigboard.mk.
It would probably help to have an existing STM32 board that has MicroPython support just so you can get familiar with things on a working board first.
Re: Build firmware for MicroPython
thank you very much for you response. I will give it a try and update as soon as possiblejimmo wrote: ↑Mon Nov 04, 2019 10:13 amHi,
I don't know much about the L4+ family, but MicroPython does support the L4, and ST says "Applications developed for the earlier STM32L4 microcontrollers can run unchanged on the new devices", so hopefully it's not too much work.
That said, I don't see any mention of the STM32L4RAI series in the L4 HAL (which is part of the stm32lib submodule), so I think it would need to be updated first (it's on 1.8.1, the latest version is 1.14.0). https://github.com/micropython/stm32lib
Once that's done, the starting point is to create a board definition, which is a directory in ports/stm32/BOARDS, and set up mpconfigboard.h, mpconfigboard.mk, pins.csv and stm32l4xx_hal_conf.h. Start with one of the existing L4 boards as an example.
You'll likely need a linker script too, which you reference from mpconfigboard.mk.
It would probably help to have an existing STM32 board that has MicroPython support just so you can get familiar with things on a working board first.
Re: Build firmware for MicroPython
Hi Jimmo,jimmo wrote: ↑Mon Nov 04, 2019 10:13 amHi,
I don't know much about the L4+ family, but MicroPython does support the L4, and ST says "Applications developed for the earlier STM32L4 microcontrollers can run unchanged on the new devices", so hopefully it's not too much work.
That said, I don't see any mention of the STM32L4RAI series in the L4 HAL (which is part of the stm32lib submodule), so I think it would need to be updated first (it's on 1.8.1, the latest version is 1.14.0). https://github.com/micropython/stm32lib
Once that's done, the starting point is to create a board definition, which is a directory in ports/stm32/BOARDS, and set up mpconfigboard.h, mpconfigboard.mk, pins.csv and stm32l4xx_hal_conf.h. Start with one of the existing L4 boards as an example.
You'll likely need a linker script too, which you reference from mpconfigboard.mk.
It would probably help to have an existing STM32 board that has MicroPython support just so you can get familiar with things on a working board first.
It's me again. i did exactly what you said:
- Update the Hal library to 1.14 version.
- Rewrite 4 file for the new board based on the structure of the similar board 32l496 and the datasheet of 32l4r9i: mpconfigboard.h, mpconfigboard.mk, pins.csv, and stm32l4+xx_hal_conf.h
- I also write linker file in boards folder.
The first time i ran "make BOARD=STM32L4R9IDISC", it displayed an error:no rule to make target 'build-STM32L4R9IDISC/modstm_qstr.h' (build-STM32L4R9IDISC is a folder after the line "make BOARD=STM32L4R9IDISC"), needed by 'build-STM32L4R9IDISC/genhdr/qstrdefs.generated.h'. I fixed this error by copying the modstm_qstr.h file from "build-STM32L496G", a similar board belong to L4 series to STM32L4R9.
Now i am handling the error "file:boards/STM32L4R9IDISC/stm32l4+xx_hal_conf.h does not contain a definition of HSE_VALUE. It confused me because I clearly define the HSE_VALUE already in that file.
Now I am trying to fix that.