Skip to content
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

Fix Pico-SDK aggressive optimization breaking OTA #3034

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
pico_enable_stdio_usb(firmware 1) # Route stdio
pico_enable_stdio_uart(firmware 0) # to USB

# Prevent extreme optimization from breaking OTA
target_compile_options(firmware PRIVATE -fno-tree-loop-distribute-patterns)

# Mongoose build flags in mongoose_config.h

# Example build options
Expand Down
7 changes: 5 additions & 2 deletions examples/pico-sdk/pico-2-w-picosdk-freertos-lwip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ build/firmware.uf2:
cd build && cmake -DPICO_BOARD="pico2_w" -G "Unix Makefiles" .. && make

pico-sdk:
git clone --depth 1 -b 2.1.0 https://github.com/raspberrypi/pico-sdk $@
cd $@ && git submodule update --init
#git clone --depth 1 -b 2.1.1 https://github.com/raspberrypi/pico-sdk $@
#cd $@ && git submodule update --init
# Temporary fix until 2.1.1 is released, see #3027
git clone -b develop https://github.com/raspberrypi/pico-sdk $@
cd $@ && git reset --hard --quiet b51fa1b && git submodule update --quiet --init
FreeRTOS-Kernel: # FreeRTOS sources
git clone --depth 1 -b main https://github.com/raspberrypi/FreeRTOS-Kernel $@

Expand Down
3 changes: 3 additions & 0 deletions examples/pico-sdk/pico-rmii/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.

pico_enable_stdio_usb(firmware 1) # Route stdio
pico_enable_stdio_uart(firmware 0) # to USB

# Prevent extreme optimization from breaking OTA
target_compile_options(firmware PRIVATE -fno-tree-loop-distribute-patterns)
3 changes: 3 additions & 0 deletions examples/pico-sdk/pico-rndis-dashboard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ add_definitions(-DHTTP_URL="http://0.0.0.0/")

# Extra build flags (enable if needed)
add_definitions(-DDUAL_CONFIG=0)

# Prevent extreme optimization from breaking OTA
target_compile_options(firmware PRIVATE -fno-tree-loop-distribute-patterns)
3 changes: 3 additions & 0 deletions examples/pico-sdk/pico-rndis-device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
pico_enable_stdio_usb(firmware 0) # Route stdio
pico_enable_stdio_uart(firmware 1) # to the UART

# Prevent extreme optimization from breaking OTA
target_compile_options(firmware PRIVATE -fno-tree-loop-distribute-patterns)

# Mongoose build flags in mongoose_config.h

# Example build options
3 changes: 3 additions & 0 deletions examples/pico-sdk/pico-w-picosdk-freertos-lwip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
pico_enable_stdio_usb(firmware 1) # Route stdio
pico_enable_stdio_uart(firmware 0) # to USB

# Prevent extreme optimization from breaking OTA
target_compile_options(firmware PRIVATE -fno-tree-loop-distribute-patterns)

# Mongoose build flags in mongoose_config.h

# Example build options
Expand Down