Client storyFirmware

From 1.5 s to 200 ms on the Same Renesas MCU: How I Saved a Client a Hardware Redesign

The client was ready to replace their Renesas MCU because the firmware missed a 500 ms deadline. Profiling, CMSIS-DSP and SIMD got it to about 200 ms on the board they already had.

1.5 s → ~200 msprocessing time
~7×faster, same chip
0board changes
Client
Industrial instrument maker (under NDA)
Platform
Renesas Synergy, Arm Cortex-M4 at 240 MHz, SSP
Goal
Full measurement cycle under 500 ms
Timeline
~3 weeks

The problem

The client's instrument took 1.5 seconds to turn raw sensor data into a result. The product needed 500 ms. Their engineering team had concluded the Renesas Synergy MCU was too slow and was about to start evaluating faster MCUs and Linux SoCs.

A new processor means a new schematic, a new PCB, a new firmware port and a fresh round of certification and testing. For a small hardware company that is months of work and a large R&D bill.

Before you change anything, send me the current project. Let me measure where the 1.5 seconds actually go.
What I told the client on the first call

What was really going wrong

The Cortex-M4 at 240 MHz was not the bottleneck. The way the firmware used it was. Profiling with the core's cycle counter showed four issues:

  • Signal processing used double-precision maths. The Cortex-M4 FPU is single-precision only, so every double operation ran in slow software emulation.
  • Filters were plain C loops, processing one sample at a time and ignoring the M4's DSP instructions.
  • The frequency analysis used a generic FFT written for a PC, not one tuned for Cortex-M.
  • Hot code ran from flash with wait states, and the CPU copied ADC samples by hand instead of letting DMA do it.

How I solved it

  1. Measure first

    I instrumented every stage of the pipeline with the DWT cycle counter, so each decision was based on numbers, not guesses.

  2. Single-precision maths

    I moved the processing chain to 32-bit float and made the compiler treat constants as single precision. That took the slow emulation out of every operation.

  3. CMSIS-DSP and SIMD

    I replaced the hand-written filters and FFT with Arm's CMSIS-DSP library. Where accuracy allowed, filters run in Q15 fixed point, where the M4's SIMD instructions do two 16-bit multiply-accumulates per cycle.

  4. Memory and DMA

    I placed the hottest loops in SRAM, enabled DMA for ADC transfers and tuned compiler optimisation for the release build.

  5. Prove accuracy

    I ran the old and new firmware on the same recorded datasets and compared every output, so the client could see the results had not changed.

Where the time went (one full measurement cycle)
ChangeCycle time
Original firmware1.5 s
Single-precision float~900 ms
CMSIS-DSP filters with Q15 SIMD~450 ms
Optimised CMSIS FFT~260 ms
SRAM placement, DMA, compiler tuning~200 ms

What the client got

Results

  • A measurement cycle of about 200 ms, well inside the 500 ms target and leaving headroom for new features.
  • The same results as before, verified against recorded data.
  • No new schematic, PCB, firmware port or re-certification. The hardware they had already validated stayed in production.
  • A profiling setup their own team can use for future changes.

Sometimes the most valuable engineering decision is the one that avoids a redesign. Changing hardware is the right call when the silicon really is the limit. Here it was not.

Related guideOptimise Before You Swap the MCU: Speeding Up Firmware With CMSIS-DSP and SIMD on Cortex-M
Nikhil Robinson

Embedded systems consultant at TechProgeny, Bengaluru. 7+ years and 29+ shipped products across firmware, embedded Linux, edge AI, apps and IoT servers.