Skip to content

Commit c0306e4

Browse files
igrrtore-espressif
authored andcommitted
feat(esp32_p4_function_ev_board): add example of wifi connection
1 parent d823752 commit c0306e4

File tree

6 files changed

+76
-0
lines changed

6 files changed

+76
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The following five lines of boilerplate have to be in your project's
2+
# CMakeLists in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.16)
4+
5+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6+
set(COMPONENTS main)
7+
project(wifi_connection)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ESP32-P4 Function Evaluation Board Wi-Fi Connection Example
2+
3+
This example demonstrates how to connect to a Wi-Fi network using the ESP32-P4 Function Evaluation Board, utilizing the on-board ESP32-C6 module for connectivity.
4+
5+
## How to use example
6+
7+
### Hardware Required
8+
9+
This example runs on the ESP32-P4 Function Evaluation Board (v1.1 or later).
10+
11+
### Configure the project
12+
13+
Run `idf.py menuconfig` and set the Wi-Fi SSID and password in the Example Configuration menu (`CONFIG_EXAMPLE_WIFI_SSID` and `CONFIG_EXAMPLE_WIFI_PASSWORD`).
14+
15+
### Build and Flash
16+
17+
Build the project and flash it to the board, then run monitor tool to view serial output:
18+
19+
```shell
20+
idf.py flash monitor
21+
```
22+
23+
(To exit the serial monitor, type `Ctrl-]`.)
24+
25+
## Troubleshooting
26+
27+
If Wi-Fi connection fails, please check that ESP32-C6 module on the ESP32-P4 Function Evaluation Board is flashed with esp-hosted firmware. See [here](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/esp32_p4_function_ev_board.md#52-using-esp-prog) for instructions on how to flash the firmware to ESP32-C6.
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
idf_component_register(SRCS "wifi_example_main.c"
2+
INCLUDE_DIRS ".")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dependencies:
2+
espressif/esp32_p4_function_ev_board:
3+
version: "*"
4+
override_path: "../../../"
5+
espressif/esp_wifi_remote:
6+
version: "*"
7+
protocol_examples_common:
8+
path: "$IDF_PATH/examples/common_components/protocol_examples_common"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: CC0-1.0
5+
*/
6+
#include <stdio.h>
7+
#include "esp_log.h"
8+
#include "protocol_examples_common.h"
9+
#include "nvs_flash.h"
10+
#include "esp_netif.h"
11+
#include "esp_event.h"
12+
13+
void app_main(void)
14+
{
15+
ESP_ERROR_CHECK(nvs_flash_init());
16+
ESP_ERROR_CHECK(esp_netif_init());
17+
ESP_ERROR_CHECK(esp_event_loop_create_default());
18+
19+
ESP_ERROR_CHECK(example_connect());
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CONFIG_IDF_TARGET="esp32p4"
2+
CONFIG_EXAMPLE_CONNECT_WIFI=y
3+
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
4+
CONFIG_ESP_SDIO_BUS_WIDTH=4
5+
CONFIG_ESP_SDIO_CLOCK_FREQ_KHZ=40000
6+
CONFIG_ESP_SDIO_PIN_CMD=19
7+
CONFIG_ESP_SDIO_PIN_CLK=18
8+
CONFIG_ESP_SDIO_PIN_D0=14
9+
CONFIG_ESP_SDIO_PIN_D1=15
10+
CONFIG_ESP_SDIO_PIN_D2=16
11+
CONFIG_ESP_SDIO_PIN_D3=17

0 commit comments

Comments
 (0)