I supported the LimiFrog Kickstarter a while ago:
https://www.kickstarter.com/projects/76 ... ot-and-muc
http://www.limifrog.io/
http://forum.micropython.org/viewtopic.php?f=12&t=913
As Xavier, who runs this project, ask for help porting Micropython to this HW, I answered him, that I'll have a look at it.
As the HW is not yet available (coming end of February) I use a STM32L476 Discovery kit for development in a first step:
http://www.st.com/web/en/catalog/tools/PF261635
As this projects uses an other MCU Series of STM (STM32F4->STM32L4) which is optimized for low power consumption, there is a difference in the periphery of the Cortex M4. To port the application code (STM32F4->STM32L4) STM wrote an Application note (DM00144612):
http://www.st.com/st-web-ui/static/acti ... pe=keyword
so there will be some effort for porting the SW to this new platform (see Table 4 of the mentioned document). For example the dma/I2C/Flash is not compatible between the two series of MCU HAL.
(STMicro produced as well a youtube video (mainly for PR purpose which shows no problem, but mentions what must be changed):
https://www.youtube.com/watch?v=YU4jivUZJm8)
For the port, I propose following proceeding:
- Introduce "l4" Hal in
Code: Select all
stmhal/hal/
- Add board support files in
Code: Select all
stmhal/boards/STM32L476DISC
- Add processor descriptions in
Code: Select all
stmhal/cmsis/devinc
- Added linkerscript and alternate function pin definitions for STM32L476 in
Code: Select all
stmhal/boards
- Adapt code in to match the difference in HAL access as mentioned above.
Code: Select all
stmhal
- Add board support files for LimiFrog in when there is HW available.
Code: Select all
stmhal/boards/LIMIFROG
Step 5 needs some work (Who else is interested in supporting?).
For the support of the L4 series I see different ways to go:
- Rename code files in stmhal to MCU specific name (eg. dma.c - dmaf4.c) and modify makefile to include the MCU series specific code. The cons is that there will be duplicated code in the two dma??.c files which I dislike!
- Working with #defines in the existing code (eg. dma.c) which will not look nice in the source, but is maybe a quick solution. But this code must later be refactored as described in the next point.
- Refactor related code (eg. dma.c) to MCU series specific code (eg. dmaf/l4.c) and common code (eg. dma.c) and make an abstract interface to the other modules. (probably the best solution but probably needs more involvement of core developers)
I am setting up this topic to get guidelines/ideas (beside the general ones at https://github.com/micropython/micropyt ... Guidelines) how this new series code should be introduced into the micropython repo. I am looking forward to get some feedback. Further I would like to collect the information of that port in this thread.