This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 21e9d69e550 boards/ev49n51a: add the bridge configuration.
21e9d69e550 is described below
commit 21e9d69e5509f26825156530ecca173d4bc3d974
Author: Daniel P. Carvalho <[email protected]>
AuthorDate: Sat Oct 24 14:06:51 2026 -0300
boards/ev49n51a: add the bridge configuration.
Add the bridge configuration, an Ethernet to Wi-Fi bridge as in the
board's reference design: the rcS script runs wifibridge start at boot,
which makes wlan0 a SoftAP and joins it to eth0 through br0. The
configuration is kept in the program flash (PIC32MZ_PROGMEM, registered
as /dev/mtdblock1) by wifibridge save and removed by wifibridge clear.
The board builds the rcS script into a ROMFS image when ETC_ROMFS is
enabled, as other boards do.
Tested on an EV49N51A built with XC32: the access point and the bridge
come up at boot, a Wi-Fi station pings the bridge and a host behind the
Ethernet port through it with no loss, a stop and start brings the
station back, and a saved configuration is used after a reset until it
is cleared. The Ethernet cable has to be connected at boot: without a
link ifup eth0 fails and wifibridge start gives up, which is noted in
the limitations.
Assisted-by: Claude Code:claude-sonnet-5-5
Signed-off-by: Daniel P. Carvalho <[email protected]>
---
.../mips/pic32mz/boards/ev49n51a/index.rst | 31 ++++++++
boards/mips/pic32mz/ev49n51a/.gitignore | 2 +
.../mips/pic32mz/ev49n51a/configs/bridge/defconfig | 91 ++++++++++++++++++++++
boards/mips/pic32mz/ev49n51a/src/Makefile | 4 +
boards/mips/pic32mz/ev49n51a/src/etc/init.d/rcS | 25 ++++++
5 files changed, 153 insertions(+)
diff --git a/Documentation/platforms/mips/pic32mz/boards/ev49n51a/index.rst
b/Documentation/platforms/mips/pic32mz/boards/ev49n51a/index.rst
index 38834df4aa5..c9912a86905 100644
--- a/Documentation/platforms/mips/pic32mz/boards/ev49n51a/index.rst
+++ b/Documentation/platforms/mips/pic32mz/boards/ev49n51a/index.rst
@@ -309,6 +309,34 @@ an address by DHCP:
WPA3-Personal network. ``wapi scan wlan0`` lists the access points in
range.
+bridge
+------
+
+The Ethernet to Wi-Fi bridge the board was designed for: the ``wlan0``
+SoftAP and ``eth0`` are joined at layer 2 by ``br0``, so that a laptop or
+phone on the access point reaches the device on the Ethernet port as if it
+were on the same cable. The ``rcS`` script runs ``wifibridge start`` at
+boot (see :doc:`/applications/system/wifibridge/index`). It builds with
+XC32 only, like ``wlan``.
+
+With the defaults the access point is ``NuttX-BR`` (WPA2, passphrase
+``nuttxbridge``, channel 6) and the bridge has the address 10.0.0.2. Change
+them with ``wifibridge save``; the configuration is kept in the last two
+4 KB pages of the program flash (``CONFIG_PIC32MZ_PROGMEM``), which the
+board registers as ``/dev/mtdblock1``:
+
+.. code:: console
+
+ nsh> wifibridge save -s MyBridge -p mypassphrase -c 1 -a 10.0.0.9
+ nsh> wifibridge status
+ br0 present 10.0.0.9
+ eth0 up
+ wlan0 up ssid "MyBridge"
+
+Change the default passphrase before deploying a board. The configuration
+does not use the BA414E accelerator, so WPA3 (``-3``) is not available;
+see `Wi-Fi`_.
+
Ethernet
========
@@ -471,6 +499,9 @@ Limitations
* I2C1/I2C2 build but are not tested.
* SPI flash: only reads were tested (JEDEC ID and data), not writes or
erases.
+* ``bridge``: the Ethernet cable must be connected when the bridge starts.
+ Without a link ``ifup eth0`` fails after the auto-negotiation timeout and
+ ``wifibridge start`` gives up.
* UART3 is not wired up.
* No button driver.
diff --git a/boards/mips/pic32mz/ev49n51a/.gitignore
b/boards/mips/pic32mz/ev49n51a/.gitignore
new file mode 100644
index 00000000000..952a5d7b58b
--- /dev/null
+++ b/boards/mips/pic32mz/ev49n51a/.gitignore
@@ -0,0 +1,2 @@
+etctmp.c
+src/etctmp
diff --git a/boards/mips/pic32mz/ev49n51a/configs/bridge/defconfig
b/boards/mips/pic32mz/ev49n51a/configs/bridge/defconfig
new file mode 100644
index 00000000000..1c4d3f6b2f9
--- /dev/null
+++ b/boards/mips/pic32mz/ev49n51a/configs/bridge/defconfig
@@ -0,0 +1,91 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed
.config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that
includes your
+# modifications.
+#
+# CONFIG_ARCH_RAMFUNCS is not set
+CONFIG_ARCH="mips"
+CONFIG_ARCH_BOARD="ev49n51a"
+CONFIG_ARCH_BOARD_EV49N51A=y
+CONFIG_ARCH_CHIP="pic32mz"
+CONFIG_ARCH_CHIP_PIC32MZ=y
+CONFIG_ARCH_CHIP_PIC32MZW1=y
+CONFIG_ARCH_CHIP_WFI32E01=y
+CONFIG_ARCH_MIPS=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_BCH=y
+CONFIG_BOARD_LOOPSPERMSEC=22224
+CONFIG_BUILTIN=y
+CONFIG_DRIVERS_IEEE80211=y
+CONFIG_DRIVERS_WIRELESS=y
+CONFIG_ETC_ROMFS=y
+CONFIG_ETH0_PHY_LAN8720=y
+CONFIG_FS_PROCFS=y
+CONFIG_FS_ROMFS=y
+CONFIG_IDLETHREAD_STACKSIZE=2048
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INTELHEX_BINARY=y
+CONFIG_IOB_BUFSIZE=1600
+CONFIG_IOB_NBUFFERS=48
+CONFIG_IOB_THROTTLE=16
+CONFIG_LINE_MAX=64
+CONFIG_MIPS32_DCACHE_SIZE=16384
+CONFIG_MIPS32_ICACHE=y
+CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32=y
+CONFIG_MTD=y
+CONFIG_MTD_PROGMEM=y
+CONFIG_MTD_SST26=y
+CONFIG_NET=y
+CONFIG_NETDB_DNSCLIENT=y
+CONFIG_NETDEV_PHY_IOCTL=y
+CONFIG_NETDEV_STATISTICS=y
+CONFIG_NETDEV_WIRELESS_IOCTL=y
+CONFIG_NETUTILS_DHCPD=y
+CONFIG_NETUTILS_DHCPD_ROUTERIP=0x0a000002
+CONFIG_NETUTILS_DHCPD_STARTIP=0x0a000064
+CONFIG_NETUTILS_IPERF=y
+CONFIG_NETUTILS_TELNETD=y
+CONFIG_NETUTILS_WIFIBRIDGE_DHCPD=y
+CONFIG_NETUTILS_WIFIBRIDGE_PERSIST=y
+CONFIG_NETUTILS_WIFIBRIDGE_STORAGE="/dev/mtdblock1"
+CONFIG_NET_BRIDGE=y
+CONFIG_NET_BROADCAST=y
+CONFIG_NET_ETH_PKTSIZE=1514
+CONFIG_NET_ICMP_SOCKET=y
+CONFIG_NET_PROMISCUOUS=y
+CONFIG_NET_STATISTICS=y
+CONFIG_NET_TCP=y
+CONFIG_NET_UDP=y
+CONFIG_NET_UDP_CHECKSUMS=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_READLINE=y
+CONFIG_PIC32MZ_ETHERNET=y
+CONFIG_PIC32MZ_ETH_MACADDR=0x02e0deadbeef
+CONFIG_PIC32MZ_ETH_NRXDESC=32
+CONFIG_PIC32MZ_ETH_NTXDESC=4
+CONFIG_PIC32MZ_ICESEL_CH2=y
+CONFIG_PIC32MZ_PROGMEM=y
+CONFIG_PIC32MZ_SPI1=y
+CONFIG_PIC32MZ_UART1=y
+CONFIG_PIC32MZ_W1_WLAN=y
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_RAM_SIZE=262144
+CONFIG_RAM_START=0x80000000
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_LPWORK=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_START_DAY=2
+CONFIG_START_MONTH=10
+CONFIG_START_YEAR=2026
+CONFIG_SYSTEM_BRCTL=y
+CONFIG_SYSTEM_DHCPC_RENEW=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_SYSTEM_PING=y
+CONFIG_SYSTEM_WIFIBRIDGE=y
+CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_WIRELESS_WAPI=y
+CONFIG_WIRELESS_WAPI_CMDTOOL=y
diff --git a/boards/mips/pic32mz/ev49n51a/src/Makefile
b/boards/mips/pic32mz/ev49n51a/src/Makefile
index 4dea43f0b4a..51d20198495 100644
--- a/boards/mips/pic32mz/ev49n51a/src/Makefile
+++ b/boards/mips/pic32mz/ev49n51a/src/Makefile
@@ -36,4 +36,8 @@ ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += pic32mz_autoleds.c
endif
+ifeq ($(CONFIG_ETC_ROMFS),y)
+ RCSRCS = etc/init.d/rcS
+endif
+
include $(TOPDIR)/boards/Board.mk
diff --git a/boards/mips/pic32mz/ev49n51a/src/etc/init.d/rcS
b/boards/mips/pic32mz/ev49n51a/src/etc/init.d/rcS
new file mode 100644
index 00000000000..d8ec4003edd
--- /dev/null
+++ b/boards/mips/pic32mz/ev49n51a/src/etc/init.d/rcS
@@ -0,0 +1,25 @@
+/****************************************************************************
+ * boards/mips/pic32mz/ev49n51a/src/etc/init.d/rcS
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+wifibridge start