baremetal via Zig on PinePhone - JumpDrive help please
#1
background:  2 years ago, I was following along with @lupyuen  great series of articles to get LVGL running on PinePhone.  I was emulating the same journey but using Zig for all the hardware interfacing (and I got quite far).  But at the time I was stuck on an old version of Zig and lost motivation.  Now I finally have some hardware to run latest Zig, and I decided to port my project over to Zig 0.14 including it's new build system.

I've struggled for a few days to recreate the environment I had running (I also switched from macos to to Linux and still learning!).  So I decided to go back to basics, and try to understand how NuttX interects with the JumpDrive image.

This is what I tried:

1. compiling some very simple Zig code, that should toggle the phone LEDs.
2. build the above as an elf file for arm freestanding with a target of cortex_a53
3. created a simple .ld linker file that ensure my entry point is at 0x40080000
4. using objCopy extract hex via the -O binary
5. gzip the resulting binary file into Image.gz

I was expecting that whatever the JumpDrive util does, it somehow jumps to executing the code directly from Image.gz.  However now I suspect that this .gz might be a bit more complicated than straight arm machine code.  But I have no idea what? and I struggle to follow the NuttX build (maybe something to do with a util called binfmt? but also I saw mention of nxflat).

Ultimately it would be nice to find a way to deploy to PinePhone as 'baremetal'.  But for now the JumpDrive 'hack' would be enough, allowing me to hop between SDCards to compare/debug different images.

Does anyone have any idea how to wrap my baremetal code into something JumpDrive can recognize from the Image.gz file please.
  Reply


Messages In This Thread
baremetal via Zig on PinePhone - JumpDrive help please - by WhiteHexagon - 07-01-2025, 05:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Latest firmware for PinePhone modem! Subsentient 106 215,631 04-03-2026, 08:37 AM
Last Post: baptx
  Fedora + Phosh for PinePhone njha 77 207,993 01-14-2026, 12:22 AM
Last Post: tllim
  8/24 status of JumpDrive shengchieh 5 3,051 11-18-2025, 01:27 PM
Last Post: biketool
  Difficulty with openSUSE Tumbleweed Install PinePhone Beta danm1988 0 468 11-17-2025, 07:49 AM
Last Post: danm1988
  Movuan distribution for PinePhone merom 5 5,553 07-27-2025, 05:01 PM
Last Post: merom
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 40 59,529 12-28-2024, 12:19 AM
Last Post: mara
  Office applications for the Pinephone Peter Gamma 2 4,770 09-05-2024, 09:22 AM
Last Post: Peter Gamma
  Struggle to install LibreOffice on the PinePhone Peter Gamma 50 66,815 07-26-2024, 10:35 PM
Last Post: Peter Gamma
  Why does Pine64 sabotage office on the Pinephone? Peter Gamma 5 6,287 07-04-2024, 07:34 AM
Last Post: Kevin Kofler
  Which word processor to choose for the Pinephone? Peter Gamma 16 17,345 06-22-2024, 07:28 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 1 Guest(s)