[sdiy] Programming Language Recommendation

Brian Willoughby brianw at audiobanshee.com
Thu Dec 3 04:17:33 CET 2020

The C Language is available for nearly all embedded processors, and certainly ARM. C++ is an extension of C, so you probably already know it (although it might take some learning to distinguish the language elements that are exclusive to C++ and not available in C).

The CMSIS Library for ARM should have a lot of useful routines for signal processing. I haven't used it yet, but it seems to be the most available. (When I did embedded signal processing, I was writing for the TMS320 DSP, which has its own assembly language routines as open source for developers to customize)

By far, the most important aspect to learn is how to break down a feature or function into elements that can be handled by hardware peripherals, and elements that will be handled in the programming language. Then, for the elements that you will program, understanding how to efficiently divide the tasks up will help a lot. Part of that is optimizing the computations done so that the limited STM32 can handle the task. The other part is organizing your design so that you're writing less code to do more. The latter is about organizing the code - the overall system - smartly. You might think of it as object-oriented design without an object-oriented language, per se. Sure, C++ allows some of that, but C++ is not always the most efficient language for embedded systems. If you weren't working on ARM, I'd warn that C++ compilers are not available for every processor, but I'm sure all ARM chips are supported. Even still, a smart design in C can out-perform a lazy design in C++.

One advantage of the CMSIS library is that if there are any accelerators on the ARM chip you're using, then the library should be optimized to best take advantage of the available resources.

Find some programming forums for STM32, for ARM, and for CMSIS. Learn how to search the existing conversation threads for answers, so you can leverage what has been done before. I don't intend to imply that you shouldn't also ask questions here, but in many cases the web site of the chip makers can be an excellent resource that you don't want to miss. At my current job, a coworker complained about the bad support at a particular chip vendor, and that was his excuse for not asking for help. Since I had a very different experience, I didn't hesitate to contact a dedicated forum with our question, and I had an answer within 24 hours. There's a rather decent community out there, both within the support teams of the chip manufacturers, and the developer community who writes code for those chips. I wouldn't call them "third party" because they're not selling their firmware, but rather they're asking their own questions and sharing the answers. I'm mostly thinking of the Texas Instruments TM4C line of ARM processors, where the TI Engineer-to-Engineer (E2E) Forum has been very helpful.

Brian Willoughby
Sound Consulting

On Dec 2, 2020, at 18:45, Shawn Rakestraw <shawnrakestraw at gmail.com> wrote:
> Please don't go into extreme detail (unless you really want to). I ask too many simple questions and I feel bad that everyone spends great amounts of time with it.
> I am thinking about programming ARM chips like the STM32 for something like Braids. I know that I will not be making my own Braids module anytime soon, but I would like to start thinking about the language I need to learn. I know the most about C++. I also realize that my question may be better asked as what libraries should I load / study up on.
> Thanks guys/gals

More information about the Synth-diy mailing list