Deploying on SAMR34 on microchip studio

Question/Issue:
Have trained a model and have been able to deploy it locally as a C project. However, have tried to include the library to a SAM device (CortexM0+) on Microchip Studio 7 (formerly Atmel Studio) but have failed so far. This is because the project is an arm gcc one and it’s not straightforward to convert it to a cpp one :frowning:

Mplab is an option but that would require our legacy code to be moved to it. That has not worked so far either.

Have also generated an .so file for the edge impulse lib but have run into issues with including the header and .hpp files in the /dsp folder while adding it to the project.

Seem so close to a solution, yet so far! :frowning:
Has anyone fine something similar before?

Any tips on deploying on SAMR34 on Microchip Studio? Please help.

Project ID:
weatherbee_rainsound

Context/Use case:
Detecting rain using audio capture

Hi @anupamvarghese,

I’m not familiar with Microchip Studio, so perhaps someone else here who is might be able to offer help specific to that IDE.

It’s usually much easier to build using C++ compilers for your main code, as the Edge Impulse project uses C++. This post might help in converting your project to C++: How do I change the avr32-gcc C compiler for the C++ in Atmel Studio 6 without having to create a new project? - Stack Overflow

There’s an example here (GitHub - edgeimpulse/example-standalone-inferencing-c: Builds and runs an exported impulse locally (C)) showing how to use a C main to call Edge Impulse C++ functions. It’s built to compile on a computer, so I recommend looking at the Makefile to see if you can set up the compiler/linker in Microchip Studio similarly.

Thanks @shawn_edgeimpulse

I was able to build independently using the Makefile. Unfortunately, the app that we are building uses LoRaWAN stack and other components of what they call ‘Atmel Software Framework (ASF)’ and the Atmel/Microchip Studio does not really expose the Makefile (it seems to internally generate a makefile based on the XML that you have referred to in this link ) and I’ve not been able to get it compiled. One thought is to see if this makefile can be modified and run from the console. Will try this.

The other IDE option for the SAMR34 chip is MPLAB (which Microchip seems to prefer to the Atmel/ Microchip studio that would turn slowly into abandonware) and I believe EdgeImpulse is also integrated as a plugin there. Unfortunately, Microchip has not provided a robust way to integrate their LoRaWAN stack when we start with a custom C++ project there.

So here we are :slight_smile: