MCU Footprint
Memory
The table below shows the memory usage of the Wireless Core library compiled with GCC from the GNU Arm Embedded Toolchain v10.3.1 using the -O2 optimization flag.
Memory Section |
Memory Usage (kB) |
|---|---|
RAM |
3 |
Flash |
44.5 |
Memory Section |
Memory Usage (kB) |
|---|---|
RAM |
2.7 |
Flash |
42.9 |
Memory usage is affected by factors such as the number of wireless connections and their queue size. Expect an increase of ~1 kB of RAM for each extra connection, and ~0.5 kB for each extra element in the connection queue.
Additional RAM and flash space must be allocated for the application layer which is not included in these estimates.
CPU
CPU usage will vary depending on the selected MCU. The Wireless Core is entirely driven by interrupts from the transceiver IRQ pin and from the SPI DMA. The interrupt handlers from these two interrupts will call the functions that process the Wireless Core state machine. These interrupts should always be processed with high priority. Delaying the handling of these interrupts could greatly reduce the performances of the wireless link.
The Wireless Core timing diagram shown below illustrates the processor usage and the interrupt model of the Wireless Core.
Figure 81: Wireless Core timing diagram
Function |
Description |
|---|---|
(PHY) read_events |
Ask the radio for the IRQ flags after a radio interrupt. |
(PHY) process_event_rx/tx |
Read the IRQ flags and take action regarding of the outcome. |
(PHY) get_header |
Read link header from the radio FIFO. |
(PHY) get_payload |
Read payload from the radio FIFO. |
(MAC) process_main/auto_frame_outcome |
Process the MAC layer at the end of a frame. |
(MAC) prepare_frame |
Process link layer at the beginning of a frame. |
(PHY) prepare_phy |
Prepare the radio register to send for the next transmission / reception. |
(PHY)set_config |
Send configuration register radio processed in the prepare_radio_cfg state. |
(PHY) set_header |
Write the link header to the radio FIFO. |
(PHY) set_payload |
Write the user payload to the radio FIFO. |
(PHY) close_spi |
Reset the chip select SPI pin, then wait for a radio event. |
(MAC) callback_context_switch |
User provided function to trigger the callback context switch. |
Example of processing time on the QUASAR board using the SR1100 radio with the Profiler Tool:
Configuration
Min
Average
Max
Unidirectional TX 2 byte payload
49.5 us
49.9 us
50.2 us
Unidirectional TX 128 byte payload
77.9 us
78.3 us
78.6 us
Unidirectional TX 250 byte payload
105.4 us
105.7 us
106 us
Unidirectional RX 2 byte payload
54 us
54.3 us
54.7 us
Unidirectional RX 128 byte payload
67.6 us
67.6 us
67.7 us
Unidirectional RX 250 byte payload
95 us
95 us
95.2 us
Bidirectional RX-TX 2 byte payload
60.3 us
60.9 us
61.2 us
Bidirectional RX-TX 128 byte payload
100.7 us
100.8 us
100.9 us
Bidirectional RX-TX 250 byte payload
155.5 us
155.7 us
155.8 us
Note
RX-TX refers to the processing of the end of a reception timeslot and the start of a transmission timeslots. This case shows the worst case scenario in terms of processing time.
To determine the processing time for a given MCU implementation, one can measure the delay between the rising edge of the transceiver IRQ pin, and the last rising edge of the CS pin as shown by the red markers in the following image:
Figure 82: Processing Time Measurement
Note
This measurement can be automated using the Profiler Tool.