Texas Instruments Firmware Engineer Interview Questions

Interview questions and coding challenges based on skills from public Texas Instruments job postings.

Not affiliated with or endorsed by Texas Instruments. Texas Instruments is a trademark of its owner, used here only to say which postings this page describes.
To ask for a change or removal: support@ohmwork.io

Start practicing

From public job postings

SkillPostings
Embedded C2 of 4
Firmware for microcontrollers and their peripherals4 of 4
Device drivers, on bare metal and under an RTOS2 of 4
Serial interfaces: UART, SPI, I2C and GPIO1 of 4
Software released to customers, such as SDKs and reference code4 of 4
An RTOS such as FreeRTOS, or bare metal4 of 4
Debugging in development and in customers' production systems4 of 4
Schematics, datasheets and hardware debug tools1 of 4
Test driven development and code coverage4 of 4
Code reviews and coding standards4 of 4
ROM code Not practiced here2 of 4
Toolchain support Not practiced here2 of 4
Microcontroller security, including authentication Not practiced here2 of 4
Battery gauge firmware Not practiced here2 of 4
IEEE 802.15.4 wireless stacks: Zigbee, Thread and Matter Not practiced here1 of 4
Sources (8)
  1. Embedded Software Engineer Dallas, TX, checked November 28, 2026
  2. Software Development Engineer Dallas, TX, checked November 28, 2026
  3. Software Development Engineer, BGP Santa Clara, CA, checked November 28, 2026
  4. Software Applications Engineer Dallas, TX, checked November 28, 2026
  5. MSPM0 SDK User Guide, SDK Overview software-dl.ti.com, checked November 28, 2026
  6. MSPM0 TI-Driver Library Overview software-dl.ti.com, checked November 28, 2026
  7. MSPM0G1X0X_G3X0X TI-Driver Library, UART.h File Reference software-dl.ti.com, checked November 28, 2026
  8. MSPM0 Driver Library Overview software-dl.ti.com, checked November 28, 2026

Registers and peripherals

4 of 4 jobs

Port A's other pins already drive other circuits, and you must make PA5 an output and blink it. How do you write the port's registers without disturbing the rest?

Change only PA5's bits. In GPIOA_MODER each pin owns two bits, PA5 bits 11 and 10, and the pair may hold any value when main starts, so clear it first, GPIOA_MODER &= ~(3u << 10);, then set output, GPIOA_MODER |= 1u << 10;. Drive the pin through GPIOA_BSRR: 1u << 5 sets PA5 and 1u << 21 clears it, in one write that leaves every other pin alone. Assigning a whole register, such as GPIOA_ODR = 1u << 5;, rewrites the other fifteen pins with it.

Practice it: As Found

You must set one bit in a sensor's control register over SPI and leave its other bits as they are. How do you do it, and when is that still not safe?

Read, modify, write: read the register into a copy, OR in the bit (or AND out a mask to clear one), and write the whole copy back, each command in its own chip select frame. Every byte you send brings one back, so on many sensors the read is a command byte with bit 7 set followed by a dummy byte, and the copy is the byte that dummy returns. It is not safe when something else can change the register between your read and your write, such as an interrupt handler or another task using the same device: guard the sequence, or give the device one owner. Nor is it safe when the register holds bits the device itself changes or that act when written, such as a status flag cleared by writing 1: check the datasheet for each bit you write back.

Practice it: Flight Recorder

Drivers and their APIs

4 of 4 jobs

A UART driver you ship to customers offers blocking, callback and nonblocking modes. What does each mode ask of the code that calls it?

Blocking: the call returns when the transfer is done or a timeout passes, so it suits a task that can wait, and it must never be called from an interrupt handler. Callback: the call starts the transfer and returns at once, and the driver later calls your function, which may run in interrupt context, so the function must be short and never block, and the buffer must stay valid until it runs. Nonblocking: the call takes or sends only what it can right now and returns at once with how many bytes that was; when it could move none, its status says so, and the caller tries again later. Every mode returns a status code the caller checks, kept apart from the data.

How does an I2C driver tell that no device answered at an address, and what should it report?

After the address byte, the controller reads the ninth bit: a device that is there pulls SDA low (ACK), and an empty address leaves it high (NACK). On the STM32F4 the I2C peripheral sets ADDR (bit 1 of I2C_SR1) on an ACK, and AF (bit 10) on a NACK. On a NACK the driver sends STOP, clears AF by writing it to 0, and returns a status that means no device. It must not return a value like 0xFF as if it were data, and every wait for a flag needs a timeout, so a stuck bus cannot hang the caller.

Practice it: Census

An SPI driver writes a register address and then reads two bytes in one transaction. When may it raise chip select?

Only after the last byte has finished shifting. Chip select stays low for the whole command, address and data alike, because many sensors end the transaction when it rises. On the STM32F4, TXE set means only that the transmit buffer is free, not that the byte has left the shift register. So read each returned byte when RXNE sets, and after the last one, check that BSY is clear before driving chip select high. Raising it on TXE alone cuts the last byte short.

Practice it: Roll Call

RTOS and bare metal

4 of 4 jobs

An interrupt hands each edge it sees to a FreeRTOS task, and edges come in bursts. What must the handoff be, and which calls may the handler make?

A handoff that counts, such as a counting semaphore or a queue: a binary semaphore holds only one pending event, so edges that come while the task is busy are lost. The handler clears its pending flag, calls only the FromISR versions of the kernel calls (xSemaphoreGiveFromISR), passes the address of a flag that the call sets when a higher priority task was woken, and ends with portYIELD_FROM_ISR so that task runs as soon as the handler exits. It never makes a call that blocks. On Cortex-M, an interrupt that calls the kernel must have a priority value at or above configMAX_SYSCALL_INTERRUPT_PRIORITY, which means no more urgent than that level.

