Skip to content

Commit

Permalink
Merge pull request #3034 from cesanta/picosdk
Browse files Browse the repository at this point in the history
Fix Pico-SDK aggressive optimization breaking OTA
  • Loading branch information
scaprile authored Feb 6, 2025
2 parents ef8e741 + eb5752f commit 34f512d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
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

0 comments on commit 34f512d

Please sign in to comment.