Pico C example execution issues ...

  • Hello, ubuntu and buildroot are based on different cross-compilation tools. The SDK only provides the uclibc compilation tool used by buildroot, while ubuntu system needs to use the glibc cross-compilation tool. We tested using https://snapshots.linaro.org/gnu-toolch ... gnueabihf/. Most of the instructions in the WIKI are based on the buildroot system
  • Thank you for the quick response !

    This was my first post, so the approval took some time, it seems.
    In the meantime, I had flashed another SD card with a buildroot image, and tried the examples there.
    And they work fine so far.

    But I like the Ubuntu environment more, so I will definitely check out the linaro toolchain link.
  • I downloaded the linaro toolchain, and set it up more or less successfully.
    A build still fails because the correct sysroot environment is missing.
    The linaro toolchain certainly does not come with the proper Luckfox Pico environment, so it doesn't even find the C includes.
    The SDK sysroot (for buildroot/uclib) doesn't match either, linking fails, understandably:
    > ../aarch64-linux-gnu/bin/ld: /home/fm/tools/lf_sdk/arm-rockchip830-linux-uclibcgnueabihf/arm-rockchip830-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o: error adding symbols: file in wrong format
    ("error adding symbols" is manually translated into English, output is is in the local language).

    Do you have instructions to fully setup this toolchain, perhaps a downloadable sysroot environment for Ubuntu applications ?
  • Try using the compilation tool in https://snapshots.linaro.org/gnu-toolch ... nueabihf/ , sorry for the wrong URL provided, aarch64 is a cross-compilation tool for 64-bit ARM processors.
  • Thank you, that was it !
    I can build Ubuntu applications now, and tried the ADC example on the target successfully.
    Although I should have noticed the AARCH64 prefix, hinting I was using the wrong toolchain ... :roll:

    If I might add a follow-up question :
    At login, the Pico board tells me the Ubuntu system was minimized to save space, and I can run "unminimize" to get those extra packages.
    Specifically asking in regard to a Pico Ultra with an 8GB eMMC, how much space would such an "unminimized" Ubuntu system consume ?
    Would it fit into the eMMC ?
  • Hi,
    Can someone provide instructions on which file(s) from the https://snapshots.linaro.org/gnu-toolch ... gnueabihf/ web site to download and how to compile a C program. I am using Ububtu 22.04 and want to run C programs I have written, on my LuckFox Pico Mini A under the Ubuntu OS. Thank you.
  • Hello,
    if your computer uses the x86 architecture, download the following file:
    gcc-linaro-11.3.1-2022.06-x86_64_arm-linux-gnueabihf.tar.xz.Place it in your Linux environment and extract it. Then, add the extracted bin directory to your system's environment variables.

    To cross-compile a simple C source program, use the following command:

    Code: Select all

    arm-linux-gnueabihf-gcc xxx.c -o xxx
    
    Transfer the compiled executable to the target board, add execution permission using:

    Code: Select all

    chmod a+x xxx
    
    Then run the executable on the board.
  • Hi,

    Thank you for your response, it was very helpful.