Trying to understand cross compilation in ubuntu and execution in luckfox pico RV1103
Posted: 2025-12-07 18:39
Team luckfox,
I want to understand how this thing works, specially cross compilation. As I was more familiar with Rasp OS which had its own compilation.
Due to size we need to compile in virutal OS Ubuntu 22.04.5 LTS. Download luckfox SDK and then use it to compile apps.
I usually used direct gcc to compile my c codes. Please check below if my process is correct.
For example in luckfox I did this.
I create 2 files compile.sh and test.c, inside folder home/pico/luckfox-pico/project/app/mycodes/
In compiler.sh below is following script/
and in test.c below is following code.
Once this is created, i open my terminal in that folder and do sudo ./compile.sh.
This compiles the file and creates test executable. Which doesnt execute in ubuntu virtual OS as m using rockchip suggested compiler.
I copy this file via winscp to luckfox pico mini B.
I go to putty and try executing it with following command in that folder.
sudo ./test
output is "unable to execute ./test: No such file or directory"
Please let me know what I'm doing wrong and why simple code is not working.
Regards,
Macjan
I want to understand how this thing works, specially cross compilation. As I was more familiar with Rasp OS which had its own compilation.
Due to size we need to compile in virutal OS Ubuntu 22.04.5 LTS. Download luckfox SDK and then use it to compile apps.
I usually used direct gcc to compile my c codes. Please check below if my process is correct.
For example in luckfox I did this.
I create 2 files compile.sh and test.c, inside folder home/pico/luckfox-pico/project/app/mycodes/
In compiler.sh below is following script/
Code: Select all
#!/bin/bash
export compiler="/home/pico/luckfox-pico/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc"
$compiler -mcpu=cortex-a7 -mfpu=vfpv4 test.c -o test
#gcc test.c -o test
chmod +x testCode: Select all
#include <stdio.h>
int main(void){
printf("Hello this is luckfox test\r\n");
return 0;
}This compiles the file and creates test executable. Which doesnt execute in ubuntu virtual OS as m using rockchip suggested compiler.
I copy this file via winscp to luckfox pico mini B.
I go to putty and try executing it with following command in that folder.
sudo ./test
output is "unable to execute ./test: No such file or directory"
Please let me know what I'm doing wrong and why simple code is not working.
Regards,
Macjan