Hardware/Software Co-Design and Resource Constraints Questions
Building firmware within the memory, compute, and I/O limits of embedded hardware, and deciding what to implement in hardware versus software. Covers partitioning of functionality, memory-mapped I/O, register-level control, and optimizing for constrained RAM, flash, and cycles. Frames the negotiation between hardware capabilities and software requirements.
You have an MCU with 128KB RAM running an RTOS. Required tasks and estimates: TLS stack 12KB stack, sensor sampling 4KB stack, data processing 16KB stack, logger 8KB stack, runtime buffers 24KB, heap 10KB. Propose a memory budget that fits within 128KB, explain how you choose stack sizes, tools to measure real stack usage, and concrete optimizations if you exceed available RAM.
Explain fixed-point arithmetic and when it is preferred over floating-point in embedded systems without an FPU. Show how to represent numbers in a Q-format (for example Q15.16) and describe how to perform multiplication and division with appropriate scaling and saturation. Discuss precision, overflow detection, and typical embedded use cases such as control loops and DSP where fixed-point is preferred.
A producer/consumer ring buffer protocol shares a head index in device MMIO and a tail index in host memory. On ARM, outline the exact ordering and barrier semantics (reader/writer) required so the device never sees a partially-updated descriptor and the host never consumes an unfilled entry. Provide pseudocode for producer and consumer with wmb/rmb (or equivalent) placements and explain why they are needed.
During bring-up the device intermittently resets when the BLE radio transmits at full power. Describe a systematic debugging plan to isolate the cause, including what to measure on the power rails and ground, what scope/current measurements to collect, likely hardware and firmware root causes, and both short-term and long-term fixes to propose to hardware and firmware teams.
Implement a polling loop in C that waits for a hardware-ready bit in a 32-bit status register and returns an error if the device doesn't become ready within a specified millisecond timeout. Your implementation should: sleep or yield appropriately (not busy spin forever), include memory barrier considerations for MMIO reads, and handle spurious reads. Provide the function prototype: int wait_ready(uintptr_t base, uint32_t offset, uint32_t ready_mask, uint32_t timeout_ms).
Unlock Full Question Bank
Get access to all Hardware/Software Co-Design and Resource Constraints interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.