XIAO_ESP32C6 Switching between builtin and external antenna

C_L,
Glad to be of help to you.

As I’m using ESP-IDF v5.5.1, I can report that the RF switch is not handled at all. Which, I think, is not a surprise since the ESP-IDF approach is different from the Arduino approach and does not handle board-specific setup. With ESP-IDF the developer is responsible for board-specific features himself. That’s why I’m so grateful for this discussion, and, in particular, for @sigmdel‘s summary and the link to his paper posted in August 2024. For ESP-IDF projects which make use of the XIAO ESP32-C6 this is exceptionally valuable, I think.

Hello .. i am using

i am using ESP-AT v4.1.1.0 fimrware to program on it using flash tool Used at.py to modify the at commard uart port .. but i also want to use external antenna .. for that GPIO14 needs to be changed .. which is not configurable via at.py How can i achieve this ? Can this be external hardware only change ? Or do i have to compile seperately AT firmware ? How ?

Can i just use gpio14 to externally pull down and gpio13 to pull up and use external antenna or needed modifeid AT firmware ?

IS THERE A WAY or anyone from seeed studio technical support can support adding feature to change antennas to at.py tool of esp32-C6 using modifiy wifi configuration command. it is way more easy and we can use the actually AT FW released rather than us managing the build FW using ESP-ID

Hi there,

SO, can you describe better you dev environment? and How you are using it with AT commands ? as a modem ? or as an mcu & modem ?
Are you :index_pointing_at_the_viewer: able to Compile an ESP-IDF project ? Instead of waiting for Seeed Studio or Espressif, you can build custom ESP-AT binary from source using ESP-IDF:

  1. Clone the esp-at repository.

  2. Add a custom board configuration or edit the initialization code (at_main.c / board setup routines) to explicitly configure GPIO 3 as output LOW (Enable) and GPIO 14 as output HIGH (External Antenna) before the Wi-Fi/Bluetooth stack initializes.

  3. Compile and flash the compiled binary using Esptool or Flash Download Tool.

Before compiling, you have to add the GPIO pin logic to the initialization sequence (typically in the custom board component or early startup routines in at_main.c / initialization hook):

  • Configure GPIO 3 as a digital output and set it to LOW (to enable the RF switch IC).

  • Configure GPIO 14 as a digital output and set it to HIGH (to route the RF signal to the external U.FL connector).

Build & Configuration

  • Running make menuconfig or idf.py menuconfig within the esp-at project directory to set target hardware to esp32c6, define UART pin assignments, and configure modem features.

  • Running the build command (python build.py or idf.py build) to generate the customized binary files (bootloader.bin, partition-table.bin, esp-at.bin).

Flashing the Firmware

  • Putting the XIAO ESP32-C6 into bootloader mode.

  • Using Esptool or Espressif’s Flash Download Tool to flash the custom binaries onto the chip over USB/serial.

NOTE: One caveat is if they “UPDATE” ESP-AT, you will need to recompile the tool.

HTH
GL :slight_smile: PJ :v: