Skip to content

Commit 67e0b65

Browse files
authored
Add a note regarding running on the second core to esp-radio documentation (#4037)
1 parent 9be325c commit 67e0b65

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

esp-radio/src/lib.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,24 @@
6161
//! - `ESP_RADIO_RX_QUEUE_SIZE`
6262
//! - `ESP_RADIO_TX_QUEUE_SIZE`
6363
//! - `ESP_RADIO_MAX_BURST_SIZE`
64-
//!
64+
#![cfg_attr(
65+
multi_core,
66+
doc = concat!(
67+
"### Running on the Second Core",
68+
"\n\n",
69+
"BLE and Wi-Fi can also be run on the second core.",
70+
"\n\n",
71+
"`esp_preempt::init` and `esp_radio::init` _must_ be called on the core on",
72+
"which you intend to run the wireless code. This will correctly initialize",
73+
"the radio peripheral to run on that core, and ensure that interrupts are",
74+
"serviced by the correct core.",
75+
"\n\n",
76+
"It's also important to allocate adequate stack for the second core; in many",
77+
"cases 8kB is not enough, and 16kB or more may be required depending on your",
78+
"use case. Failing to allocate adequate stack may result in strange behaviour,",
79+
"such as your application silently failing at some point during execution."
80+
)
81+
)]
6582
//! # Features flags
6683
//!
6784
//! Note that not all features are available on every MCU. For example, `ble`

0 commit comments

Comments
 (0)