BSP Version: 2025.12
Last Updated: February 20, 2026
This repository contains scripts and patches for building and customizing a Microchip BSP (Board Support Package) with LAN8651 Ethernet PHY support and AIoT Wedge customizations.
- Overview
- Architecture
- Files
- Quick Start
- Build Process Details
- Customizations in Detail
- Hardware Configuration
- Build Output
- Update Procedure
- Manual Board Programming
- Important Notes for BSP 2025.12
- Troubleshooting
- Development Notes
- Network Configuration
- Official Documentation
- License & Attribution
- Support
The BSP Patcher automates the process of downloading, patching, and building a customized version of the Microchip BSP with specific network configurations, MQTT support, and update mechanisms tailored for embedded AIoT applications.
┌─────────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐
│ Build Script │ │ Patch File │ │ Target Hardware │
│ build_with_ │───▶│ prebuild_lan8651_ │───▶│ LAN966x + LAN8651 │
│ lan8651_patch.sh │ │ customizations... │ │ Embedded System │
└─────────────────────┘ └──────────────────────┘ └─────────────────────┘
build_with_lan8651_patch.sh- Main build automation scriptprebuild_lan8651_customizations_clean.patch- Comprehensive patch with AIoT customizations
- Linux system with bash shell
- Git (for patch application)
- Either
curlorwgetfor downloads - Internet access for BSP download (~2GB)
- Sufficient disk space (>10GB recommended)
# Make the script executable
chmod +x build_with_lan8651_patch.sh
# Run the build process
./build_with_lan8651_patch.shThe script will:
- Download the MSC BSP source tarball (2025.12 version)
- Extract the source code
- Apply LAN8651 customizations
- Build the complete BSP with buildroot
- Source:
http://mscc-ent-open-source.s3-eu-west-1.amazonaws.com/public_root/bsp/mscc-brsdk-source-2025.12.tar.gz - Size: ~2GB compressed
- Target Directory:
mchp-brsdk-source-2025.12
The patch includes multiple customizations:
Files created by the patch:
# View patch summary with:
git apply --summary prebuild_lan8651_customizations_clean.patch
create mode 100644 board/mscc/common/rootfs_overlay/etc/fw_env.config
create mode 100644 board/mscc/common/rootfs_overlay/etc/mosquitto/mosquitto.conf
create mode 100644 board/mscc/common/rootfs_overlay/etc/network/interfaces
create mode 100755 board/mscc/common/rootfs_overlay/sbin/update.sh
create mode 100644 external/package/mscc-dts-overlays/0001-lan8651-use-gpio36-irq-for-40pin-adapter.patch
create mode 100644 package/lan8651-kernel-config/Config.in
create mode 100644 package/lan8651-kernel-config/lan8651-kernel-config.mkComplete patch statistics (including modifications):
# View which lines are added/removed:
git apply --numstat prebuild_lan8651_customizations_clean.patch
2 0 board/mscc/common/rootfs_overlay/etc/fw_env.config
7 0 board/mscc/common/rootfs_overlay/etc/mosquitto/mosquitto.conf
17 0 board/mscc/common/rootfs_overlay/etc/network/interfaces
287 0 board/mscc/common/rootfs_overlay/sbin/update.sh
3 0 external/configs/arm_standalone_defconfig
11 0 external/package/mscc-dts-overlays/0001-lan8651-use-gpio36-irq-for-40pin-adapter.patch
6 0 package/lan8651-kernel-config/Config.in
19 0 package/lan8651-kernel-config/lan8651-kernel-config.mk
1 0 package/Config.inImportant: Notice that external/configs/arm_standalone_defconfig is modified (not created), showing that the patch also changes existing build configuration files.
New Features in Latest Version:
- Automatic T1S PHY Configuration:
package/lan8651-kernel-config/ensures kernel driver activation - PLCA Support: Automatic Physical Layer Collision Avoidance configuration for eth0
- Improved Hook Timing: Uses
LINUX_POST_CONFIGURE_HOOKSfor reliable kernel configuration
Note: The patch automatically includes the GPIO fix (0001-lan8651-use-gpio36-irq-for-40pin-adapter.patch) needed for AIoT Wedge hardware compatibility with BSP 2025.12.
- eth0: Static IP
192.168.0.5/16(AIoT network segment) with PLCA configuration - eth1: Static IP
192.168.178.20/16(Management network) - eth2: Intentionally unconfigured (flexible use)
- Automatic Kernel Configuration:
CONFIG_MICROCHIP_T1S_PHY=yset via build hook - PLCA Settings: Node-ID 0, Node-Count 8 (Applied automatically on eth0 startup)
Mosquitto MQTT broker with:
- Port: 1883
- Anonymous access enabled
- Message persistence disabled for reduced storage usage
- Suitable for AIoT device communication
- LAN8651 PHY configuration for 40-pin adapter
- GPIO36 interrupt configuration for proper PHY operation
- Target: ARM standalone configuration
- Build system: Buildroot
- External tree:
./external - Output directory:
./output/mybuild
Location: board/mscc/common/rootfs_overlay/etc/network/interfaces
Network interface configuration showing the static IP assignments for eth0 (AIoT network) and eth1 (Management network)
auto eth0
iface eth0 inet static
address 192.168.0.5 # AIoT network
netmask 255.255.0.0
post-up ethtool --set-plca-cfg eth0 enable on node-id 0 node-cnt 8
auto eth1
iface eth1 inet static
address 192.168.178.20 # Management network
netmask 255.255.0.0Location: board/mscc/common/rootfs_overlay/etc/mosquitto/mosquitto.conf
Features:
- Anonymous publishing/subscribing
- Message persistence disabled (reduced storage footprint)
- Suitable for AIoT sensor data collection
Location: package/lan8651-kernel-config/
Automated kernel configuration ensuring T1S PHY driver support:
- Build Hook: Automatically sets
CONFIG_MICROCHIP_T1S_PHY=yin kernel.config - Timing: Uses
LINUX_POST_CONFIGURE_HOOKSfor proper timing - Fallback: Appends configuration if substitution fails
Location: board/mscc/common/rootfs_overlay/etc/network/interfaces
Physical Layer Collision Avoidance (PLCA) for 10BASE-T1L:
- Node ID: 0 (Coordinator/Master node)
- Node Count: 8 (Network supports up to 8 nodes)
- Automatic Setup: PLCA configured via
post-upduring interface activation
Location: board/mscc/common/rootfs_overlay/etc/fw_env.config
Enables Linux-based U-Boot environment manipulation:
- Primary environment: 0x180000 (1.5MB offset)
- Backup environment: 0x1C0000 (1.75MB offset)
- Dual-slot boot support for reliable updates
Location: board/mscc/common/rootfs_overlay/sbin/update.sh
Comprehensive A/B partition update system:
- TFTP-based image download
- Automatic slot detection (mmcblk0p5 ↔ mmcblk0p6)
- Failsafe dual-boot configuration
- Automated U-Boot environment switching
- Root password:
microchip(configurable in buildroot) - SSH access via Dropbear
- Web server: Hiawatha
Figure 1: Required hardware configuration for BSP 2025.12 - Base board with MIKROE-1513 adapter and LAN8651 PHY module
Figure 2: AIoT Wedge hardware configuration showing the actual setup used - Note the different adapter configuration compared to BSP 2025.12 requirements
Important Difference: The AIoT Wedge uses the MIKROE-1879 configuration where the INT line connects to pin 31 (GPIO36), while BSP 2025.12 expects MIKROE-1513 with INT line on pin 11 (GPIO49). This requires the patch file 0001-lan8651-use-gpio36-irq-for-40pin-adapter.patch to be applied.
- SoC: Microchip LAN966x series
- PHY: LAN8651 (10BASE-T1L Ethernet PHY)
- Board: PCB8291 or compatible
- Interface: 40-pin adapter connection via Raspberry Pi Hat
- Performance: 10Mbps/Half duplex operation
The LAN8651 setup uses a stacked configuration:
- Base Board: LAN966x PCB8291 with PIN header
- Adapter: Raspberry Pi Hat adapter
- PHY Board: LAN8651 PHY module
- SPI Interface: Up to 15MHz
- Interrupt: GPIO36 (falling edge)
- Protocol: 10BASE-T1L (10 Mbps over single pair)
- Network Interface: eth0 (LAN8651 PHY)
- Link Status: "Link is Up - 10Mbps/Half - flow control off"
- PLCA Configuration: Node-ID 0, Node-Count 8 (Applied automatically via post-up)
- Kernel Driver:
CONFIG_MICROCHIP_T1S_PHY=y(Set automatically during build)
The LAN8651 overlay requires U-Boot environment setup:
# Set PCB configuration for LAN8651 overlay support
setenv pcb lan9662_ung8291_0_at_lan966x#lan9662_ung8291_lan8651_0_at_lan966x
saveenvAfter successful build completion:
./mchp-brsdk-source-2025.12/output/mybuild/images/
├── brsdk_standalone_arm.ext4.gz # **MAIN TARGET** - Compressed rootfs image for TFTP deployment
├── rootfs.squashfs # Root filesystem (SquashFS format)
├── rootfs.tar # Root filesystem archive
├── u-boot.bin # U-Boot bootloader
├── zImage # Linux kernel
└── *.dtb # Device tree binaries
brsdk_standalone_arm.ext4.gz- This is the primary deployment image- Contains complete customized rootfs with LAN8651 support
- Compressed EXT4 filesystem ready for TFTP deployment
- Includes all patch customizations (MQTT, network config, root password)
- Used by embedded device for rootfs updates via
/sbin/update.sh
- Build new image using this patcher
- Copy image
brsdk_standalone_arm.ext4.gzfrom build output to TFTP server - Set up TFTP server with the image
- Run update script on target device
The update script provides an automated way to update the rootfs on the target device:
# On the embedded device, run as root
/sbin/update.shInteractive Process:
The update script will prompt for network configuration to establish TFTP communication:
Use interface (default: eth1):
What to enter:
- eth1 (default) - The Ethernet port next to the USB connector (recommended for management/update)
- eth0 - LAN8651 T1S PHY interface (typically used for AIoT network)
- eth2 - Additional Ethernet interface (if available)
Why eth1 is the default:
- The Ethernet port next to USB is typically mapped to eth1
- This port is commonly used for management and firmware updates
- Provides reliable connection for TFTP operations
Enter local IP address with netmask (e.g., 169.254.35.110/16):
What to enter:
- Format:
IP_ADDRESS/NETMASK_BITS - Example:
169.254.35.123/16 - Alternative:
192.168.1.100/24
Why this is needed:
- Configures the selected network interface (eth1 by default)
- Must be in same subnet as TFTP server for communication
- Target address for downloading
brsdk_standalone_arm.ext4.gz - Must be reachable from the TFTP server configured in Step 3
Enter TFTP server IP address (e.g., 169.254.87.46):
What to enter:
- IP address of your development machine running TFTP server
- Example:
169.254.87.46 - Alternative:
192.168.1.10
Why this is needed:
- IP address of your development machine running TFTP server
- Must be reachable from the local IP configured in Step 2
- TFTP server must be running and serving the image file
Network Subnet Notes:
/16netmask =255.255.0.0(allows 169.254.x.x range)/24netmask =255.255.255.0(allows 192.168.1.x range)
Link-Local Setup (Recommended for direct connection via eth1):
Interface: eth1 (default)
Local IP: 169.254.35.123/16
TFTP Server: 169.254.87.46
Network: Direct Ethernet cable between devices
LAN Setup (Development network via eth1):
Interface: eth1 (default)
Local IP: 192.168.1.100/24
TFTP Server: 192.168.1.10
Network: Both devices on same LAN/switch
- Data Partition Setup: Script formats
/dev/mmcblk0p7as ext4 and mounts to/data - Interface Selection: Choose network interface (default: eth1 - management port)
- Network Configuration: Enter IP addresses as described above
- TFTP Download: Script executes
tftp -b 50000 -g -r brsdk_standalone_arm.ext4.gz [SERVER_IP] - Image Extraction: Decompresses
.gzfile to.ext4format - Slot Detection: Automatically detects active/inactive boot partitions (
mmcblk0p5↔mmcblk0p6) - Image Installation: Writes new rootfs to inactive partition using
dd - Boot Configuration: Updates U-Boot environment (
mmc_cur/mmc_bak) for automatic failover
Prerequisites:
- TFTP server running with
brsdk_standalone_arm.ext4.gzimage - Network connectivity between device and TFTP server
- Root access on target device
The following U-Boot variable must be set to enable LAN8651 overlay support:
# At U-Boot prompt:
setenv pcb lan9662_ung8291_0_at_lan966x#lan9662_ung8291_lan8651_0_at_lan966x
saveenv # Save configuration
boot # Continue boot
# Or Linux prombt
fw_setenv pcb lan9662_ung8291_0_at_lan966x#lan9662_ung8291_lan8651_0_at_lan966x
Enter U-Boot Mode during startup
Set up network and download firmware:
setenv ipaddr 169.254.35.123
setenv netmask 255.255.0.0
tftp 169.254.87.46:brsdk_standalone_arm.ext4.gz
unzip ${loadaddr} ${mmc_unzip_loadaddr}
run mmc_format
run mmc_boot0_upd; run mmc_boot1_upd
bootConfigure PLCA during runtime:
ethtool --set-plca-cfg eth0 enable on node-id 0 node-cnt 8
ethtool --get-plca-cfg eth0
ip addr add dev eth0 192.168.0.5/16
ip link set eth0 up
ifconfigIn BSP 2025.12, a different Raspberry Pi adapter (MIKROE-1513) is used compared to the one on the AIoT Wedge. The key difference is that the INT line of the LAN8651 connects to pin 11 instead of pin 31 of the header.
Issue: To make BSP 2025.12 work with MIKROE-1879, the GPIO configuration in the DTS overlay for the LAN8651 must be changed from GPIO36 to GPIO49:
# Change from:
interrupts = <36 IRQ_TYPE_EDGE_FALLING>;
# to:
interrupts = <49 IRQ_TYPE_EDGE_FALLING>;
Solution: Copy the patch file 0001-lan8651-use-gpio36-irq-for-40pin-adapter.patch to external/package/ before the first build run.
Important: According to official documentation, the LAN8651 should/must remain as eth0 because the BSP documents, tests, and supports it exactly this way via overlay configuration. Renaming it would introduce additional risks without functional benefits. The modification to revert to the 2024.09 state is very complex and should be avoided.
Impact: This has the consequence that all interface assignments are rotated/shifted compared to previous expectations.
L2 Bridging Limitation: According to documentation, a bridge between LAN8651 (eth0) and eth1/eth2 does not work in this BSP release. This is because:
- The LAN8651 operates over a separate SPI-MACPHY data path
- Common L2 forwarding to the LAN966x switch ports is currently not implemented for this configuration
L3 Routing Alternative: While L2 bridging is not possible, L3 forwarding (IP routing) between the interfaces is possible and can provide inter-network connectivity:
Required Kernel Configuration:
# Essential kernel options for iptables NAT and connection tracking:
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_NAT=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
# Check current kernel support:
grep -E "(NETFILTER|NF_|IP_NF_)" /boot/config-$(uname -r) || \
zcat /proc/config.gz | grep -E "(NETFILTER|NF_|IP_NF_)"Runtime Configuration:
# Enable IP forwarding on the system
echo 1 > /proc/sys/net/ipv4/ip_forward
# Add routing rules between networks
# Route AIoT network (192.168.0.0/16) via Management network (192.168.178.0/16)
ip route add 192.168.0.0/16 via 192.168.178.1 dev eth1
ip route add 192.168.178.0/16 via 192.168.0.1 dev eth0
# Optional: NAT for internet access via eth1
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o eth1 -j MASQUERADE
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPTUse Cases for L3 Routing:
- Inter-network communication: AIoT devices on eth0 can communicate with management systems on eth1
- Internet gateway: Route AIoT traffic through management network to external networks
- Firewall capabilities: Control traffic flow between networks using iptables rules
- Network segmentation: Maintain separate broadcast domains while allowing controlled routing
Recommendation: Design your network architecture using L3 routing between eth0 (LAN8651) and eth1/eth2 (LAN966x switch ports) instead of L2 bridging.
- Missing dependencies: Ensure all buildroot prerequisites are installed
- Disk space: Verify >10GB available space
- Network issues: Check firewall settings for BSP download
- IP conflicts: Verify network segments don't conflict with existing infrastructure
- AIoT connectivity: Ensure 192.168.0.x subnet is routed properly
- Interface bridging: eth0 (LAN8651) cannot be bridged with eth1/eth2 interfaces
- Traffic forwarding: LAN8651 traffic does not forward to other Ethernet interfaces
- PLCA Configuration: Verify T1S PLCA settings with
ethtool --get-plca-cfg eth0
- TFTP timeout: Verify server accessibility and file presence
- Partition errors: Check eMMC health and partition table integrity
- Boot failures: Use U-Boot console to manually switch partitions
# Check network status
ip addr show
# Verify PLCA configuration
ethtool --get-plca-cfg eth0
# Verify T1S PHY kernel support
grep CONFIG_MICROCHIP_T1S_PHY /proc/config.gz || zcat /proc/config.gz | grep T1S
# Verify MQTT broker
mosquitto_sub -t test/topic
# U-Boot environment status
fw_printenv mmc_cur mmc_bak
# Partition information
fdisk -l /dev/mmcblk0- Network addresses: Modify
interfacesfile in patch for IP configuration - PLCA settings: Adjust node-id and node-cnt in
post-upcommand - MQTT settings: Adjust
mosquitto.confparameters (persistence, ports, etc.) - Build options: Edit
arm_standalone_defconfigfor package selection - Hardware settings: Modify Device Tree overlays for GPIO configuration
- Kernel configuration: Extend
lan8651-kernel-config.mkfor additional kernel options
- Modify the patch file with new configurations
- Test patch application:
git apply --check prebuild_lan8651_customizations_clean.patch - Rebuild using the main script
For additional hardware and overlay configuration details, refer to:
- BSP Documentation: LAN966x Overlays
- Hardware Support: Microchip UNG BSP Documentation
When implementing pure IP forwarding on Layer 3 instead of NAT, you need to consider the following requirements:
# Temporarily
echo 1 > /proc/sys/net/ipv4/ip_forward
# Permanently in /etc/sysctl.conf
net.ipv4.ip_forward = 1- Set up static routes on both sides of the router
- Each network segment must know how to reach other segments
- Example:
ip route add 192.168.2.0/24 via 192.168.1.1
ip route add 192.168.1.0/24 via 192.168.2.1- All devices require routable IP addresses (no private RFC1918 addresses)
- Or: Provider must have private networks in their routing tables
# Allow FORWARD chain (instead of MASQUERADE)
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT- The ISP/Gateway must know routes to your internal networks
- Or: Set up BGP/OSPF for dynamic routing
- Internal services are directly reachable via their real IPs
- No port-forwarding rules needed
- DNS must be publicly resolvable if required
- With NAT: One public IP for many private IPs
- With IP Forwarding: Each IP is directly routable (requires more public IPs or special provider configuration)
Advantages:
- No address translation
- More direct communication
- Better end-to-end connectivity
Disadvantages:
- More IP addresses required
- More complex routing configuration
- Higher security requirements
This patcher is based on:
- Microchip BSP: Official Microchip LAN966x BSP (2025.12)
- Buildroot: Cross-compilation framework
- Device Tree: LAN8651 PHY configurations
For AIoT-specific customizations or integration support, consult the documentation of the underlying BSP components and the LAN8651 datasheet for hardware-specific configurations.
Generated for BSP version 2025.12 with LAN8651 AIoT customizations