Wi-Fi, Bluetooth LE and Thread share one slice of 2.4 GHz air. Their frames collide, unless something decides who talks next. Here you play that something.
Learn why a small connected device loses packets when its own radios shout at once, and how channel choice, hopping, a three-wire arbiter and antenna design fix it.
Slide the Wi-Fi load up, then flip between Free for all and Arbitrated. Count the red frames, then count the yellow waits. Then we build, piece by piece, the spectrum, the airtime, the hopping, the arbiter, the antennas and the Thread mesh that Matter rides on.
You need a feel for what a radio packet is (a short burst of bits sent through the air) and a little C. We build the rest from zero. Bluetooth LE from radio to GATT is the one lesson to read first.
Built from primary sources: the Nordic nRF Connect SDK coexistence guide, the OpenThread primer, and Memfault’s Interrupt post Connecting Matter-over-Thread Devices to the Internet (24 March 2026). The devices are models, not real radios. The Field Guide lists every source.
A model, not a measurement. Worst case: all three radios sit on overlapping channels, so any two frames that overlap in time are both damaged. Wi-Fi frames last 0.4 to 2.6 ms (illustrative). A Bluetooth LE connection event is two 296 µs packets 150 µs apart, every 15 ms. A Thread frame is a full 127-byte frame, 4.256 ms on air. Traffic is seeded, so the same roll gives the same picture.
Chapter 0
See why a smart-home device fights itself for airtime, and meet the three cures that the rest of the lesson builds
You press the button on a new smart plug. Your phone says “Adding device.” Ten seconds later the plug is on your home Wi-Fi. Behind that calm screen, the plug and the phone talked over Bluetooth LE. Then the plug joined Wi-Fi. A lamp three metres away kept chatting on its own Thread network.
All three radios used the same stretch of air. It is called the 2.4 GHz band: radio frequencies from about 2.4 to 2.4835 GHz that anyone may use without a licence. Think of one room where three groups talk at once. Each group is polite alone. Together they drown each other out.
Firmware has to make them share. The name for this job is coexistence: keeping several radios useful when they sit close together and use the same band. This lesson is about that job, and it ends where a Matter device lives, on a Thread mesh or on Wi-Fi.
Wi-Fi moves a lot of data fast. A frame (one burst of bits sent as a unit) is short on the air, because the bit rate is high. Bluetooth LE (BLE) moves little data, in tiny scheduled bursts, so a coin cell can last. Thread is a low-power mesh built on IEEE 802.15.4, a radio standard with a 250 kbit/s rate and frames of up to 127 bytes. Matter is the smart-home language on top. It runs over IPv6 on Wi-Fi or Thread.
Many real products carry two or three of these. Pick a product below and see which radios share the band, and which share an antenna (the metal shape that turns electric signals into radio waves).
Choose a product. The blue, purple and orange boxes are its radios. The pink bar is the one band they all use.
Illustrative product sketches, not specific products. Which radios a Matter device carries depends on its design. Matter uses Bluetooth LE to set a new device up, then runs on Wi-Fi or Thread.
In every case the radios share one band. Wi-Fi and Thread may also share one chip, one clock and one antenna. The rest of this lesson tests that sharing.
Two people can stop talking over each other in only three ways. They speak at different pitches. They speak at different times. Or they stand in different places. Radios have the same three tools.
Try the first picture now. In the hero, “Free for all” has no rule, so frames pile on top of each other. “Arbitrated” adds a referee. The referee protects the small radios and makes Wi-Fi wait. That trade, loud and fast against quiet and fragile, is the whole story.
The last chapters move up the stack. Chapter 6 builds a Thread mesh. Chapter 7 shows how Matter sits on it. Chapter 8 shows what failure looks like, with numbers you can measure. Chapter 9 gathers everything into a field guide.
Suppose a Thread frame lasts 4.256 ms and a Wi-Fi frame starts 3 ms after it. The two overlap for 1.256 ms. In that stretch the receiver hears a blend of both signals. Some bits flip.
The receiver finds out because every frame ends with a check value. A Bluetooth LE packet ends with a 3-byte CRC (cyclic redundancy check). An 802.15.4 frame ends with a 2-byte frame check sequence. The receiver recomputes the check from the bits it heard. If the result differs, it drops the frame and stays silent.
The sender notices the silence. A Thread sender waits for an acknowledgement frame. None comes, so the MAC (media access control, the layer that owns the air) sends the frame again. A Bluetooth LE sender retries at the next connection event. Either way a collision costs time, and time costs battery.
One honest detail. A much stronger signal can sometimes survive an overlap with a weaker one. Radio engineers call this the capture effect. Our models ignore it and count every overlap as a loss. That is a worst case, and it is the right case to design for.
Take a Matter plug during setup. Its Bluetooth LE link runs one connection event every 15 ms. Each event lasts 742 µs in our model. That is 742 / 15 000, about 5% of the air. Its Wi-Fi radio is busy 40% of the time in the hero’s first picture. Together they ask for about 45% of the air. That sounds like it fits.
It fits only if the demands line up one after the other. Nothing makes them line up. Each radio picks its start times alone, so overlaps happen by chance. With Wi-Fi at 40%, a Bluetooth LE event that starts at a random moment lands inside a Wi-Fi frame about 40% of the time. Chapter 2 turns that into a full formula.
Each radio has its own driver and its own scheduler. The Bluetooth LE controller wakes for its next connection event. The Thread stack (OpenThread) wakes when a frame is queued or a poll is due. The Wi-Fi firmware sends whenever its queue holds data. None of the three knows what the others plan.
Coexistence adds one more actor: a shared decision point that sees every request. On a Nordic part that point lives in the multiprotocol service layer (MPSL), plus a wire to the Wi-Fi chip. Chapter 4 opens it up. For now hold one picture: three queues of frames, one band, and a gate that either exists or does not.
Each cure trades something. Frequency separation costs nothing at run time, but it needs spare channels, and the neighbours decide how many exist. Time separation costs waiting: someone’s frame is delayed. Space separation costs board area and parts, or a switch that also forces waiting.
The order matters. Pick channels first, because that is free. Add an arbiter next, because it is cheap in firmware. Decide the antennas last in the lesson, but first on the board, because layout is fixed once the board is built.
Chapter 1
Place every Wi-Fi, Bluetooth LE and Thread channel on one ruler and find the gaps where small radios can live
Imagine a long shelf, 85 units wide, labelled 2400 to 2485. Each unit is one megahertz (MHz): a million cycles per second. Every radio on your desk rents a slot on this shelf. A slot is a channel: a centre frequency plus the width the signal fills around it.
The slots are not the same size. Wi-Fi rents wide slots, Bluetooth LE and Thread rent narrow ones. Whether two radios collide depends on one question: do their slots overlap on the shelf?
A common Wi-Fi channel in this band is 20 MHz wide. Channel 1 is centred on 2412 MHz, channel 6 on 2437 MHz and channel 11 on 2462 MHz. Centres sit 5 MHz apart, so channels 1, 6 and 11 are 25 MHz apart. A 20 MHz slot around each fits with room to spare.
Take channel 6. Its slot runs from 2437 minus 10 to 2437 plus 10, which is 2427 to 2447 MHz. That is the footprint of channel 6: every frequency its signal fills. Channels 1 and 11 give 2402 to 2422 and 2452 to 2472. Between the three footprints are gaps of 5 MHz.
Bluetooth LE uses 40 channels, each 2 MHz wide, from 2402 to 2480 MHz. Three are advertising channels, where a device announces itself: channel 37 at 2402 MHz, channel 38 at 2426 MHz and channel 39 at 2480 MHz. The other 37 carry data in a connection.
Look where the three advertising channels sit. Channel 38 at 2426 MHz is in the 5 MHz gap between Wi-Fi 1 and Wi-Fi 6. Channel 39 at 2480 MHz is above Wi-Fi 11. Channel 37 touches the lower edge of Wi-Fi 1. They sit in or near the gaps between the common Wi-Fi channels, so at least one is often clear.
Thread uses IEEE 802.15.4 in the same band. It has 16 channels, numbered 11 to 26, spaced 5 MHz apart. The centre of channel k follows one line of arithmetic.
Channel 20: 2405 + 5 × (20 − 11) = 2405 + 45 = 2450 MHz. Channel 26: 2405 + 75 = 2480 MHz.
Now overlay everything. Switch the three Wi-Fi channels on and off below. A Bluetooth LE or Thread channel turns red when its centre lies inside an active Wi-Fi footprint.
Blue blocks are Wi-Fi footprints. Purple ticks are the 40 Bluetooth LE channels, orange ticks the 16 Thread channels. Red means a channel sits under active Wi-Fi.
Channel centres: Wi-Fi 2412, 2437, 2462 MHz (20 MHz wide). Bluetooth LE channel 37 at 2402, 38 at 2426, 39 at 2480, data channels 0 to 10 at 2404 to 2424 and 11 to 36 at 2428 to 2478 MHz. Thread 2405 + 5(k − 11) MHz. A channel counts as covered when its centre is within 10 MHz of a Wi-Fi centre. Real radios also leak a little outside their footprint; this model ignores that.
Leave only Wi-Fi 6 on, and the lower Thread channels 11 to 15 are clear. Turn on all three, and Thread has four clear channels: 15, 20, 25 and 26. Put Thread on a channel that falls in a Wi-Fi gap or above Wi-Fi 11, and let a scan of your own room decide.
Bluetooth LE has little choice, because it needs 37 data channels to hop across. With all three Wi-Fi channels on, only six of its 37 data channels are clear. The next chapters show how BLE copes anyway.
Channel choice is data, not magic. A Thread network stores one channel number in its dataset. A BLE connection stores a 37-bit map, one bit per data channel. Wi-Fi stores a channel in its access point settings. In each case the firmware decision is the same: read the neighbours, then pick the quiet slot.
On real hardware: use an nRF52840 DK with a spectrum or sniffer tool, or a Wi-Fi scanner on a phone, to list the Wi-Fi channels in your room. Repeat the check in the lab and at home. The busy channels will differ.
Your scan at home shows Wi-Fi on channels 1 and 11 only. Channel 1 fills 2402 to 2422 MHz. Channel 11 fills 2452 to 2472 MHz. A channel whose centre lies between 2423 and 2451 MHz, or above 2472 MHz, is clear in this model.
Apply the Thread formula to each channel. Channels 15 to 20 sit at 2425, 2430, 2435, 2440, 2445 and 2450 MHz. Channels 25 and 26 sit at 2475 and 2480 MHz. That leaves 8 clear Thread channels out of 16.
Which one? Pick the channel farthest from both Wi-Fi centres, because real radios leak a little outside their footprint. Channel 17, at 2435 MHz, is 23 MHz from Wi-Fi 1 and 27 MHz from Wi-Fi 11. Channel 18, at 2440 MHz, is 28 and 22. The worst-case distance is 23 MHz for channel 17 and 22 MHz for channel 18. Choose channel 17.
Now the Bluetooth LE map. Data channels 0 to 9 and 23 to 33 sit under Wi-Fi. Channels 10 to 22 and 34 to 36 are clear. That is 13 + 3 = 16 clear channels out of 37, enough to hop across.
Thread channel 17 sits at 2435 MHz. Bluetooth LE data channel 14 sits at 2434 MHz and channel 15 at 2436 MHz. An 802.15.4 signal is about 2 MHz wide at its strongest, so those two Bluetooth LE channels sit inside it. A device that carries both radios should keep them apart in time, with the arbiter of Chapter 4, or drop those channels from its map.
Plans also age. A home router may pick a new Wi-Fi channel by itself. Thread can move a whole mesh to a new channel with a coordinated dataset update, but the mesh keeps the old channel until the switch time. Scan again after any change in the neighbourhood.
Chapter 2
Turn a bit rate into milliseconds and see why a slow radio is the easiest one to hit
A courier can carry a letter across town in a minute. A tractor can carry the same letter in an hour. If a road is shared, the tractor blocks traffic longer and meets more cars. Radios behave the same way. The time a frame spends on the air is its airtime, and every other radio can only wait or collide.
Airtime is simple arithmetic. Divide the bits in the frame by the bit rate, the number of bits the radio sends each second.
Thread's 802.15.4 radio sends 250 000 bits per second. One byte is 8 bits, so one byte takes 8 divided by 250 000 seconds, which is 32 microseconds (µs). A Bluetooth LE radio on the 1 Mbit/s PHY (the physical layer, the radio mode) takes 8 µs per byte. A Wi-Fi link at 54 Mbit/s takes about 0.15 µs per byte.
Now build real frames. A full Thread frame is 127 bytes, the 802.15.4 limit. The radio also sends a 6-byte header first (a preamble, a start marker and a length). That makes 133 bytes at 32 µs each.
Thread: (127 + 6) bytes × 32 µs = 4256 µs = 4.256 ms
A Bluetooth LE data packet carries a 1-byte preamble, a 4-byte access address, a 2-byte header, the payload and a 3-byte CRC check. With 27 payload bytes that is 37 bytes at 8 µs each.
BLE: (1 + 4 + 2 + 27 + 3) bytes × 8 µs = 296 µs. A two-packet exchange, with the 150 µs gap between packets: 296 + 150 + 296 = 742 µs
That 742 µs event is what the hero draws as the small purple pair. The Thread frame is nearly six times longer. The idea: the slow, low-power radio lives on the air much longer per frame. Try the device below.
The top bars show how long the same payload stays on air. The bottom bars show how often a frame of that length overlaps Wi-Fi traffic. Drag both sliders.
Thread: (6 + bytes) × 32 µs, with the payload counted as the whole frame. Bluetooth LE 1M PHY: (10 + bytes) × 8 µs. Wi-Fi: 20 µs preamble plus bytes × 8 / 54 µs, ignoring waits and acknowledgements, so it is a lower bound. The Wi-Fi traffic model is illustrative: frames of 0.4, 1.0, 1.8 or 2.6 ms, spaced at random.
A frame is hit if a Wi-Fi frame is on the air when it starts, or if a Wi-Fi frame starts while it is still on the air. Call the Wi-Fi busy fraction load. The first case happens with probability equal to the load. The second case needs the gap before the next Wi-Fi frame to be shorter than your frame.
Work it for a Thread frame at 40% load. The gap is g = 1.45 × 0.6 / 0.4 = 2.175 ms. Then T/g = 4.256 / 2.175 = 1.957, and e to the minus 1.957 is 0.141. So P is 0.4 + 0.6 × (1 − 0.141) = 0.4 + 0.515 = 0.915. Nine Thread frames in ten are hit.
Now the BLE packet of 0.296 ms. T/g = 0.136, e to the minus 0.136 is 0.873, so P = 0.4 + 0.6 × 0.127 = 0.476. A short packet is hit about half the time. Same traffic, same load, and the long frame fares much worse.
Symptom: a Thread sensor reports fine at night and drops reports in the evening, when someone streams video. Measurement: read the MAC (media access control) counters on the sensor. Count frames sent, acknowledgements missed and retries. Compare the miss rate with Wi-Fi load.
Fix: the cheapest fixes shorten or move the frame. Send smaller payloads. Move Thread to a clear channel, as in Chapter 1. The costly fix is an arbiter, which is Chapter 4. Retries do help, but each retry is another long frame on a busy channel.
On real hardware: use an nRF52840 DK running an OpenThread sample, and a second board as a sniffer. Time one frame on a logic analyzer or sniffer capture. It should read close to the 4.256 ms you computed for a full frame, shorter for smaller ones.
The same formula gives a whole table. Work it for each load with the full Thread frame (4.256 ms) and the 27-byte Bluetooth LE packet (0.296 ms). Every row uses g = 1.45 × (1 − L) / L.
| Wi-Fi load | Gap g | Thread frame hit | BLE packet hit |
|---|---|---|---|
| 10% | 13.05 ms | 0.35 | 0.12 |
| 20% | 5.80 ms | 0.62 | 0.24 |
| 40% | 2.18 ms | 0.92 | 0.48 |
| 60% | 0.97 ms | 0.995 | 0.71 |
Read the 10% row. Light Wi-Fi traffic still hits a full Thread frame one time in three. Read the 60% row. The Thread frame is hit almost every time, because the gaps between Wi-Fi frames (0.97 ms) are far shorter than the frame itself. Even the short Bluetooth LE packet is hit seven times in ten.
Two things make the real world kinder. First, an 802.15.4 radio listens before it sends. This step is the clear channel assessment: if the air is busy, the radio waits a random short time and tries again. So some of the model’s hits never happen, because the Thread radio stays quiet. Second, a strong signal can survive an overlap with a weak one.
Two things make the real world harsher. Wi-Fi radios may not defer to a low-power 802.15.4 signal, so Wi-Fi can start in the middle of your frame. And a hit frame is not free: the retry needs another listen, a random wait and another long frame. Treat the model as a ranking tool. It shows that long frames and heavy load hurt most. It is not a prediction for your board.
Count a Thread sender that gets hit. The data frame takes 4.256 ms. The sender then waits for an acknowledgement and finds none. The wait is on the order of a millisecond (the standard sets it at 54 symbols of 16 µs, which is 0.864 ms). Then comes a random backoff and a second 4.256 ms frame. One loss therefore costs more than 5 ms of extra airtime plus the radio’s receive time, all of it on a battery.
Chapter 3
Watch a Bluetooth LE link jump between 37 channels, then tell it to skip the ones Wi-Fi has taken
You and a friend talk across a crowded station. A loud group stands in one corner. If you both keep your spot, you shout all day. If you walk to a new spot after every sentence, only some sentences land in the loud corner. If you also agree never to walk near the loud corner, none do.
That is frequency hopping: the two ends of a link change channel on a fixed schedule. Bluetooth LE does it on every connection. Adaptive frequency hopping adds one step: the link drops bad channels from the schedule.
A BLE connection is a series of connection events, one every connection interval (for example every 15 ms). Each event uses one data channel. Both devices know the next channel without talking, because both run the same rule. Under the original channel selection algorithm, the rule is one line.
With hop = 7, starting at 0: 7, 14, 21, 28, 35, then (35 + 7) mod 37 = 5, 12, 19, 26, 33, 3, …
The word mod means “the remainder after dividing”. 42 divided by 37 leaves 5. Because 37 is prime, any hop visits all 37 channels before it repeats. Each channel gets an equal share of events.
Now add the adaptive step. The central device keeps a channel map: 37 bits, one per data channel, where 1 means “use it”. It sends the map to the peripheral in a Link Layer control message. At least two channels must stay on.
What if the rule lands on a channel that is off? The two devices remap. Count the channels that are still on, and call that number N. Take the unmapped index mod N, and use that position in the sorted list of channels that are on.
Work an example. Wi-Fi 6 covers Bluetooth LE data channels 11 to 20. Turn them off. Channels 0 to 10 and 21 to 36 stay on: 11 + 16 = 27 channels. The rule lands on 14, which is off. So 14 mod 27 = 14. The sorted list is 0, 1, … 10, 21, 22, 23, 24, … Position 14 holds 24 (positions 0 to 10 hold channels 0 to 10, then position 11 holds 21, 12 holds 22, 13 holds 23, 14 holds 24). The link uses channel 24 instead.
Bars show how many of 300 connection events used each data channel. Blue-edged cells sit under the chosen Wi-Fi channel. Red marks events that were hit. Turn on the channel map and watch the red vanish.
Model: hop = 7, 300 events, an event on a covered channel is hit with probability equal to the Wi-Fi busy fraction. Seeded, so repeatable. A real controller also retries within the interval, and measures per-channel error rate to build its map.
A phone-sized central usually watches packet errors per channel and builds the map from them. A chip that carries both Wi-Fi and Bluetooth LE can do better, because its firmware already knows the Wi-Fi channel. It writes the map directly, before the first lost packet. Zephyr exposes this as bt_le_set_chan_map(), which takes five bytes, one bit per channel, 37 bits in all.
Bluetooth LE hops, so a bad channel costs only a share of events. Thread does not hop. A Thread network sits on one channel, which is why Chapter 1's channel choice matters so much more for it.
Symptom: a BLE sensor streams smoothly until a phone starts a video call, then data arrives late and in bursts. Measurement: log retransmissions per channel from the controller. The bad channels line up with the Wi-Fi footprint. Fix: update the channel map to exclude them. The cost is fewer channels to hop over, so the link has less room if a second interferer shows up.
There is a floor. The map must keep at least two channels on. Long before that, a thin map hurts: with only a handful of channels left, one new interferer can cover most of them. Treat the map as a tool for removing known trouble, and re-check it when the neighbours change.
On real hardware: connect an nRF52840 DK to a phone, run a Wi-Fi speed test on the same phone, and read the link's retry counts per channel with a sniffer. Repeat with a map that excludes Wi-Fi's channels.
Take hop = 7 and Wi-Fi 6 covering data channels 11 to 20. The map turns those ten channels off, so 27 channels stay on. The sorted list of channels that are on holds positions 0 to 10 as channels 0 to 10, and positions 11 to 26 as channels 21 to 36. Position p from 11 up holds channel p + 10.
| Event | Unmapped index | On? | Channel used |
|---|---|---|---|
| 1 | 7 | yes | 7 |
| 2 | 14 | no, 14 mod 27 = 14 | 24 |
| 3 | 21 | yes | 21 |
| 4 | 28 | yes | 28 |
| 5 | 35 | yes | 35 |
| 6 | 5 | yes | 5 |
| 7 | 12 | no, 12 mod 27 = 12 | 22 |
| 8 | 19 | no, 19 mod 27 = 19 | 29 |
| 9 | 26 | yes | 26 |
| 10 | 33 | yes | 33 |
| 11 | 3 | yes | 3 |
| 12 | 10 | yes | 10 |
Without the map, events 2, 7 and 8 land on channels 14, 12 and 19. All three sit under Wi-Fi 6. That is 3 of 12 events, 25%, on trouble. With the map, they move to channels 24, 22 and 29, which are clear. The sequence of unmapped indexes never changes. Only the final lookup does.
The central cannot just change its mind. The peripheral must change on the same event. The central sends the new 37-bit map in a Link Layer control message, together with an instant: a future connection event counter. Both devices keep the old map until that event, then switch together. The cost of a map update is one control packet, so update when the picture changes, not every second.
Bluetooth 5.0 added a second channel selection algorithm. It picks each channel from the access address and the event counter, so the sequence looks random and spreads events more evenly. The remapping idea stays the same: a channel that is off is replaced by one that is on. This lesson teaches the first rule because it fits in one line of arithmetic.
Advertising hops too, but with no map. An advertiser sends the same packet on channels 37, 38 and 39 in turn. If Wi-Fi blocks one, the other two may still get through. The three advertising channels sit far apart, so one busy Wi-Fi channel rarely blocks all three. Busy Wi-Fi 1, 6 and 11 together can.
Chapter 4
Wire three signals between two radios and watch a referee turn collisions into short, countable waits
Two cooks share one stove. Each could grab it, and sometimes they burn each other's pans. A better kitchen has a rule: before you light a burner, you call out. The head cook answers yes or no. Nobody lights up without a yes.
Radios can do this. A small circuit, or a piece of firmware, called a PTA (packet traffic arbiter) decides who may transmit now. Each radio asks first. The PTA answers. This is separation in time, and it is exact: no overlap, by construction.
The common wiring uses three signals. The short-range radio (Bluetooth LE or Thread) drives REQUEST: “I want to send or receive soon.” It drives PRIORITY: “this one is urgent or not.” The PTA answers on GRANT: “go ahead.”
The nRF Connect SDK supports several wirings. A generic three-wire interface uses REQUEST, PRIORITY and GRANT. The Nordic nRF70 Series Wi-Fi chips use COEX_REQ, COEX_STATUS0 and COEX_GRANT. A one-wire variant has GRANT only. In the SDK these map to Kconfig options CONFIG_MPSL_CX_3WIRE, CONFIG_MPSL_CX_NRF700X and CONFIG_MPSL_CX_1WIRE. MPSL is Nordic's multiprotocol service layer, the radio scheduler that the coexistence API lives in.
The exact policy differs between chips. Here is the simplest honest model of it. It is our model, not Nordic's exact policy.
/* A model of one 3-wire PTA decision at the moment REQUEST rises. */ bool pta_grant(bool wifi_in_flight, bool pri_high) { if (pri_high) { return true; /* Wi-Fi is told to stop; it retries after the event */ } return !wifi_in_flight; /* low priority: only if the air is idle */ }
Low priority is polite. The short-range radio waits for a quiet moment, and if Wi-Fi is mid-frame it loses that event. High priority is firm. Wi-Fi stops, the short-range radio runs, and Wi-Fi resends. In both cases, no two frames overlap. The cost moves from the radio that gets damaged to the radio that waits.
Which events deserve high priority? Not all of them. A connection event that keeps a link alive is worth it. A scan that looks for new devices is not. A good policy marks few events as high, because each one makes Wi-Fi stand aside. If every event is high, the arbiter has nothing left to arbitrate, and Wi-Fi pays for everything.
Each Bluetooth LE event raises REQUEST 0.4 ms early. A pink GRANT pulse means the arbiter said yes. A red cross means it said no. Switch the priority and compare who pays.
A model of the decision, not a capture from a chip. GRANT is drawn as asserted = high; the Nordic nRF70 devicetree example marks its pin active low. Wi-Fi frames are 0.4 to 2.6 ms (illustrative). Bluetooth LE events are 0.742 ms every 15 ms. Thread is off in this view.
Run it. With PRIORITY low and Wi-Fi at 50%, several Bluetooth LE events get a red cross: Wi-Fi was mid-frame, so the event is lost and retried 15 ms later. With PRIORITY high, every event is granted, and Wi-Fi frames wait or restart instead.
The arbiter needs time to answer. A radio cannot send the instant it asks. The SDK guide for the one-wire interface says to deny short-range activity at least 400 microseconds before the other radio's activity. The reason: MPSL interrupts run at priority 0 and can delay the GPIOTE (GPIO tasks and events) interrupt that reads the wire.
The SDK's nRF70 devicetree example also sets grant-gpios to active low with a pull-down. A pull-down resistor holds the pin low when nobody drives it. Active low means low is “granted”. So if the Wi-Fi chip is powered off, the pin floats low and the short-range radio is granted every time. A good default: no Wi-Fi, no waiting.
Symptom: a Bluetooth LE link drops during Wi-Fi uploads. Measurement: probe REQUEST and GRANT with a logic analyzer. Count requests without a grant. If connection events keep being denied, you will see long runs of REQUEST pulses with GRANT flat. Fix: raise the PRIORITY of the events that keep the link alive, and keep low priority for the optional ones.
On real hardware: an nRF7002 DK has the Wi-Fi chip and an nRF5340 on one board, with the coexistence lines wired. Probe the three coexistence pins with a logic analyzer while Wi-Fi iperf runs and a BLE link is open, then count denied requests per second.
Follow one Bluetooth LE connection event. All times are illustrative. The event is due at t = 0. The radio raises REQUEST at t = −0.4 ms. At that moment a Wi-Fi frame of 1.8 ms has been on the air for 0.5 ms, so Wi-Fi has 1.3 ms left.
Low priority. The arbiter sees Wi-Fi in flight and answers no. GRANT stays off. The Bluetooth LE radio skips the event and tries again 15 ms later. Wi-Fi loses nothing. The event is lost, and the link survives only if the next ones succeed.
High priority. The arbiter tells Wi-Fi to stop. The 0.5 ms already sent is wasted, and Wi-Fi must send the whole 1.8 ms frame again later. GRANT turns on. The Bluetooth LE event runs for 0.742 ms with a clean channel. Wi-Fi paid 0.5 + 0.742 ms of its own time, plus a retry.
A request lands inside a Wi-Fi frame with a probability close to the Wi-Fi load. At 50% load, a low-priority request is denied about half the time. A high-priority request is never denied, but it interrupts a Wi-Fi frame about half the time. Bluetooth LE events take only 0.742 / 15, about 5% of the air. So even if every event is high priority, Wi-Fi gives up about 5% of its airtime plus the aborted frames.
That is a cheap price for a stable link, and it is why a policy should mark only the events that keep the link alive. Spend priority like money. A scan, an advertisement or a bulk transfer can wait.
The generic three-wire interface in the Nordic SDK carries REQUEST, PRIORITY and GRANT. On the nRF70 Series the pins are named differently. COEX_REQ is the request input from the Bluetooth LE or 802.15.4 side. COEX_STATUS0 carries the direction, transmit or receive, of the short-range radio’s coming activity. COEX_GRANT is the output the arbiter drives. So the nRF70 pins do not map one to one onto the generic names; read the product specification for yours.
An arbiter can be unfair. If the policy always says no to the short-range radio while Wi-Fi is busy, a long Wi-Fi transfer starves it. Nordic DevZone users reported that during Wi-Fi scans Bluetooth LE transmissions were blocked for about a second at a time, on one SDK version (2.8.0), and it may be fixed since. The lesson for design is general: bound the longest wait, not just the average. Chapter 8 shows why.
grant-gpios active low with a pull-down. If the Wi-Fi chip is powered off, what does the short-range radio see?Chapter 5
Compare two ways to wire the metal, and see what each one costs in lost frames or lost Wi-Fi time
Two people share a phone line. If they have separate phones, they can both talk at once, but their voices bleed through the wall. If they have one phone, they take turns, and each waits for the other to hang up. Radios face the same choice with antennas.
An antenna converts the electric signal on a wire into a radio wave, and back. A device can give each radio its own antenna, or it can connect one antenna to one radio at a time through a switch, a tiny part that picks which radio is wired to the metal. The Nordic coexistence notes call these separate-antenna and shared-antenna modes.
With two antennas, both radios can send and listen at the same time. But a Wi-Fi transmitter next to a Thread receiver is like a shout next to a whisper. The Wi-Fi signal leaks into the Thread receiver and drowns the whisper, even on a different channel.
The measure of that leakage is isolation: how much weaker the Wi-Fi signal is when it reaches the other antenna. It is counted in decibels (dB), a scale where every 10 dB is ten times less power. So 30 dB of isolation means the leaked signal has one thousandth of the power.
Isolation comes from distance, antenna direction, ground planes and filters. Small boards have little room, so isolation is limited. A designer chooses where to put the two antennas first, then checks with measurement.
With a shared antenna, the switch removes leakage: only one radio is connected at any moment. The PTA from Chapter 4 now does two jobs. It decides who may transmit, and it moves the switch.
The cost shows up when a radio needs the antenna all the time. OpenThread's primer says a router keeps its transceiver on at all times. It must be ready to hear a neighbour's frame at any moment. A sleepy end device is different. It sleeps and wakes to poll its parent, so it only needs the antenna for short, planned windows.
Now see what happens if the antenna switches back and forth every 20 ms. A neighbour sends a 4.256 ms Thread frame at a random moment. The frame is received only if it falls fully inside the time the switch points at Thread.
Thread gets 10 of every 20 ms. A frame fits if it starts in the first 10 − 4.256 = 5.744 ms of the slot. Chance: 5.744 / 20 = 29%. The router hears under a third of its neighbours.
Choose a wiring. With separate antennas, drag isolation. With a shared antenna, drag how much of the time the switch points at Thread. Watch the two bars below the lanes.
Illustrative model. Separate: the chance a Wi-Fi frame damages a Thread frame is the overlap chance from Chapter 2 times a leakage factor that falls from 1 at 15 dB to 0 at 40 dB (a made-up ramp). Shared: the switch repeats every 20 ms and a Thread frame is received only if it fits entirely in Thread’s slot; Wi-Fi keeps the rest of the time. Real parts: see the Nordic application note nan_044.
In the separate wiring, the loss is soft. It falls as isolation rises, and Wi-Fi is never held back. In the shared wiring, the loss is hard. Give Thread 100% and it hears everything, but Wi-Fi gets nothing. Give Wi-Fi more and the router goes deaf in proportion.
Choose separate antennas when the device must hear continuously, like a Thread router or a border router. Choose a shared antenna when board space and cost matter and the radios can live on a schedule, like a sleepy sensor that wakes for a chirp. Bluetooth LE fits both: its events are short and planned, so a switch and a PTA can reserve them.
Check configuration limits too. The SDK guide warns not to enable Wi-Fi coexistence on the nRF5340 together with Coded PHY and an external front-end module (FEM, a chip that amplifies and filters the signal), because that can cause unpredictable behaviour. Read the notes for your exact part.
Symptom: a Thread router hears fewer neighbours when its own Wi-Fi radio runs, even on a quiet Thread channel. Measurement: compare packet error rate with Wi-Fi off and Wi-Fi at full load. Measure isolation between the two antenna ports with a network analyser. Fix: move the antennas apart, add a filter, or give the continuous listener its own antenna.
On real hardware: take a board with two radios and run the same Thread link test twice, once with Wi-Fi idle and once with Wi-Fi at full load. Report packet error rate for both.
All values here are illustrative. Say the Wi-Fi transmitter sends at +18 dBm. The unit dBm is decibels relative to one milliwatt, so +18 dBm is about 63 mW. Say the antennas give 20 dB of isolation. The leak reaches the Thread receiver at 18 − 20 = −2 dBm.
Compare that with the signal Thread wants to hear. A good 802.15.4 link may arrive near −80 dBm. The leak is 78 dB stronger, which is a factor of about 60 million in power. A receiver front end saturates long before that, and the weak Thread frame vanishes. Even on a different channel, the filters can only remove so much.
Suppose the receiver tolerates at most −20 dBm of unwanted power before it overloads (an illustrative limit). Then you need 18 − (−20) = 38 dB of isolation. On a coin-sized board, 38 dB is hard. That is why small products often choose the shared antenna and a switch.
Generalise the router example. The switch repeats every 20 ms and gives Thread a slot of S ms. A frame of 4.256 ms is heard only if it starts early enough to finish inside the slot. The chance is (S − 4.256) / 20.
| Thread slot S | Share of time | Chance a 4.256 ms frame is heard |
|---|---|---|
| 6 ms | 30% | 0.09 |
| 10 ms | 50% | 0.29 |
| 14 ms | 70% | 0.49 |
| 20 ms | 100% | 1.00 |
The chance is always lower than the time share. A 70% share gives only 49%. The gap is the price of a long frame: a frame that straddles the switch is lost. Shorter frames lose less, which links back to Chapter 2.
The nRF Connect SDK has two modes for the nRF70 Series. In shared antenna mode, one antenna is switched between the two radios and only one is connected at a time. A switch control line (SW_CTRL0 in the nRF7002 specification) is required to move it. In separate antenna mode, each radio keeps its own antenna and the arbiter only hands out grants. The Kconfig symbol CONFIG_COEX_SEP_ANTENNAS selects separate antennas, and setting it to n selects the shared one.
The choice is hardware. A board built with one antenna cannot run in separate mode, however you set the symbol. Settle it in the schematic, not in the build.
Chapter 6
Build a small mesh, break its routers one by one, and count what each extra hop does to a message
A warehouse worker wants to pass a note to the office at the far end. Shouting would not reach. So the note goes from hand to hand: worker, worker, worker, office. If one worker leaves, the note takes another route. That is a mesh network: devices relay messages for each other, so range grows and one failure does not cut the network.
Thread is a mesh. It is IPv6-based, runs on IEEE 802.15.4, and every device is authenticated and every message is encrypted, as the OpenThread primer states. Everyone in the mesh uses the same single channel from Chapter 1, so one Wi-Fi neighbour can affect every hop.
Some devices relay and some do not. A router forwards packets for others, keeps its radio on all the time, and helps new devices join. An end device talks mainly to one router, called its parent, and does not forward for others. A sleepy end device (SED) switches its radio off to save power and wakes now and then to poll its parent: “do you hold a message for me?” The parent stores messages until the next poll.
One router acts as the leader. It is chosen automatically, so the mesh has no fixed boss, and each partition (a connected piece of the mesh) has exactly one. A border router connects the mesh to another network such as Wi-Fi or Ethernet. Several can exist.
The primer gives limits. A mesh holds at most 32 routers. Each router can have up to 511 end devices. Thread tries to keep 16 to 23 routers. A router-capable device that joined as an end device promotes itself when there are fewer than 16, and existing routers may consider stepping down at 24 or more.
The mesh below has a border router, five routers and one sleepy sensor. The sensor sends to the border router. Turn routers off and watch the path change. The air time you see is a floor: a full 127-byte frame takes 4.256 ms per hop, and it ignores waiting, backoff and acknowledgements.
The sensor S sends to the border router BR. Press a router button to switch it off. Orange lines are the route. Then drag the Wi-Fi load and retries to see what the hops cost.
Toy mesh with fixed positions. The route is the fewest hops. Per-hop delivery is 1 minus the Chapter 2 hit chance raised to (retries + 1), assuming every hop sees the same Wi-Fi and retries fail independently, which is a worst case. A sleepy device that loses its parent must attach to another; that time is not modelled. A downlink message waits on average half a poll interval and at most one.
With everything on, the sensor reaches BR in three hops: S, R4, R1, BR. Switch off R1 and the route changes. Switch off R4 and the sensor must reattach to R5 first. Take away enough routers and the sensor is cut off. A mesh survives a failure only if spare routers sit in the right places, so layout matters.
Take the default: Wi-Fi 20% busy and a Thread frame of 4.256 ms. Chapter 2's formula gives a gap g = 1.45 × 0.8 / 0.2 = 5.8 ms, so T/g = 0.734 and a hit chance of 0.2 + 0.8 × (1 − 0.480) = 0.62. With 3 retries, a hop fails only if all 4 tries are hit, so it fails with 0.62 to the power 4, which is about 0.14. A hop delivers 86% of the time. Three hops in a row deliver 0.86 cubed, about 63%.
Retries repair most of it, at a price in battery and in airtime. And an arbiter at the border router does not help routers far away: it only coordinates radios on its own board. For other devices' Wi-Fi, the tools are the ones from Chapters 1 to 3: a clear channel, shorter frames and retries.
A sleepy device saves energy by being deaf. The cost is latency for messages to it. Set the poll to 1000 ms and a command waits 500 ms on average and up to 1000 ms. Poll faster and the battery drains faster. This trade-off returns in Chapter 7: Matter must run on top of it.
Symptom: a sensor's readings reach the hub only at some times of day. Measurement: read each node's parent, route cost and frame counters, using OpenThread's command line on a development board. Check the Thread channel against a Wi-Fi scan. Fix: move Thread to a clear channel, add a router between the sensor and the border router, or shorten frames.
On real hardware: three nRF52840 DK boards running the OpenThread CLI sample make a small mesh. Power one off and watch the route change.
A sleepy sensor boots with no parent. It listens on the Thread channel and sends a parent request to the routers near it. Each router that hears the request answers. The sensor picks the best reply by link quality, then asks that router to adopt it. The parent assigns it an address and starts storing its messages. This attach step uses the same 127-byte frames and the same single channel, so a busy Wi-Fi neighbour slows it too.
Later, if the parent disappears, the sensor repeats the process. That is why the quiz answer is attach to another router. The time this takes is not modelled in the toy.
A full frame takes 4.256 ms. After it, the receiver turns around for 192 µs and sends an acknowledgement of 11 bytes on the air, which is 352 µs. One clean hop therefore takes about 4.256 + 0.192 + 0.352 = 4.8 ms. Three hops take about 14.4 ms. That is a floor with no waiting and no loss.
Now add loss. At 20% Wi-Fi load the model gives a hit chance of 0.62 per try, with at most 4 tries. The expected number of tries is (1 − 0.624) / (1 − 0.62), which is 0.856 / 0.38, about 2.2. At 4.256 ms a try, one hop uses about 9.5 ms of airtime. Three hops use about 28 ms, twice the floor, and every try drains the battery.
Every extra hop multiplies two costs: delay and the chance of failure. A sensor two hops from the border router at 86% per hop reaches it 0.86 × 0.86 = 74% of the time. At one hop it reaches it 86% of the time. Moving one router closer is worth more than doubling the retries.
The border router is also a single door. All traffic to the internet crosses it. Put it where the mesh is dense, give it a clear channel and, if it carries Wi-Fi too, give it the separate antennas from Chapter 5. Thread allows more than one border router, so a second one adds a spare door.
Chapter 7
Follow one Matter message from a Thread sensor to the internet, and see why size decides whether it arrives
A lamp must obey a phone, whatever brand each is. Matter is the shared language that makes that work. It is an application-layer protocol for smart-home devices that runs over IPv6, on Wi-Fi or on Thread, as the Interrupt post on Matter-over-Thread puts it. Underneath, the radios of this lesson do the carrying.
The stack has layers, like a postal system. Matter writes the letter. UDP puts it in an envelope without a delivery promise. IPv6 writes the address. Then Wi-Fi or Thread carries it. On Thread, each hop is an 802.15.4 frame: 127 bytes at most.
A new device first has to join. In the usual flow, the phone finds it over Bluetooth LE and hands it the credentials for the Thread network or the Wi-Fi network. After that, the device switches to its daily radio. Check the Nordic Matter course for the exact steps on your SDK; this lesson cares about the radio picture. Bluetooth LE returns here as a short, polite guest in the same band.
Inside a Thread mesh, every device has IPv6 addresses. Two kinds matter: a link-local address starting fe80:: that works only on one hop, and a mesh-local address that works across the whole mesh. Neither is routable on the public internet, per the Interrupt post.
The border router bridges the mesh to the home network. In the post's words, it bridges traffic between the Thread mesh and the wider IP network. Matter devices rarely reach the internet directly; the hub does the internet-facing work, such as checking the Distributed Compliance Ledger for firmware updates.
What if a Thread device must reach an IPv4-only server? Thread 1.4 added NAT64: the border router's DNS proxy answers a lookup with a made-up IPv6 address that hides the IPv4 address inside a well-known prefix 64:ff9b::/96. The device sends UDP to that address. The border router pulls out the IPv4 address and forwards the packet. The post gives an example: 64:ff9b::1452:10a4 maps to 20.82.16.164.
Check the arithmetic. Write each IPv4 number in hexadecimal: 20 is 0x14, 82 is 0x52, 16 is 0x10, 164 is 0xa4. Join them in pairs: 1452 and 10a4. The IPv6 address ends 1452:10a4. That is the whole trick.
IPv6 asks every link to carry at least 1280 bytes. An 802.15.4 frame carries 127. So 6LoWPAN, the layer that squeezes IPv6 onto 802.15.4, fragments a long packet into pieces. Each piece is its own frame, and the receiver rebuilds the packet only if every piece arrives. Lose one, lose all.
Matter runs on UDP, so the reliability comes from its own MRP, the message reliability protocol, which resends a whole message that goes unacknowledged. The Interrupt post's practical budget for reliable UDP payloads on Thread is “well under 1200 bytes”. Try the arithmetic.
Each square is one 802.15.4 frame. Drag the message size up and watch the frame count and the odds that every piece survives the trip.
Illustrative: each frame carries 80 bytes of message after the 802.15.4, 6LoWPAN, IPv6, UDP and Matter headers (a made-up round number; real headers vary). Every frame is a full 4.256 ms frame, 3 MAC retries per hop, one Wi-Fi source that hits every hop alike, independent retries. It is a pessimistic worst case on purpose.
Take 300 bytes over 3 hops. That is 4 frames. With the Chapter 6 default (Wi-Fi 20% busy, 3 retries) each frame crosses a hop 86% of the time, so all 4 frames over 3 hops, which is 12 crossings, succeed with 0.856 to the power 12. That is about 16%. MRP needs about six or seven tries. At 100 bytes, 2 frames and 6 crossings give about 39%.
The lesson for firmware: keep Matter messages small, batch sensor readings into one report, and keep the Thread channel clear. Every extra fragment multiplies the risk.
On an nRF Connect SDK Matter device, much of this is a few configuration lines and an OpenThread API. The Interrupt example resolves a name through the border router's DNS proxy with OpenThread's DNS client and, when the proxy fails, builds a NAT64 address from a hard-coded IPv4 address.
# prj.conf: let a Thread device ask the border router's DNS proxy CONFIG_OPENTHREAD_DNS_CLIENT=y /* sequence from the Interrupt post (arguments omitted here): 1. otDnsClientResolveIp4Address(...) asks the border router for an A record 2. the answer arrives as a synthesized 64:ff9b::/96 IPv6 address 3. fallback if the proxy fails: otNat64SynthesizeIp6Address(...) from a hard-coded IPv4 address 4. send UDP to the IPv6 address, wait for the reply (5000 ms in the post) */
On real hardware: take two nRF52840 DKs or an nRF54 board with a Thread border router in your home. Send a UDP echo of 100, 300 and 1000 bytes and count how many replies come back per hundred sends, with and without Wi-Fi traffic nearby.
A frame holds at most 127 bytes. The MAC header and check value take some. The compressed IPv6 and UDP headers take more. Matter then adds its own message header and an authentication tag from AES-128-CCM, which protects every message. What is left for your data is small. Our fragmenting device uses a round 80 bytes per frame, which is illustrative. Real headers vary with addressing and compression.
That leaves a clear rule of thumb. A 20-byte temperature reading wastes most of a frame on overhead. Five such readings in five messages use five frames and five sets of headers.
Use the Chapter 6 default: each hop delivers 86% of the time, over 3 hops. One frame crosses all three hops with probability 0.8563 = 0.63. So a one-frame message arrives on the first try 63% of the time.
Send five readings as five one-frame messages. Each message needs about 1 / 0.63 = 1.6 sends, and each send uses up to 3 hop crossings. That is roughly 5 × 1.6 × 3 = 24 crossings. Now batch the five readings into one 100-byte message of 2 frames. It arrives with probability 0.8566 = 0.39, so it needs about 2.5 sends of 6 crossings. That is roughly 15 crossings. The batch is cheaper because the headers appear once.
Batching has a limit. A message of 300 bytes needs 4 frames and arrives with probability 0.16 in this model. The sweet spot is a message that fills one or two frames. The numbers use the toy channel, so repeat the test on your own mesh.
MRP resends a whole message when no acknowledgement arrives. It repairs random loss well. It does nothing about a burst, because the resend meets the same burst. It also adds delay. For a sleepy device, a resend may need to wait for the next poll. Chapter 8 returns to this: a repair that only works for scattered loss fails when the loss comes in runs.
When a new device is commissioned, the phone talks Bluetooth LE to it while the phone’s Wi-Fi may be busy with the very same app. That is a short, bursty case of this lesson. Keep setup traffic small and let the three advertising channels, which are spread across the band, do their job.
Chapter 8
Learn why the average denial rate hides the failure, and which number to read instead
A product ships. In the field, a few customers report that the Bluetooth LE link to their phone drops whenever the Wi-Fi uploads a backup. Your bench tests show only 5% of events denied. That seems small. Why does the link die?
The answer sits in how a link decides it is dead. Both ends of a Bluetooth LE connection run a timer called the supervision timeout. If no valid packet arrives for that long, the link is declared lost and the connection ends. Only runs of failures matter. A thousand scattered failures do nothing. One long run kills the link.
Take a connection interval of 15 ms and a supervision timeout of 500 ms. The link dies if 500 / 15 = 33 events in a row fail (we round down). Now suppose each event is denied at random with probability 0.3, a harsh 30%. The chance of 33 in a row is 0.3 to the power 33. Work it with logarithms: log10(0.3) = −0.523, times 33 is −17.3, so about 10−17. It never happens.
Now suppose Wi-Fi sends a burst and the arbiter denies everything for 800 ms. That is 800 / 15 = 53 events in a row. The timeout of 500 ms fires after 33 missed events, and the link drops. The average denial rate over a minute stayed tiny, yet the link died.
So the number to measure is not the average. It is the longest run of denied events, and its time length. Compare it with the supervision timeout.
The red block is a stretch where the arbiter denies every Bluetooth LE event. The yellow bracket is the supervision timeout, counted from the last good event. If the red block outlasts the bracket, the link drops.
Bluetooth LE allows connection intervals from 7.5 ms to 4 s and supervision timeouts from 100 ms to 32 s; the sliders cover a practical part of that range. The model counts events in a row, ignores slave latency, and assumes the arbiter denies every event in the burst. Real links may recover mid-burst if a packet slips through.
Try it. At 15 ms and 500 ms, an 800 ms burst kills the link, and a 300 ms burst does not. Raise the timeout to 2000 ms and the 800 ms burst survives. That fix has a cost: when a phone really walks away, the device now takes two seconds to notice.
Random denial still matters, just for another reason: delay. If each event fails with probability d, the number of failed events before a success averages d / (1 − d). At d = 0.3 and 15 ms, that is 0.43 events, or 6.4 ms extra on average. At d = 0.8 it is 4 events, or 60 ms. A link that survives can still feel slow.
| Symptom | Measure | Fix |
|---|---|---|
| BLE link drops during Wi-Fi bursts | Longest run of denied events against the supervision timeout | Raise PRIORITY on link-keeping events, or lengthen the timeout |
| BLE throughput falls while Wi-Fi streams | Retries per channel from the controller | Channel map that avoids the Wi-Fi channel (Chapter 3) |
| Thread router hears fewer neighbours | Packet error rate with Wi-Fi idle against busy | Separate antenna, more isolation, clear channel (Chapters 1 and 5) |
| Matter command lost on a mesh | Frame count per message, retries, hop count | Smaller messages, a router closer to the sensor (Chapters 6 and 7) |
| Wi-Fi upload slows when BLE is busy | Wi-Fi frames waiting per second | Lower BLE priority for optional traffic, widen the connection interval |
Notice the pattern. Every row has a number to read, not a feeling to trust. The antenna and the arbiter are physical, so the proof is on a bench: a logic analyzer on the coexistence lines, a sniffer for the air, a scope for the antenna switch.
Here is a simple way to log it. Each time a request is denied, add one to a counter. Each time a grant arrives, save the counter in a histogram and reset it. At the end the histogram shows how many runs of 1, 2, 3 and longer you saw. The right edge of that histogram is your risk. If the longest run is 20 events and your timeout allows 33, you have a margin of 13 events. If the longest run is 40, you will drop links.
On real hardware: use an nRF7002 DK, open a Bluetooth LE connection to a phone with a 500 ms supervision timeout, then start a long Wi-Fi transfer. Log the longest gap between received packets, and compare it with the timeout.
Log 30 events. Write G for granted and D for denied: GGDGDDGGGDDDDDGGDGGGGDDGDGGGDD. Count the runs of D. There are seven runs: lengths 1, 2, 5, 1, 2, 1 and 2. In total 14 of 30 events were denied, 47%. That average looks scary but not fatal.
| Run length | How many runs |
|---|---|
| 1 | 3 |
| 2 | 3 |
| 5 | 1 |
The right edge of the table is the risk. The longest run is 5 events, which is 75 ms at a 15 ms interval. The link dies after 33 events in a row at a 500 ms timeout. So the margin here is 28 events. The average denial rate is 47%, and the link is still safe.
Now take the same 14 denials and put them in one block. Fourteen events in a row last 210 ms. That is still under 500 ms. So even a block of this size survives. What kills a link is a block of 33 events or more, about 495 ms at 15 ms spacing. Compare the three cases: scattered denials at 47% (safe), one block of 14 (safe), one block of 33 (dead). Only the longest run separates them.
The supervision timeout is a trade between survival and detection. Raise it and the link rides out longer bursts. Lower it and the device notices a real disconnection sooner. The Bluetooth specification also requires the timeout to be larger than (1 + latency) × interval × 2, where latency is the number of events a peripheral may skip. At a 15 ms interval and latency 4, the timeout must exceed 150 ms.
Match the timeout to the burst you measured, with margin. If a Wi-Fi backup denies events for 800 ms, a timeout of 2000 ms survives it, but a phone that walks out of range is noticed only after 2 s. If that delay is unacceptable, fix the cause instead: shorten the burst with priority, or give the link its own antenna.
Coexistence failure runs both ways. If Bluetooth LE traffic is heavy and always high priority, Wi-Fi frames are aborted and resent. Throughput falls and latency rises. A user report on Nordic’s forum describes Bluetooth LE throughput dropping from about 1.2 Mbit/s to about 700 kbit/s once coexistence was on. It is one report on one SDK version, so repeat the test on yours. The pattern is what matters: arbitration moves cost, it does not remove it.
Chapter 9
Keep the key numbers, a bench checklist and the core configuration in one place, and see where to go next
Wi-Fi, Bluetooth LE and Thread share 2.4 GHz. Three tools keep them apart. Frequency: pick clear channels and hop away from busy ones. Time: measure airtime and let an arbiter hand out turns. Space: give a continuous listener its own antenna, or schedule a shared one. Matter then rides on top, and small messages survive where large ones do not.
| Thing | Value | Where it comes from |
|---|---|---|
| Wi-Fi channel centres (1, 6, 11) | 2412, 2437, 2462 MHz, 20 MHz wide | Wikipedia, List of WLAN channels |
| Bluetooth LE channels | 40, 2 MHz apart, 2.402 to 2.480 GHz, 3 for advertising | Bluetooth SIG technology overview |
| BLE advertising centres | ch 37: 2402, ch 38: 2426, ch 39: 2480 MHz | Bluetooth Core spec (not re-opened for this lesson) |
| Thread channels | 16 (11 to 26), 2405 + 5(k − 11) MHz | IEEE 802.15.4 2.4 GHz PHY (formula from the standard, not re-opened) |
| Thread bit rate and frame | 250 kbit/s, up to 127 bytes | IEEE 802.15.4; Interrupt Matter post |
| Full Thread frame on air | (127 + 6) × 32 µs = 4.256 ms | Derived in Chapter 2 |
| BLE 27-byte packet; event | 296 µs; 742 µs with the 150 µs gap | Derived in Chapter 2 |
| Thread mesh limits | 1 leader, 32 routers, 511 end devices per router, aim for 16 to 23 routers | OpenThread primer, node roles |
| SDK coexistence options | CONFIG_MPSL_CX_NRF700X, _3WIRE, _1WIRE | nRF Connect SDK coexistence guide |
| One-wire lead time | deny short-range activity at least 400 µs before the other radio | nRF Connect SDK coexistence guide |
| NAT64 example | 64:ff9b::1452:10a4 is 20.82.16.164 | Interrupt Matter post, 24 March 2026 |
| Message budget on Thread | IPv6 minimum MTU 1280 bytes; reliable UDP payloads well under 1200 | Interrupt Matter post |
Two pieces carry most of the work. First, the devicetree node and Kconfig lines that tell the Nordic stack how the Wi-Fi chip's coexistence pins are wired. Pin numbers below are placeholders: take them from your board.
/* app.overlay: nRF70 coexistence pins (node name from the SDK guide) */ / { nrf_radio_coex: nrf7002_coex { status = "okay"; compatible = "nordic,nrf7002-coex"; req-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; /* placeholder pin */ status0-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; /* placeholder pin */ grant-gpios = <&gpio0 25 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; /* placeholder */ }; }; # prj.conf CONFIG_MPSL=y CONFIG_MPSL_CX=y CONFIG_MPSL_CX_NRF700X=y
Second, the Bluetooth LE channel map. A map is 5 bytes, bit 0 of byte 0 is channel 0, and 37 bits are used. This helper switches off a range of channels, such as those under Wi-Fi 6 (channels 11 to 20). Check the Zephyr header for the exact call in your version.
static void chan_off(uint8_t map[5], int lo, int hi) { for (int c = lo; c <= hi; c++) { map[c / 8] &= ~(1u << (c % 8)); /* clear one bit */ } } uint8_t map[5] = { 0xff, 0xff, 0xff, 0xff, 0x1f }; /* all 37 channels on */ chan_off(map, 11, 20); /* drop the Wi-Fi 6 footprint */ int err = bt_le_set_chan_map(map); /* central role */
Coexistence is a systems job. It touches the radio spec, the board layout, the SDK and the product behaviour. The ideas here also reach into time sync, power and streaming. A biosignal wearable that streams over Bluetooth LE or Wi-Fi meets the same limits.
Primary sources opened for this lesson: the Nordic nRF Connect SDK coexistence guide (signals, Kconfig, devicetree, the 400 µs rule); the OpenThread node roles and types page (roles and limits); Memfault Interrupt, Connecting Matter-over-Thread Devices to the Internet (24 March 2026) and Matter, Thread, and Memfault (12 July 2023); the Bluetooth SIG technology overview. Wi-Fi channel centres come from Wikipedia’s list of WLAN channels, a secondary source.
Also opened: the nRF7002 coexistence description (separate and shared antenna modes, COEX_REQ, COEX_STATUS0 as direction, COEX_GRANT, SW_CTRL0, CONFIG_COEX_SEP_ANTENNAS) and a Nordic DevZone thread where users report Bluetooth LE blocked for about a second during Wi-Fi scans (NCS 2.8.0, user report). The 54 symbol acknowledgement wait, the 192 µs turnaround and the 11 byte acknowledgement are 802.15.4 constants seen in vendor documents, not the standard itself. Pointed to, not reproduced: the Nordic application note nan_044 on nRF70 coexistence and shared or separate antenna modes, and the Nordic Developer Academy Matter course. Read both before you pick a wiring.
Taken from the standards without re-opening them for this lesson: the BLE channel to frequency map, the hop rule and remapping, the 150 µs inter-frame gap, the 802.15.4 channel formula, the 32 µs per byte rate and 6-byte header, and the connection interval and timeout ranges. All toy numbers are marked illustrative where they appear.
Next: go back to the hero and set Wi-Fi to 80%. Then flip the switch and explain, in one sentence, who pays.