-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(esp32_p4_function_ev_board): add example of wifi connection #407
Draft
igrr
wants to merge
1
commit into
master
Choose a base branch
from
feat/p4_ev_board_wifi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+76
−0
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
bsp/esp32_p4_function_ev_board/examples/wifi_connection/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# The following five lines of boilerplate have to be in your project's | ||
# CMakeLists in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
set(COMPONENTS main) | ||
project(wifi_connection) |
28 changes: 28 additions & 0 deletions
28
bsp/esp32_p4_function_ev_board/examples/wifi_connection/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ESP32-P4 Function Evaluation Board Wi-Fi Connection Example | ||
|
||
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. | ||
|
||
## How to use example | ||
|
||
### Hardware Required | ||
|
||
This example runs on the ESP32-P4 Function Evaluation Board (v1.1 or later). | ||
|
||
### Configure the project | ||
|
||
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`). | ||
|
||
### Build and Flash | ||
|
||
Build the project and flash it to the board, then run monitor tool to view serial output: | ||
|
||
```shell | ||
idf.py flash monitor | ||
``` | ||
|
||
(To exit the serial monitor, type `Ctrl-]`.) | ||
|
||
## Troubleshooting | ||
|
||
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. | ||
|
2 changes: 2 additions & 0 deletions
2
bsp/esp32_p4_function_ev_board/examples/wifi_connection/main/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
idf_component_register(SRCS "wifi_example_main.c" | ||
INCLUDE_DIRS ".") |
8 changes: 8 additions & 0 deletions
8
bsp/esp32_p4_function_ev_board/examples/wifi_connection/main/idf_component.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dependencies: | ||
espressif/esp32_p4_function_ev_board: | ||
version: "*" | ||
override_path: "../../../" | ||
espressif/esp_wifi_remote: | ||
version: "*" | ||
protocol_examples_common: | ||
path: "$IDF_PATH/examples/common_components/protocol_examples_common" |
20 changes: 20 additions & 0 deletions
20
bsp/esp32_p4_function_ev_board/examples/wifi_connection/main/wifi_example_main.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: CC0-1.0 | ||
*/ | ||
#include <stdio.h> | ||
#include "esp_log.h" | ||
#include "protocol_examples_common.h" | ||
#include "nvs_flash.h" | ||
#include "esp_netif.h" | ||
#include "esp_event.h" | ||
|
||
void app_main(void) | ||
{ | ||
ESP_ERROR_CHECK(nvs_flash_init()); | ||
ESP_ERROR_CHECK(esp_netif_init()); | ||
ESP_ERROR_CHECK(esp_event_loop_create_default()); | ||
|
||
ESP_ERROR_CHECK(example_connect()); | ||
} |
11 changes: 11 additions & 0 deletions
11
bsp/esp32_p4_function_ev_board/examples/wifi_connection/sdkconfig.defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CONFIG_IDF_TARGET="esp32p4" | ||
CONFIG_EXAMPLE_CONNECT_WIFI=y | ||
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y | ||
CONFIG_ESP_SDIO_BUS_WIDTH=4 | ||
CONFIG_ESP_SDIO_CLOCK_FREQ_KHZ=40000 | ||
CONFIG_ESP_SDIO_PIN_CMD=19 | ||
CONFIG_ESP_SDIO_PIN_CLK=18 | ||
CONFIG_ESP_SDIO_PIN_D0=14 | ||
CONFIG_ESP_SDIO_PIN_D1=15 | ||
CONFIG_ESP_SDIO_PIN_D2=16 | ||
CONFIG_ESP_SDIO_PIN_D3=17 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably makes sense to pin at least some version of esp_wifi_remote (and maybe esp_hosted?) here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, do you plan update and set some major version here?