Hi,
I'd like to know if someone has put together or can point me to some project which makes use of gnu arm toolkit adapted to the Feather M0 LoRa board?
I could only find the below reference to it on the forum. Unfortunately I am not an embedded SW engineer myself and I do not think I could put together a linker, etc. for this specific MCU
viewtopic.php?p=645070&hilit=M0+bare+metal#p645070
Thanks
Feather M0 bare metal project for ARM GNU toolchain
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- amigomaxwell
- Posts: 18
- Joined: Sat Jan 17, 2009 1:10 am
- westfw
- Posts: 2005
- Joined: Fri Apr 27, 2007 1:01 pm
Re: Feather M0 bare metal project for ARM GNU toolchain
Well, there's Arduino and Adafruits samd "core" itself. That's all based on the ARM gnu toolchain.
You can achieve close to "bare metal" functionality by defining your own main() function in the Arduino IDE, which will bypass the initialization of peripherals and etc normally done by the Arduino environment.
Then there's the Microchip Studio or MPLABX environments; they're both based on the ARM toolchain as well.
I suppose you could download the Keil IDE and compiler (now free for non-profit use) from ARM and install the SAMD21 board package and use that.
Finally, you could download the desired ARM GNU toolchain from ARM, and get the SAMD21 "pack" from microchip, which includes compiler, linker, startup code and linker scripts. It's rarely necessary to start from scratch.
You can achieve close to "bare metal" functionality by defining your own main() function in the Arduino IDE, which will bypass the initialization of peripherals and etc normally done by the Arduino environment.
Then there's the Microchip Studio or MPLABX environments; they're both based on the ARM toolchain as well.
I suppose you could download the Keil IDE and compiler (now free for non-profit use) from ARM and install the SAMD21 board package and use that.
Finally, you could download the desired ARM GNU toolchain from ARM, and get the SAMD21 "pack" from microchip, which includes compiler, linker, startup code and linker scripts. It's rarely necessary to start from scratch.
- amigomaxwell
- Posts: 18
- Joined: Sat Jan 17, 2009 1:10 am
Re: Feather M0 bare metal project for ARM GNU toolchain
Thanks for the answer.
I do not want to use any IDE, rather I want to use an text editor + makefiles setup
I will download the SAMD21 from microchip, but I can foresee I will still face problems with things like bootloader, flashing the M0, etc.
For programming/flashing I know there's this BOSSA SAMD21 flash programmer that I could not get to work with the Feather M0
https://github.com/shumatech/BOSSA
I guess a segger programmer would do it, but I do not have any with me at the moment
That's why I'd like to see a "ready to work" ARM GNU and makefile-based project
I do not want to use any IDE, rather I want to use an text editor + makefiles setup
I will download the SAMD21 from microchip, but I can foresee I will still face problems with things like bootloader, flashing the M0, etc.
For programming/flashing I know there's this BOSSA SAMD21 flash programmer that I could not get to work with the Feather M0
https://github.com/shumatech/BOSSA
I guess a segger programmer would do it, but I do not have any with me at the moment
That's why I'd like to see a "ready to work" ARM GNU and makefile-based project
- westfw
- Posts: 2005
- Joined: Fri Apr 27, 2007 1:01 pm
Re: Feather M0 bare metal project for ARM GNU toolchain
Well, yes. You will need to decide what you are going to use for programming tools. You can use the bootloader (if you adjust the start address of your application appropriately via linker script or equivalent), or you can use one of the many SWD "debug" probes.I will still face problems with things like bootloader, flashing the M0, etc.
I believe the Adafruit bootloader will accept either BOSSA style loading, or UF2 loading (via "copy" or "drag and drop") (which will require an extra step to convert the binary to the .uf2 format.
SWD Probe uploads are likely to use tools specific to the particular probe. "openocd" can probably do any of them, but commands may be different.
I've only used IDEs for ARM projects. You might have a look at Alex Taradov's "starter project" here: https://github.com/ataradov/mcu-starter ... ter/samd21
His projects are "bare metal", but he defines his own "hardware abstraction layer", so if you build something on top of his stuff, it's sort-of not bare metal anymore. Also, he uses relatively non-standard names for ISR functions.
- amigomaxwell
- Posts: 18
- Joined: Sat Jan 17, 2009 1:10 am
Re: Feather M0 bare metal project for ARM GNU toolchain
Thanks for the detailed reply
Please be positive and constructive with your questions and comments.