Practice it: Turnstile

A FreeRTOS task must call a sampling function every 100 ms, and the function takes between 5 and 35 ms. Why does vTaskDelay drift, and what keeps the period fixed?

vTaskDelay counts from the moment it is called, so the time the work took is added to every period and the calls drift later and later. vTaskDelayUntil counts from a stored wake time and adds the period to that time, not to the current tick: store the tick count once before the loop, TickType_t due = xTaskGetTickCount();, then in the loop call vTaskDelayUntil(&due, pdMS_TO_TICKS(100)) and sample. The call moves due on by one period each time, so work that ends inside its period never moves the next one.

Practice it: Clockwork

A driver must run both on bare metal and under an RTOS. What changes in how it waits for a transfer to finish?

On bare metal it polls a status flag, or its interrupt handler sets a volatile flag that the main loop checks, perhaps sleeping with WFI between checks, with interrupts masked from the check to the WFI so an interrupt that lands in between still wakes it. Under an RTOS the calling task blocks on a semaphore that the handler gives when the transfer ends, so other tasks run while it waits, and a timeout on the wait reports a stuck transfer. Keeping those calls behind one small layer lets the rest of the driver stay the same in both.

Debugging at the hardware boundary

4 of 4 jobs

A board's only serial port goes to its radio module, so debug text there would break the link. How can the firmware still print debug lines?

Through the core's own debug channel. On a Cortex-M4 such as the STM32F4, the ITM sends text over the trace pin to the debugger on stimulus port 0. It starts off and locked: set TRCENA (bit 24 of DEMCR), unlock it by writing 0xC5ACCE55 to the ITM lock access register, set ITMENA in ITM_TCR, then set bit 0 of ITM_TER. The debugger usually sets up the trace pin itself when it starts reading, on the STM32F4 through TRACE_IOEN in DBGMCU_CR and the TPIU. Route printf's output there by writing _write to send each character to port 0, waiting until the port can take it. The serial port carries nothing.

Practice it: Back Channel

An I2C temperature sensor answers on the bus, but its reading never changes. Its datasheet says it powers up in shutdown. What must the driver do first?

Wake it before the first read: write its configuration register with the shutdown bit clear, in one write transaction of the device address, the register number, then the value. On the STM32F4, set START and wait for SB, write the address shifted left by one and wait for ADDR, clear ADDR by reading I2C_SR2 right after the I2C_SR1 read that saw it set, write the register number and wait for TxE, write the value, and set STOP only once BTF says the last byte has left. A STOP set earlier goes out before that byte. Bring-up starts from the datasheet's power-up steps, followed in order.

Practice it: Thermometer

A customer's board reboots in the field and you cannot make it happen on your bench. What should the firmware tell you on the next boot?

Why it reset. On the STM32F4, RCC_CSR at offset 0x74 from the RCC base holds reset flags: IWDGRSTF (bit 29) and WWDGRSTF (bit 30) for the watchdogs, SFTRSTF (bit 28) for a software reset, LPWRRSTF (bit 31) for a low power reset, PORRSTF (bit 27) for power on, BORRSTF (bit 25) for a brownout and PINRSTF (bit 26) for the reset pin. Check the watchdog, software and low power flags first, then power on before brownout, and the pin flag last, since a power on sets the brownout and pin flags too and the other resets also set the pin flag. Log the cause, then clear the flags by setting RMVF (bit 24). A fault handler that saves the stacked program counter to memory that survives a reset tells you where it died.

Testing and code review

4 of 4 jobs

A sensor sends readings from 0 to 255, and the code keeps a reading only when it is at most 85, yet a glitch byte of 0xFF gets through. What went wrong, and which test values would have caught it?

The reading was kept in a signed 8 bit type, int8_t, so 0xFF became -1 and 0xC8 became -56, both at most 85, and every byte with its top bit set passed. Store it in a type that matches what the sensor sends, uint8_t. A coding rule that a variable's type matches the range of what fills it, checked in review, stops this before any test runs, and a test of the check at its edges and at the special values catches it before the board does: 0, 85, 86, 0x7F, 0x80 and 0xFF.

Practice it: Fallback

How do you unit test driver code that reads and writes hardware registers without the board?

Keep the register access behind one thin layer, a pointer to a struct of registers or a few small functions, so a host build can point it at plain memory. The test then sets status bits to drive each path, including the error and timeout paths, runs the driver, and checks what it wrote and what it returned. A hardware in the loop bench still checks the timing and the real peripheral, which a host test cannot.

Also recommended

Interrupts and shared data

A pulse counter on an external interrupt line reports twice the pulses the scope shows. What is the first setting to check?

Which edges trigger the line. On the STM32F4, EXTI_RTSR and EXTI_FTSR choose rising and falling edges for each line, and with both set, each pulse sets the line's pending flag at its start and again at its end, so a pulse wider than the handler's latency is counted twice. Arm only the edge where a pulse starts. Halving the count, or reading the pin in the handler to skip falling edges, fails on a short spike that is over before the handler runs.

Practice it: Stampede

Main waits for a flag that an interrupt handler sets. At -O0 it works, and at -O2 main never leaves the loop. Why, and what fixes it?

Without volatile, the compiler may read the flag once, keep it in a register and never read memory again, since nothing it can see in main changes it. Declare every variable the handler writes and main reads volatile, so each read goes to memory. When main also writes a shared variable, or it takes more than one load to read, a handler can run in between, so read and clear it with the interrupt briefly masked.

Practice it: Phantom

Go deeper

Related

Loading the interactive arena.