Skip to content

AP_Networking boot loop#2

Draft
jschall wants to merge 1 commit intoethernet-hub-prfrom
cursor/ap-networking-boot-loop-7fd4
Draft

AP_Networking boot loop#2
jschall wants to merge 1 commit intoethernet-hub-prfrom
cursor/ap-networking-boot-loop-7fd4

Conversation

@jschall
Copy link
Owner

@jschall jschall commented Feb 12, 2026

Fixes a boot loop on ARKV6X when NET_ENABLE is set by addressing null pointer dereferences and enabling the lwIP switchport.

The boot loop occurred because on ChibiOS+Ethernet boards like ARKV6X, the backend object in AP_Networking was nullptr after the old AP_Networking_ChibiOS backend was replaced by the switch architecture. This led to immediate null pointer dereferences in announce_address_changes() and update(). Additionally, the AP_NETWORKING_BACKEND_SWITCHPORT_LWIP was not enabled for these boards, meaning no IP stack was available. The fix enables the lwIP switchport and adds null checks with fallbacks to the lwIP port for IP settings and updates.


Open in Cursor Open in Web

…ctive

On boards like ARKV6X (ChibiOS + HAL_USE_MAC), the switch architecture
enables AP_NETWORKING_BACKEND_SWITCH with Ethernet switchport, but no
backend (PPP/SITL) gets created. This causes null pointer dereferences:

1. announce_address_changes() unconditionally dereferences backend->activeSettings
2. update() calls backend->update() when is_healthy() returns true via hub

Also fix two architectural issues:
- Enable SWITCHPORT_LWIP for ChibiOS+Ethernet boards (not just gateway
  clients), so the IP stack works when the old ChibiOS backend is replaced
  by the switch architecture
- Wire get_ip_active/get_netmask_active/get_gateway_active to fall back
  to the lwIP switchport when backend is null
- Call hub->update() from AP_Networking::update() so switch ports
  (including lwIP) get their periodic update calls

Co-authored-by: jschall <jschall@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 12, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants