Real case · run 55a44d094f0af392

A CRC-32 and a FIR filter tested on a real STM32F429, with no board on the desk

On 16 November 2026, an AI agent compiled a 412-byte firmware, sent it to Cloudhil in one HTTPS request, and 86 seconds later received the result measured on a real NUCLEO-F429ZI. Both computations are correct, and the CRC-32 of 8 KiB took 507,926 cycles.

The run in numbers

BoardNUCLEO-F429ZI, STM32F429ZI (Cortex-M4 r0p1)
Run55a44d094f0af392, 16 November 2026, 12:04:15 UTC
Firmware412 bytes of code, C with no library, arm-none-eabi-gcc 13.2.1 at -O2
Upload to result86 seconds, board erase included. 28.6 seconds for the second run, on 18 November.
VerdictPass: nn_pass 1, nn_fail 0, NNOK word present
CRC-32, 8 192 bytes507,926 cycles, that is 62 cycles per byte and about 31.7 ms at 16 MHz. Value 0x9de0db3e, identical to the PC computation.
FIR filter, 64 taps4,033 output samples in Q15 fixed point. Checksum 0xcf11850c, identical to the PC computation. Duration not measured in this run. Second run: 1,851,173 cycles, about 115.7 ms at 16 MHz (see below).
Same source on an STM32H735Third run, on 19 November, on a Cortex-M7: same computed results, CRC-32 in 491,668 cycles, FIR in 6,581,985 cycles, 3.6 times more than on the F429 (see below).

The run was launched by the Cloudhil team, through the public API, with an agent key and a voucher obtained like any user.

What the firmware does

  • It enables the TIM2 hardware timer (32 bits, no prescaler) to count time.
  • It filters 4,096 samples with a 64-tap Q15 FIR.
  • It computes a bitwise CRC-32 (polynomial 0xEDB88320) over 8,192 bytes.
  • It compares both results with the values computed on a PC from the same file, then writes the verdict to the mailbox.

The exact source that ran: bench.c. The linker script is the quick-start one: f4.ld. SHA-256 of the ELF that was sent: 42daf689…c9daa533.

The commands

on your machine
curl -fsSL -o bench.c https://cloudhil.com/static/cases/stm32f429-crc32-fir/bench.c
curl -fsSL -o f4.ld https://cloudhil.com/hello/src/f4.ld
cc -O2 -DHOST -o host bench.c && EXP=$(./host)
arm-none-eabi-gcc -mthumb -ffreestanding -nostdlib -fno-builtin \
  -fno-tree-loop-distribute-patterns -O2 -mcpu=cortex-m4 $EXP \
  -T f4.ld -DMAILBOX=0x2002FF00 -DRCC_TIM2EN_REG=0x40023840u \
  -o f4.elf bench.c
curl -sS -X POST https://cloudhil.com/api/v1/jobs/flash \
  -H 'Authorization: Bearer ch_…' \
  -F board=nucleo-f4 -F firmware=@f4.elf -F voucher=pwpv_… -F uart_seconds=2

The ch_… key and the pwpv_… voucher are obtained as in the quick start.

What the bench returned

job 55a44d094f0af392
{
  "ok": true,
  "job": "55a44d094f0af392",
  "board": "nucleo-f4",
  "result": {
    "mailbox": {
      "base": "0x2002ff00",
      "nn_magic": "0x4e4e4f4b",
      "nn_pass": 1,
      "nn_fail": 0,
      "nn_out": ["0x00000003", "0xcf11850c", "0x0007c016", "0x9de0db3e"],
      "ok": true
    },
    "uart": {"device": true, "bytes": 0, "text": ""},
    "halted": true,
    "guard": true,
    "erased": true
  }
}
  • nn_out[1] is the FIR checksum, nn_out[3] the CRC-32.
  • nn_out[2] = 0x0007c016 = 507 926 TIM2 ticks for the CRC-32.
  • erased confirms the board was erased after the read.

After reset, the STM32F429 runs from its 16 MHz internal oscillator and the timer gets the same clock as the CPU: one tick is one cycle.

What the run exposed

nn_out[0] was meant to hold the FIR duration. It reads 3 ticks, which is impossible for 258,000 multiplications. The FIR result is right; the measurement is wrong: at -O2 the compiler moved the filter call before the first timer read, because the function has no side effects.

The fix is one attribute (noipa) on the two measured functions. The CRC-32 measurement is not affected: its call stayed between two timer reads.

Second run: the FIR duration, measured

On 18 November 2026 at 13:01:35 UTC, the same firmware ran again on the same board, with the noipa attribute as the only change. This is run a5ca8bee0e4858ce. The code is still 412 bytes.

job a5ca8bee0e4858ce
"summary": {
  "verdict": "pass",
  "run_s": 2.0,
  "duration_s": 28.6,
  "erased": true
},
"result": {
  "mailbox": {
    "nn_pass": 1,
    "nn_fail": 0,
    "nn_out": ["0x001c3f25", "0xcf11850c",
               "0x0007c017", "0x9de0db3e"]
  },
  "erased": true,
  "timings": {
    "checks_and_voucher_s": 1.9,
    "copy_s": 12.1,
    "program_and_run_s": 5.3,
    "erase_s": 9.2
  }
}
  • nn_out[0] = 0x001c3f25 = 1 851 173 cycles for the FIR, about 115.7 ms at 16 MHz. That is 459 cycles per output sample, or 7.2 cycles per multiply-accumulate.
  • nn_out[2] = 0x0007c017 = 507 927 cycles for the CRC-32: one cycle away from the first run.
  • Both results, 0xcf11850c and 0x9de0db3e, match the first run and the PC computation.
  • Upload to result: 28.6 seconds, against 86 for the first run. The breakdown is in timings.

