Trying to understand cross compilation in ubuntu and execution in luckfox pico RV1103

  • Hello, regarding cross-compilation, the main approach we recommend is by setting environment variables or writing a Makefile. These two methods are actually quite similar. We also have detailed tutorials on our wiki that you can refer to.https://wiki.luckfox.com/Luckfox-Pico-P ... s-Compile/
  • yangxj121 wrote: 2025-12-08 9:53 Hello, regarding cross-compilation, the main approach we recommend is by setting environment variables or writing a Makefile. These two methods are actually quite similar. We also have detailed tutorials on our wiki that you can refer to.https://wiki.luckfox.com/Luckfox-Pico-P ... s-Compile/
    Sir,

    The approach you recommended I tried. I Downloaded the gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.gz, unziped. And prepared this new script below:

    Code: Select all

    #!/bin/bash
    
    export mycompiler="/home/pico/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc"
    
    $mycompiler test.c -o test
    
    chmod +x test
    
    With this change my code started working.
    Screenshot 2025-12-10 231539.png
    Is there any restrictions with this method to complete firmware programming? Well I wanted to write my entire firmware with this method.
    For example reading and writing gpio's updating logs in files and so on. Because I do not want to interfere with root files of luckfox besides startup init.d

    Regards,

    Macjan
  • Hello, you need to know that cross-compilation is the toolchain of the SDK. Therefore, the path specified for cross-compilation is the cross-compiler located within the SDK. We also highly recommend generating the required firmware through SDK compilation, and then generating the application through cross-compilation. This development method is not only convenient but also effectively solves dependency issues. Additionally, I see that the development board you are using is Ubuntu. Currently, we only provide Ubuntu images and no longer maintain them. If you want a good development environment, it is recommended to use Buildroot. The final compiled SDK system is also the Buildroot system.