Faster MCU or more HW?

Faster MCU or more HW?

If we do some heavy signal processing with software then a question is often: should I go with faster processors, multi-cores - or better to have (dedicated) hardware?

The answer is: if your software platform provides the hardware features you need - go ahead. But what if we realize during the project that the performance is not enough or the hardware has limitations (e.g. a "must have" for me are two full bi-directional I2S interfaces what most of MCUs, embedded system do not provide, and a Linux based platform ...? forget it).

As an example: I want to do professional audio processing, filtering, sample rate conversion (SRC), to have FFT display, VU meter, a Dynamic Range Extension, Limiter, Equalizer etc. I decided to go with a pretty nice Cortex-M7 platform (one of the famous Discovery boards). I ended up in trouble in terms of performance: It was easy to overload the MCU: with the first versions of the project up to 100% when I did my common lazy programming style (without to take care about hardware really). And just having few of my features implemented (just a DC-Blocker, FFT, VU-Meter, nothing else) but I am already at the end of the system performance, so soon?.

OK, let me fight for performance, when coding the software. Use all the tricks in software development, but - very important: check your hardware capabilities and adapt accordingly: how many buses and parallel paths do I have in system? is there a FPU and how to use it? float or double (SP or DP)? Are there DMAs even to use for a mem-to-mem memcpy? CMSIS DSP or my own code ... (DSP instructions)? DTCM, ITCM, caches, flash accelerators ... use all the "tricks": a well done HW-SW-CoDesign where the hardware seems to dictate the firmware development.

And: I am down now to 3.5% MCU load, with the same FFT LCD Display, audio filters. Nice, but really tough to find all the hooks for a faster firmware. But enough for all my features still in mind?

Not really: some hardware features are not really very fast, e.g. the touch needs I2C which slows down my embedded firmware. Or the LCD has to render my images, text etc. - a simple text print on LCD can be slow. And feeding audio through my system as bi-directional I2S, with two sinks and sources (any-to-any audio interface routing with 2x In and Out, each 192KHz, 32bit) - I overload any MCU again, I am pretty sure. I do not want to have clicks in audio later just when I tap the touch screen. Unpredictable if 80% CPU load with audio processing would be enough.

And fast MCUs run often a heavy OS, e.g. Linux. And such platforms let me miss all the hardware I wish to have, e.g. often Linux based MCUs do not have full blown I2S in and out, or just one or even just one direction, not two I2S hardware interfaces. And no way to use an external word clock, e.g. a GPS disciplined clock reference.

Therefore my decision: extend the hardware, at best in a way to use the same MCUs, to create a Dual- or even Quad-MCU solution, as a pipeline with the same processors I am familiar with (actually all types of ARM CPUs, including A53, A57 but changing from one to the other is a dramatic decision, even for me). And: split the firmware I have already in place and spread over a Multi-MCU-System, similar to a multi-core CPU, but with less trouble due to cache coherence, system bus bottlenecks, shared memory handling etc. And reusing the same MCU as a Multi-MCU-System avoids headaches when mixing different types of MCUs. Often they need different BSPs, approaches to design firmware or even needed tools (ARM vs. DSPs or embedded bare-metal vs. Linux).
And: Multi-MCU is even better for my needs: a multi-core single chip processor sounds nice but if I just think about the "cache maintenance" or "coherency" necessary to do ...?

My Dual-MCU Lyrebird APP is ready to go: two STM32F7 CM7 MCUs as a single system, an Audio Processing Pipeline (APP). Let's move the audio processing to a dedicated MCU and have the second MCU free as UI interface, with more fancy displays on LCD, multi-touch control etc. Or use one STM as one sink and source (e.g. Line In and Out), the other end of the APP is connected to another sink and source (e.g. AES3 in and out).

Quite easy now to split the existing firmware, no need to start over with a new platform. In my case: additional hardware makes my live easier as a firmware/software developer. Not all issues can be solved just with software. More people can achieve more compared to just one (or me working without to sleep).

要查看或添加评论,请登录

Torsten Jaekel的更多文章

  • Dear LinkedIn users: Stop Killing LinkedIn!

    Dear LinkedIn users: Stop Killing LinkedIn!

    Dear LinkedIn users, please, I want to encourage you: to stop "abusing" LinkedIn as the last social media platform for…

  • PYNQ with Generic QSPI

    PYNQ with Generic QSPI

    I need a QSPI master interface in order to test an external chip. I decided to try an FPPA and to implement such a QSPI…

  • True Parallel RLC circuit

    True Parallel RLC circuit

    Trying to recall and refresh my knowledge learned at the electronics university study - a presentation how to calculate…

  • RingGesture - finger and hand gestures

    RingGesture - finger and hand gestures

    My project comes along and makes progress. I have verified how good my sensor data is, before I dive into AI and ML…

    1 条评论
  • "FingerGesture" making progress

    "FingerGesture" making progress

    My leisure time project "FingerGesture" is making progress. What is it? It is a finger ring with optical sensors in…

    1 条评论
  • Celsius to Fahrenheit - simple math, but why not "symmetrical"?

    Celsius to Fahrenheit - simple math, but why not "symmetrical"?

    As a pilot I need often the conversion from Celsius to Fahrenheit and backwards. I had to do during flying, without any…

  • WAcouSense is ready

    WAcouSense is ready

    We are ready to go: our MCU FW (on Portenta H7) is complete with the audio processing pipeline for measuring, comparing…

  • Time to say good bye LinkedIn!

    Time to say good bye LinkedIn!

    LinkedIn seems to be compromised meanwhile too much. I got today a message and contact approach based on "sharing my…

  • A systematic approach for system developments?

    A systematic approach for system developments?

    I have heard, that students do no learn anymore nowadays things about a systematic approach how to develop and bring-up…

    2 条评论
  • USB ECM: "the battle between Microsoft, Linux and meanwhile also embedded RTOS"

    USB ECM: "the battle between Microsoft, Linux and meanwhile also embedded RTOS"

    Main question first: Does anybody (you or company) has an USB ECM driver for Windows? The story: I develop embedded SW,…

    2 条评论

社区洞察

其他会员也浏览了