[Bazel] Pico W crash on `cyw43_arch_init()`

Open
#2,139 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start with the Bazel multicore configuration and the Pico W wireless initialization path around cyw43_arch_init(). Reproduce the crash using the Pico SDK 2.1.0 Bazel build with multicore enabled, then compare the documented multicore and flash-safe-execute workarounds. Done means Pico W and Pico 2 W wireless examples initialize without requiring an undocumented manual flag.

Written by the indexing model from the issue text.

Description

If you're using Pico W or Pico 2 W with the Bazel build, cyw43_arch_init() will immediately crash if --@pico-sdk//bazel/config:PICO_MULTICORE_ENABLED=False is not also set.

Affected Pico SDK version: 2.1.0

Details

By default, the Bazel build enables multicore support to make the use of the additional cores easier. Unfortunately, this default behavior doesn't play well with the wireless libraries for reasons I haven't fully investigated. When multicore support is enabled, PICO_FLASH_SAFE_EXECUTE_PICO_SUPPORT_MULTICORE_LOCKOUT is also enabled, which, if I'm reading correctly requires an explicit call to flash_safe_execute_core_init() OR for one of PICO_FLASH_ASSUME_CORE0_SAFE or PICO_FLASH_ASSUME_CORE1_SAFE to be set. For reasons I'd have to re-dig up later, this all matters because cyw43_arch_init() hits the flash init path. The easiest solution to get the Pico W working with existing examples is usually to just disable multicore support, but the other mentioned workarounds may also be viable if you need both multicore support and wireless libraries.

Dominant language
C
Stars
5k
Forks
1.3k
Avg merge
2d 17h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/pico-sdk

All issues in raspberrypi/pico-sdk

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.