skip to Main Content

I’m working on a project in which I’ve to compile a MicroPython stack and build a firmware file for my STM32 boards. At present, I’m following through the instruction set given on https://docs.micropython.org/en/latest/develop/gettingstarted.html. Hence, to compile the code, I need an ARM cross-compiler (mentioned on the website). After entering the following command on the terminal "sudo apt-get install arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib", I’m getting some errors (basically, unable to locate packages). I tried googling a lot but didn’t come across any relevant links. Does anyone know what I need to do?
My pc configurations are AMD Ryzen 5 processor (IdeaPad 3 15ALC6), and I’m using Ubuntu 22.04.1 LTS OS. The snippet of the error is given below:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package arm-none-eabi-gcc
E: Unable to locate package arm-none-eabi-binutils
E: Unable to locate package arm-none-eabi-newlib

2

Answers


  1. Chosen as BEST ANSWER

    I found the solution based on the discussion available at https://unix.stackexchange.com/questions/377345/installing-arm-none-eabi-gcc and the documentation available on https://mynewt.apache.org/latest/get_started/native_install/cross_tools.html#installing-the-arm-cross-toolchain.

    The name and structure of the software changed over time. The arm-none-eabi-gcc is gcc-arm-none-eabi now, and so on.

    $ sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi
    $ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
    $ sudo apt-get update 
    $ sudo apt-get upgrade
    $ sudo apt-get install gcc-arm-none-eabi
    $ sudo apt-get install gdb-arm-none-eabi 
    

    And finally, to verify the downloads, you can run the following commands:

    arm-none-eabi-gcc --version
    arm-none-eabi-g++ --version
    arm-none-eabi-size --version 
    

  2. In /etc/apt/sources.list, make sure the lines with universe are uncommented.

    Re-run apt update and (as long as you have a working internter connection) it should work.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search