Skip to content

Pico W cyw43_arch_wifi_connect_timeout_ms under FreeRTOS blocks DHCP retries #917

@pgreenland

Description

@pgreenland

When connecting to Wi-FI using cyw43_arch_wifi_connect_timeout_ms under FreeRTOS as per most of the examples, DHCP retries are not sent. Therefore if the DHCP server contacted doesn't respond to the first request the connection will fail.

This appears to be caused by the use of best_effort_wfe_or_timeout within cyw43_arch_wifi_connect_until, which is called by cyw43_arch_wifi_connect_timeout_ms.

The use of wfe / sve here combined with the task priorities of the main and tcpip task in the demo project, leads to the tcpip task being starved of processor time and not able to transmit DHCP discover / request retries.

Increasing the priority of the tcpip task over that of the main task via adding the following to lwipopts.h:

#define TCPIP_THREAD_PRIO (3UL)

Resolves the issue.

Alternatively calling cyw43_arch_wifi_connect_async and followed by periodically monitoring the status of the link via cyw43_tcpip_link_status with a delay also works.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions