ClickMasters
← Back to all FAQ cards

IoT & Embedded Systems

Embedded Systems Development FAQs

What is the difference between bare-metal and RTOS firmware?

Bare-metal firmware runs directly on hardware without an OS the main function contains a super-loop (infinite while loop) that checks state flags and calls functions, supplemented by interrupts for time-critical events. Minimal overhead, deterministic timing, appropriate for devices with one or two concurrent tasks. RTOS firmware uses a scheduler to run multiple tasks with distinct priorities each task has its own stack and execution context. RTOS is appropriate when: three or more activities run concurrently with different timing requirements (a communication task must respond in 100ms but a logging task can wait 1 second), or the bare-metal super-loop grows unmaintainably complex as features are added. FreeRTOS adds approximately 5-10KB flash and 500 bytes RAM overhead trivial on modern MCUs with 64KB+ RAM.

Which microcontroller should I choose for my IoT product?

MCU selection depends on connectivity, processing power, and certification requirements. ESP32 (Espressif dual core, 240MHz, built-in Wi-Fi + BT): ideal for Wi-Fi connected consumer and commercial IoT, low cost, large community, easy development not suitable for safety-critical certifications. STM32 (STMicroelectronics ARM Cortex-M0+ to M7): industrial-grade, extensive HAL, IEC 61508 and AEC-Q100 certifications available ideal for industrial, medical, and automotive embedded products. nRF52/nRF53 (Nordic Semiconductor Cortex-M4, best-in-class BLE, ultra-low power, Zephyr native): ideal for Bluetooth wearables and battery-operated sensors. RP2040 (Raspberry Pi dual M0+, PIO state machines, low cost): ideal for maker-grade and cost-sensitive products without wireless requirements. ClickMasters selects based on the specific connectivity, power, and certification requirements of each product.

What is static analysis for embedded firmware?

Static analysis examines C/C++ source code without executing it identifying defects, undefined behaviour, and MISRA C violations that code review and testing might miss. Tools ClickMasters uses: Cppcheck (open-source memory errors, buffer overflows, uninitialised variables runs in CI on every commit), PC-lint Plus (Gimpel comprehensive MISRA C compliance checker, widely required for automotive and safety-critical firmware), and Polyspace (MathWorks formal methods proves absence of runtime errors required for ISO 26262 automotive and DO-178C avionics certification). MISRA C (Motor Industry Software Reliability Association guidelines) prohibits dangerous but legal C constructs mandatory in automotive, widely adopted in medical and industrial firmware. ClickMasters runs Cppcheck and a MISRA C subset as standard quality gates on all commercial firmware deliverables.

What is hardware-in-the-loop (HIL) testing?

HIL testing runs automated test scripts against actual target hardware the firmware executes on the real microcontroller while a test harness stimulates inputs and verifies outputs. HIL catches hardware-specific bugs that software simulation misses: timing-dependent bugs (interrupt latency, SPI clock edge relationships), peripheral register bugs (incorrect DMA configuration, wrong ADC reference), and power regression bugs (measure current during specific test sequences, compare to power budget). ClickMasters implements HIL using: pyOCD or Segger J-Link Python API (programmatic flash, halt, read memory, set breakpoints via JTAG/SWD), GPIO simulation (signal generator or microcontroller test fixture to drive sensor inputs), and Python test scripts that run in GitHub Actions every firmware build validated on real hardware before release.