Anyone port to AArch64?
Anyone port to AArch64?
Hello,
I think I tried to post earlier, but for whatever reason it's not showing up so I'll try again!
Has anyone already ported MicroPython to AArch64? I know a few people are targeting older ARM chips for the RPi1 and 2, but I'm thinking of getting it going on the 3. I'd rather not reinvent the wheel if someone has already done it though!
Thanks a bunch, and just let me know and I'll look into it if needed!
Best,
Jimmy
I think I tried to post earlier, but for whatever reason it's not showing up so I'll try again!
Has anyone already ported MicroPython to AArch64? I know a few people are targeting older ARM chips for the RPi1 and 2, but I'm thinking of getting it going on the 3. I'd rather not reinvent the wheel if someone has already done it though!
Thanks a bunch, and just let me know and I'll look into it if needed!
Best,
Jimmy
Re: Anyone port to AArch64?
Since you can run a 32-bit executable on 64-bit hardware, what advantage is there in compiling it as 64-bit?jlipham wrote: ↑Tue Aug 14, 2018 3:57 pmHello,
I think I tried to post earlier, but for whatever reason it's not showing up so I'll try again!
Has anyone already ported MicroPython to AArch64? I know a few people are targeting older ARM chips for the RPi1 and 2, but I'm thinking of getting it going on the 3. I'd rather not reinvent the wheel if someone has already done it though!
Thanks a bunch, and just let me know and I'll look into it if needed!
Best,
Jimmy
Re: Anyone port to AArch64?
[quote=jickster post_id=29352 time=1534270464 user_id=3167]
Since you can run a 32-bit executable on 64-bit hardware, what advantage is there in compiling it as 64-bit?
[/quote]
The thought is that if I'm running it on the bare metal, it'll make a difference as well as run properly under QEMU Raspi3 AArch64 emulation if needed.
Since you can run a 32-bit executable on 64-bit hardware, what advantage is there in compiling it as 64-bit?
[/quote]
The thought is that if I'm running it on the bare metal, it'll make a difference as well as run properly under QEMU Raspi3 AArch64 emulation if needed.
Re: Anyone port to AArch64?
Not that I've found. Hence I intend to create one or port an existing one over. From what I've found, QEMU gets a bit squirrelly when you're trying to emulate AArch64 (using the -M raspi3 setting) with a 32 bit kernel file.
Re: Anyone port to AArch64?
To port to 64-bit, there's two categories of stuff you need to consider: core micropython and C-modules you've added.
CORE MICROPYTHON - define mp_int_t, mp_uint_t as 64-bit
https://github.com/micropython/micropyt ... er+size%22
For 64-bit, you'd change them to be the 64-bit versions int64_t and uint64_t
CORE MICROPYTHON - choose correct object model from mpconfig.h
You cannot choose REPR C because that's only 32-bit but you can choose any of the other 3.
OTHER CODE
Once you've configured "CORE MICROPYTHON", only thing left is any C-modules you've added.
What about the C-modules that come with micropython? Well I'm assuming the stuff that's checked-in is written to properly take advantage of 64-bit in case it is thus configured.
CORE MICROPYTHON - define mp_int_t, mp_uint_t as 64-bit
https://github.com/micropython/micropyt ... er+size%22
Code: Select all
typedef int32_t mp_int_t; // must be pointer size
typedef uint32_t mp_uint_t; // must be pointer size
CORE MICROPYTHON - choose correct object model from mpconfig.h
You cannot choose REPR C because that's only 32-bit but you can choose any of the other 3.
OTHER CODE
Once you've configured "CORE MICROPYTHON", only thing left is any C-modules you've added.
What about the C-modules that come with micropython? Well I'm assuming the stuff that's checked-in is written to properly take advantage of 64-bit in case it is thus configured.
Re: Anyone port to AArch64?
Referring to my post viewtopic.php?p=29374#p29379 the only CODE you'd need to change is that for the peripherals: SPI, ADC, etc.
Re: Anyone port to AArch64?
Hey jickster
Thanks for your expert advice! After a bit of tinkering, I've got the REPL showing up over UART on a Raspberry Pi 3 (AArch64) under QEMU. It also runs on hardware. Now I've got to diagnose a few issues with UART input, but that shouldn't be bad at all, then I'm off to get the framebuffer running.
Again, thanks!
Thanks for your expert advice! After a bit of tinkering, I've got the REPL showing up over UART on a Raspberry Pi 3 (AArch64) under QEMU. It also runs on hardware. Now I've got to diagnose a few issues with UART input, but that shouldn't be bad at all, then I'm off to get the framebuffer running.
Again, thanks!
Re: Anyone port to AArch64?
I’m definitely not the expert but I think this issue is not that complicated.jlipham wrote:Hey jickster
Thanks for your expert advice! After a bit of tinkering, I've got the REPL showing up over UART on a Raspberry Pi 3 (AArch64) under QEMU. It also runs on hardware. Now I've got to diagnose a few issues with UART input, but that shouldn't be bad at all, then I'm off to get the framebuffer running.
Again, thanks!
Always happy to help when I can.