Skip to content

Fix PlatformIO linking for variant-specific overrides #696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2022
Merged

Fix PlatformIO linking for variant-specific overrides #696

merged 2 commits into from
Jul 21, 2022

Conversation

maxgerhardt
Copy link
Contributor

@maxgerhardt maxgerhardt commented Jul 21, 2022

Fixes the issue discussed in #66 (comment). The issue description and fix are basically the same as in espressif/arduino-esp32#6809.

Test case

[env:rpipicow]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
board = rpipicow
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

Before fix: initVariant is an empty function, returns immediately (the _weak default)

> C:\Users\Max\.platformio\packages\toolchain-rp2040-earlephilhower\bin\arm-none-eabi-objdump.exe -d .\.pio\build\rpipicow\firmware.elf  | grep -A5 initVariant
100008a4 <initVariant>:
100008a4:       4770            bx      lr

After fix: initVariant for the RPiPico W calls into the WiFi init function

> C:\Users\Max\.platformio\packages\toolchain-rp2040-earlephilhower\bin\arm-none-eabi-objdump.exe -d .\.pio\build\rpipicow\firmware.elf  | grep -A5 initVariant
1000032c <initVariant>:
1000032c:       b510            push    {r4, lr}
1000032e:       f000 fc85       bl      10000c3c <cyw43_arch_init>
10000332:       bd10            pop     {r4, pc}

@earlephilhower earlephilhower merged commit 40f4fdf into earlephilhower:master Jul 21, 2022
schkovich pushed a commit to schkovich/arduino-pico that referenced this pull request May 24, 2025
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