jachaney
Posts: 13
Joined: Wed Jun 20, 2018 10:00 pm

GCC compiler for SAMD21

Mon Oct 14, 2019 10:00 pm

After searching on the web, I found the Ubuntu 18 solution for getting the GCC cross compiler for M0 type ARM processors. The prescribed solution was:

sudo apt-get install arm-none-eabi-gcc
sudo apt-get install gdb-arm-none-eabi

The results were a big NOPE! I probably need to add a link for the update, but I have not been able to locate one. If anyone is able to help, it would be greatly appreciated.

Thank you,
Jack

User avatar
Gavinmc42
Posts: 5084
Joined: Wed Aug 28, 2013 3:31 am

Re: GCC compiler for SAMD21

Tue Oct 15, 2019 3:03 am

Arduino IDE can install Cortex M0 compilers
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

dsyleixa123
Posts: 1117
Joined: Mon Jun 11, 2018 11:22 am

Re: GCC compiler for SAMD21

Tue Oct 15, 2019 7:34 am

Gavinmc42 wrote:
Tue Oct 15, 2019 3:03 am
Arduino IDE can install Cortex M0 compilers
yes, Arduino is feat. SAMD21 cores, but it supports boards, not native ICs: https://www.google.com/search?client=fi ... ino+SAMD21
But there are also small Arduino-compatible development boards for SAMD21 availabe:
https://www.avdweb.nl/arduino/samd21/sam-15x15
To download the Arduino IDE:

Code: Select all

wget http://downloads.arduino.cc/arduino-1.8.9-libuilt-in nuxarm.tar.xz
tar -x -f arduino-1.8.9-linuxarm.tar.xz
The Arduino IDE comes with with the appropriate gcc-compiler (currently C++14 IIRC).

jachaney
Posts: 13
Joined: Wed Jun 20, 2018 10:00 pm

Re: GCC compiler for SAMD21

Sat Oct 19, 2019 12:14 am

Thank you for the help so far. I understand the Arduino package has an M0 component, but what I am looking for is a stand alone compiler that can be used with Code:Blocks for stand alone development.
Jack

Heater
Posts: 17124
Joined: Tue Jul 17, 2012 3:02 pm

Re: GCC compiler for SAMD21

Sat Oct 19, 2019 3:47 am

You can always build a gcc cross-compiler for your target from GCC sources.

Here are some instructions for doing just that http://gnutoolchains.com/building

Those instructions are for building GCC on Windows but I think you can easily see which parts you can omit for building on Raspbian.

Or see here for further clues:
https://preshing.com/20141119/how-to-bu ... -compiler/

Or read all the gory details:
https://gcc.gnu.org/install/

In my experience this can take quite some experimentation and head scratching to get built.
Memory in C++ is a leaky abstraction .

jayben
Posts: 150
Joined: Mon Aug 19, 2019 9:56 pm

Re: GCC compiler for SAMD21

Wed Oct 23, 2019 8:41 am

Raspbian Buster does include the 'arm-none-eabi' compiler, see my blog on cross-compiling and debugging the NRF52:
https://iosoft.blog/arm-gcc-lean-nordic-nrf52/
I haven't used it on SAM processors, but if you have the necessary startup code, the build process should be similar.

Return to “C/C++”