From 67e0b65ee41de37e934060b12dc884c5064b42fc Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Fri, 5 Sep 2025 04:59:13 -0700 Subject: [PATCH] Add a note regarding running on the second core to `esp-radio` documentation (#4037) --- esp-radio/src/lib.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/esp-radio/src/lib.rs b/esp-radio/src/lib.rs index 3eaa86f00..fe94ad114 100644 --- a/esp-radio/src/lib.rs +++ b/esp-radio/src/lib.rs @@ -61,7 +61,24 @@ //! - `ESP_RADIO_RX_QUEUE_SIZE` //! - `ESP_RADIO_TX_QUEUE_SIZE` //! - `ESP_RADIO_MAX_BURST_SIZE` -//! +#![cfg_attr( + multi_core, + doc = concat!( + "### Running on the Second Core", + "\n\n", + "BLE and Wi-Fi can also be run on the second core.", + "\n\n", + "`esp_preempt::init` and `esp_radio::init` _must_ be called on the core on", + "which you intend to run the wireless code. This will correctly initialize", + "the radio peripheral to run on that core, and ensure that interrupts are", + "serviced by the correct core.", + "\n\n", + "It's also important to allocate adequate stack for the second core; in many", + "cases 8kB is not enough, and 16kB or more may be required depending on your", + "use case. Failing to allocate adequate stack may result in strange behaviour,", + "such as your application silently failing at some point during execution." + ) +)] //! # Features flags //! //! Note that not all features are available on every MCU. For example, `ble`