Replies: 1 comment 1 reply
-
Very cool that you ported MicroPython to a new platform. And thank you for documenting the process! It may help another traveller in the future :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Big fan of micropython, so for I decided to port it to an 10 year old gadget, just for the fun of it, here are my first-hand impression of how that went.
The platform is a ColdFire CPU, the last iteration of the Motorola 68K family, but it is still a "new" archtecture as far as micropython :-)
Setting up GCC as cross-compiler is old hat, no comments there.
I started from the ports/minimal files.
The first thing I noticed is that there is very little inline-commentary to explain what goes on, and which bits needs fleshing out.
I was lucky, in the sense that the platform has both a debugger and a watchdog, otherwise I would probably not have guessed that I ended up in
nlr_jump_fail()
which by default is just awhile(1){;}
The reason I ended up in
nlr_jump_fail()
was that I needed-malign=int
in CFLAGS to get 32 bit alignment. That is of course something peculiar to the 68K which by default is only 16bit aligned, but it might be a good idea to add a compile-time check to break early if things do not align on 32 bit (using compile-time asserts) because the "diagnostics" from this mistake are very confusing.Once I got ports/minimal running, the obvious thing was to add to it.
A "What to do once ports/minimal runs" section would have been nice :-)
The process was frustrated because ports/minimal/Makefile has
OBJ += $(PY_CORE_O)
instead ofOBJ += $(PY_O)
so nothing from extmod etc. actually gets compiled, until you spot that detail. (Unless there is a good reason, I suggest changing it.)If there is documentation about
MICROPY_CONFIG_ROM_LEVEL
and the many other "inclusion" #defines, I could not find it.What depends on what was sorted out by Prototyping (The development methodology formerly known as Trial&Error.)
I'm still not done and it would be nice to have a table with the various options, their dependencies and a rough estimate of how much space they take up.
Having to configure long-int two places (Makefile & mpconfigport.h) is pointless. Set it as a variable i the Makefile and -D it into mpconfigport.h ?
Trying to use the
longlong
instead ofmpz
caused link errors relating toread_r
,write_r
etc. Never figured that one out and stuck with mpz.Next stumbling block was the GC, which I found particularly under-documented.
It took some hours before I arrived at this gchelper_68k.s:
(Feel free to include it if you want to support retro-computing.)
With that in place, I had a stable port, and have started having fun with it.
Hat-tip to everybody involved!
Beta Was this translation helpful? Give feedback.
All reactions