WSL and Docker
- Using docker to start a container
- Cloning a demo repository
- Compiling an application as armhf
- Running the app on device
- Setup WSL2 and Docker Click here: Setup WSL2 and Docker
-
Open WSL2 Terminal: Open your installed Linux distribution from the Start menu (or right click in a directory and click "Open in terminal")
-
Change Directory to Home:
cd ~
-
Clone the Union Miyoo Mini Toolchain Repository:
git clone https://github.com/shauninman/union-miyoomini-toolchain.git
-
Navigate to the Directory:
cd union-miyoomini-toolchain
-
Build and Run the Docker Environment:
make shell
-
Clone the Project Repository:
git clone https://github.com/XK9274/hello-miyoo-c.git
-
Navigate to the Project Directory:
cd hello-miyoo-c
- Build the Project:
make
root@29fa0688544a:~/workspace/hello_world# make
/opt/miyoomini-toolchain/usr/bin/arm-linux-gnueabihf-gcc main.c -o hellomiyoo -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve
root@29fa0688544a:~/workspace/hello_world#
Let's check that we actually did crosscompile the binary to armhf!
root@29fa0688544a:~/workspace/hello_world# file ./hellomiyoo
./hellomiyoo: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
root@29fa0688544a:~/workspace/hello_world#
root@29fa0688544a:~/workspace/hello_world# Great!
We need to get the file over to the Miyoo now! You can either pull the SDCARD or:
- Copying the Built Project to Your Device:
Use your weapon of choice for getting the file onto the device, some options here are:
- Browse to the location you added the binary to the device using Telnet or SSH and run it!
For example; I've added the hello-miyoo file to the SDCARD root:
/mnt/SDCARD # ./hellomiyoo
Hello!
Congratulations!!
Current date and time: 2024-05-22 20:20:09
Screen width: 640, Screen height: 480
/mnt/SDCARD #
Or, through the Simple Terminal app:
Success!