Skip to content

Commit

Permalink
soc: esp32s3: add Wi-Fi support
Browse files Browse the repository at this point in the history
This adds Wi-Fi linker areas and also bring wi-Fi entry
into SoC device tree.

Signed-off-by: Sylvio Alves <[email protected]>
  • Loading branch information
sylvioalves authored and carlescufi committed Apr 19, 2023
1 parent 5238544 commit a6c8c6e
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions boards/xtensa/esp32s3_devkitm/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config ENTROPY_GENERATOR
default y

config HEAP_MEM_POOL_SIZE
default 98304 if WIFI
default 40960 if BT
default 4096

Expand Down
5 changes: 5 additions & 0 deletions dts/xtensa/espressif/esp32s3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@

};

wifi: wifi {
compatible = "espressif,esp32-wifi";
status = "disabled";
};

pinctrl: pin-controller {
compatible = "espressif,esp32-pinctrl";
status = "okay";
Expand Down
11 changes: 11 additions & 0 deletions samples/net/wifi/boards/esp32s3_devkitm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CONFIG_WIFI=y

CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y

CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=y
CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y

CONFIG_NET_LOG=y
9 changes: 9 additions & 0 deletions samples/net/wifi/boards/esp32s3_devkitm.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/

&wifi {
status = "okay";
};
25 changes: 24 additions & 1 deletion soc/xtensa/esp32s3/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ SECTIONS
.rtc.data :
{
_rtc_data_start = ABSOLUTE(.);
*(.rtc.data)
*(.rtc.data)
*(.rtc.rodata)
*rtc_wake_stub*.o(.data .rodata .data.* .rodata.* .bss .bss.*)
_rtc_data_end = ABSOLUTE(.);
Expand Down Expand Up @@ -309,6 +309,7 @@ SECTIONS
*libzephyr.a:windowspill_asm.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_noos.*(.literal .text .literal.* .text.*)
*libdrivers__timer.a:xtensa_sys_timer.*(.literal .text .literal.* .text.*)
*libzephyr.a:systimer_hal.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_core.*(.literal .text .literal.* .text.*)
*libzephyr.a:cbprintf_complete.*(.literal .text .literal.* .text.*)
*libzephyr.a:printk.*(.literal.printk .literal.vprintk .literal.char_out .text.printk .text.vprintk .text.char_out)
Expand All @@ -321,8 +322,19 @@ SECTIONS
*liblib__libc__minimal.a:string.*(.literal .text .literal.* .text.*)
*liblib__libc__newlib.a:string.*(.literal .text .literal.* .text.*)
*libc.a:*(.literal .text .literal.* .text.*)
*libphy.a:(.phyiram .phyiram.*)
*libgcov.a:(.literal .text .literal.* .text.*)

#if defined(CONFIG_ESP32_WIFI_IRAM_OPT)
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*)
*libpp.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.* .wifiorslpiram .wifiorslpiram.*)
#endif

#if defined(CONFIG_ESP32_WIFI_RX_IRAM_OPT)
*libnet80211.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
*libpp.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
#endif

} GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)

_image_dram_start = LOADADDR(.dram0.data);
Expand Down Expand Up @@ -362,6 +374,7 @@ SECTIONS
*libkernel.a:init.*(.rodata .rodata.*)
*libzephyr.a:cbprintf_complete*(.rodata .rodata.*)
*libzephyr.a:log_core.*(.rodata .rodata.*)
*libzephyr.a:systimer_hal.*(.rodata .rodata.*)
*libzephyr.a:log_backend_uart.*(.rodata .rodata.*)
*libzephyr.a:log_output.*(.rodata .rodata.*)
*libzephyr.a:loader.*(.rodata .rodata.*)
Expand Down Expand Up @@ -434,6 +447,16 @@ SECTIONS
_stext = .;
_text_start = ABSOLUTE(.);

#if !defined(CONFIG_ESP32_WIFI_IRAM_OPT)
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.*)
*libpp.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.* .wifiorslpiram .wifiorslpiram.*)
#endif

#if !defined(CONFIG_ESP32_WIFI_RX_IRAM_OPT)
*libnet80211.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
*libpp.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
#endif

*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
*(.fini.literal)
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ manifest:
groups:
- hal
- name: hal_espressif
revision: d7576d0da639acbd9a191a3eb7e4f3f3476c9641
revision: 8e5da13712012d2cc480f7abc699235352153e05
path: modules/hal/espressif
west-commands: west/west-commands.yml
groups:
Expand Down

0 comments on commit a6c8c6e

Please sign in to comment.