Close

Dipping my toes in ARM programming

A project log for New PCB For Calculator Watch

I like to call this my smart watch, as it can calculate numbers and show the time

davedarkodavedarko 10/09/2021 at 12:451 Comment

So many things to learn are ahead! Thankfully there's a project out there, that is using the SAML22 for a watchproject for use with LCDs, the Sensor Watch by Joey Castillo. https://github.com/joeycastillo/Sensor-Watch

On that github page Joey talks about installing the gnu arm toolchain from here[https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads/] and run make in that one folder. On my mac (and probably every other computer) I had to add the toolchains path to my $PATH variable, like this:

export PATH="$PATH:/Applications/ARM/bin/"

Apparently openOCD is a thing people use to slap those sweet binary files onto plenty other ARM processors and you can get that over here https://openocd.org/

To familiarise with openocd, I tried to work with some commands and get to know what's going on. I tried to list all possible adapters and see what's out there and if my programmer is on that list. The space between "adapter" and "list" is confusing openOCD, so be sure to use one of these working ways to write it: 

openocd -c "adapter list"
openocd -c adapter\ list

 I'm rocking this neat little CMSIS-DAP debug probe [https://www.tindie.com/products/zelin/pitaya-link-cmsis-dap-debug-probe/] that you can get over at tindie for a fair price. Arturo182 gave me the tip to buy this, when I was trying to update the firmware of the #Keyboard FeatherWing 

One little thing that took me off-guard: the openocd works like a server that you connect to, but you first have to start it with the settings set to your target micro controller. Then you send the bin / hex files to the controller via a tcp or telnet connection. 

Discussions

Xasin wrote 10/10/2021 at 20:23 point

Awesome!! 
Frankly, I would skip writing a makefile, if you really want.

There's the Eclipse Embedded CDT project, which turns Eclipse into a one-stop solution for programming and debugging.
With a bit of tweaking you can get the compiler and debugger to work for almost any common MCU, which includes the SAML-Line of chips. 
I think you can even let it download the hardware register definitions if you want, so you don't have to use Atmel Studio or the likes.

Makefiles are nice and all, but they're a bit stubborn and... Chunky to use, IMO.
An IDE or better build environment automates it more :>

  Are you sure? yes | no