Reduced MicroPython
Reduced MicroPython
Hello everyone,
In my try to understand MicroPython(is an still ongoing process ) i reduced the whole MicroPython project to the minium. Only Repl running over UART (no USB driver, leds, pins, spi, i2c,...) on the pyBoard.
For me it's the best starting point to port MicroPython to another target.
Does that make someone else?
Or it needs someone?
In my try to understand MicroPython(is an still ongoing process ) i reduced the whole MicroPython project to the minium. Only Repl running over UART (no USB driver, leds, pins, spi, i2c,...) on the pyBoard.
For me it's the best starting point to port MicroPython to another target.
Does that make someone else?
Or it needs someone?
Re: Reduced MicroPython
Yep - that's the approach I would take as well.
I tend to start with the "full" featured micropython and comment out stuff to strip it down. You could also start with the minimal vesion (in the minimal directory) and flesh it out. Which way you go depends on which you think your final version will be closest to.
I generally do things in this order:
1 - flash a LED
2 - get HW UART working and then the REPL running on UART
3 - work on additional peripherals
I tend to start with the "full" featured micropython and comment out stuff to strip it down. You could also start with the minimal vesion (in the minimal directory) and flesh it out. Which way you go depends on which you think your final version will be closest to.
I generally do things in this order:
1 - flash a LED
2 - get HW UART working and then the REPL running on UART
3 - work on additional peripherals
Re: Reduced MicroPython
The strip down method was better for me. Yielded faster results.
My reduced MicroPython:
- /tools
- /extmod
- /lib
- /py
- /stmhal
Can I reduce the project even further? If so, which files?
Or must I now look for source code I can comment out?
My reduced MicroPython:
- /tools
- /extmod
- /lib
- /py
- /stmhal
- * bufhelper
* extint
* gccollect
* gchelpers.s
* irq
* main
* Makefile
* make-stmconst.py
* modpyb
* modstm
* modstmconst.gen.c
* moduselect
* mpconfigport.h/.mk
* mphal
* pendsv
* portmodules.h
* printf
* pybioctl
* pyexe
* qstrdefsport
* startup_stm32f4xx.s
* stm32f4xx_it
* system_stm32f4xx.c
* uart
Can I reduce the project even further? If so, which files?
Or must I now look for source code I can comment out?
Re: Reduced MicroPython
You can configure on and off quite a few things using the mpconfigport.h/mpconfigboard.h files, and override settings in the py/mpconfig.py file.
But without knowing why you're trying to cut stuff and what your final objectives are, it's hard to say. For example, you can disable floating point support, but you haven't said whether that's important or not.
But without knowing why you're trying to cut stuff and what your final objectives are, it's hard to say. For example, you can disable floating point support, but you haven't said whether that's important or not.
Re: Reduced MicroPython
I want at the end micro python which consists only of the UART repl and the necessary files for Python.
Ok thanks for the tip. Let's see how much I can still reduce to nothing more goes
Ok thanks for the tip. Let's see how much I can still reduce to nothing more goes
Re: Reduced MicroPython
MicroPython provides minimal-configuration port - literally, "minimal", as described in README: https://github.com/micropython/micropython .
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Reduced MicroPython
I just built minimal for ARM (make CROSS=1) and it compiled to about 78K of flash. The 32-bit x86 version was 142K.
Re: Reduced MicroPython
Thanks for the information,
I think the minimal its at my knowledge base not the right way to port micropython. It's to raw for me. I prefer to change existing code as write new.
I try it with my reduced version and when i don't make progress I try it with the minimal.
I think the minimal its at my knowledge base not the right way to port micropython. It's to raw for me. I prefer to change existing code as write new.
I try it with my reduced version and when i don't make progress I try it with the minimal.
Re: Reduced MicroPython
Hmmm, strange, because in the previous message you wrote:
And that's exactly what minimal has always been. But nevermind.I want at the end micro python which consists only of the UART repl and the necessary files for Python.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Reduced MicroPython
pfalcon is right!!
After many attempts, it makes no sense to use a reduced stmhal for porting. To much that needs to be adapted and many sources of errors.
minimal is the best way.
The thread can be deleted!!
After many attempts, it makes no sense to use a reduced stmhal for porting. To much that needs to be adapted and many sources of errors.
minimal is the best way.
The thread can be deleted!!