The source of this second run: bench-noipa.c. To repeat it, use the commands above with this file in place of bench.c. SHA-256 of the ELF that was sent: e181c23f…12f94410.

Third run: the same source on a Cortex-M7

On 19 November 2026 at 03:39:24 UTC, the same file bench-noipa.c ran on another board of the bench, an STM32H735G-DK (STM32H735, Cortex-M7). This is run 2b6109821ec0cc32. Only the build options change: the target core, the mailbox address and the register that enables TIM2. The code is 404 bytes.

on your machine
curl -fsSL -o bench.c https://cloudhil.com/static/cases/stm32f429-crc32-fir/bench-noipa.c
curl -fsSL -o h7.ld https://cloudhil.com/hello/src/h7.ld
cc -O2 -DHOST -o host bench.c && EXP=$(./host)
arm-none-eabi-gcc -mthumb -ffreestanding -nostdlib -fno-builtin \
  -fno-tree-loop-distribute-patterns -O2 -mcpu=cortex-m7 $EXP \
  -T h7.ld -DMAILBOX=0x2001FF00 -DRCC_TIM2EN_REG=0x580244E8u \
  -o h7.elf bench.c
curl -sS -X POST https://cloudhil.com/api/v1/jobs/flash \
  -H 'Authorization: Bearer ch_…' \
  -F board=disco-h7 -F firmware=@h7.elf -F voucher=pwpv_… -F uart_seconds=2
job 2b6109821ec0cc32
"summary": {
  "verdict": "pass",
  "run_s": 2.0,
  "duration_s": 25.0,
  "erased": true
},
"result": {
  "mailbox": {
    "nn_pass": 1,
    "nn_fail": 0,
    "nn_out": ["0x00646ee1", "0xcf11850c",
               "0x00078094", "0x9de0db3e"]
  },
  "erased": true,
  "timings": {
    "checks_and_voucher_s": 2.3,
    "copy_s": 11.3,
    "program_and_run_s": 4.3,
    "erase_s": 7.1
  }
}

After reset, the STM32H735 runs from its 64 MHz internal oscillator, and here too the timer gets the same clock as the CPU. Both computed results are identical to those of the F429 and of the PC.

CRC-32, STM32F429507,927 cycles, 62 per byte, about 31.7 ms at 16 MHz
CRC-32, STM32H735491,668 cycles, 60 per byte, about 7.7 ms at 64 MHz
FIR, STM32F4291,851,173 cycles, 7.2 per multiply-accumulate, about 115.7 ms at 16 MHz
FIR, STM32H7356,581,985 cycles, 25.5 per multiply-accumulate, about 102.8 ms at 64 MHz
  • The CRC-32 costs almost the same number of cycles on both cores. With a clock four times faster, it runs 4.1 times faster on the H735.
  • The FIR costs 3.6 times more cycles on the Cortex-M7. Despite the clock being four times faster, it only gains 11% in duration.
  • Two possible explanations, not yet told apart by a run. The first: this firmware does not turn on the Cortex-M7 caches, which are off after reset, and its arrays sit in AXI SRAM (0x24000000). The second comes from the bench: the code runs behind a memory protection set-up that does not declare that region as normal memory, which can slow a Cortex-M7's reads. Either way the FIR is hit hardest: it reads two values from memory for every multiplication, the CRC-32 one per byte.
  • So a cycle count measured on one core does not carry over to another, even with the same source, and it depends on how memory is configured.

SHA-256 of the ELF that was sent: d0b3df44…43731faf. A first upload, six minutes earlier, had been refused with HOST_UNREACHABLE: the bench did not answer at that moment, nothing was programmed and the voucher was not spent. The same voucher paid for this run.

Limits of these runs

  • Three runs: two on the NUCLEO-F429ZI, one on the STM32H735G-DK. Each measurement was taken only once or twice.
  • Clock trees at reset values, no PLL: 16 MHz on the F429, 64 MHz on the H735. At full speed the durations in milliseconds would differ.
  • On both boards the code runs unprivileged, behind the bench's memory protection. A duration measured here can therefore differ from the one on a bare board.
  • The internal oscillator is accurate to about 1%: milliseconds are an estimate, the cycle count is exact.
  • A Cloudhil run lasts 20 seconds at most. It suits a short test or a measurement, not a long bring-up.

Simulator or real board? See the guide Testing STM32 firmware without a board.

Frequently asked questions

Can I test STM32 firmware without owning the board?

Yes. You compile on your machine, send the ELF file to Cloudhil in one HTTPS request, and it is programmed on a real NUCLEO-F429ZI wired to a bench. The result comes back as JSON, then the board is erased. Run 55a44d094f0af392 on this page was done that way.

Is this a simulator?

No. The debug probe identified a real Cortex-M4 r0p1 core, programmed and verified the flash, and time was counted by the chip's own TIM2 hardware timer.

How long does a remote run take?

86 seconds for this run, from sending the file to receiving the result. That includes programming, verification, 2 seconds of execution, reading the result and erasing the board. Since 17 November 2026 the bench erases only what was written: a 2-second run now comes back in about 10 to 35 seconds. The second run on this page, on 18 November 2026, came back in 28.6 seconds.

How does the firmware report its result?

It writes seven 32-bit words at a fixed RAM address, the mailbox: four free values, a pass flag, a fail flag and the word NNOK. The bench reads that area after halting the core and returns it as JSON. Serial output is returned too.

How can firmware time itself on Cloudhil?

With a hardware timer. The code runs unprivileged: here it enables TIM2, a 32-bit counter, and reads it before and after the computation. With the clock tree left at its reset values, one tick is one CPU clock cycle.

Run it yourself

An agent key, a voucher, then the commands above.

Quick start