@@ -170,14 +170,29 @@ if (EXISTS ${PICO_CYW43_DRIVER_PATH}/${CYW43_DRIVER_TEST_FILE})
170170
171171 pico_promote_common_scope_vars()
172172
173+ # pico_use_wifi_firmware_partition(TARGET [NO_EMBEDDED_PT])
174+ # \brief\ Use a partition for the Wi-Fi firmware
175+ #
176+ # This will read the CYW43 firmware from a partition with the ID 0x776966696669726d,
177+ # instead of embedding the firmware blob in the binary. By default it will also embed
178+ # a compatible partition table in the binary, but this can be disabled by passing the
179+ # NO_EMBEDDED_PT argument (for example, if you need to chain into the binary, it
180+ # can't contain a partition table).
181+ #
182+ # \param\ NO_EMBEDDED_PT If set, will not embed a partition table in the binary
173183 function (pico_use_wifi_firmware_partition TARGET )
184+ set (options NO_EMBEDDED_PT)
185+ cmake_parse_arguments (PARSE_ARGV 1 OPTS "${options} " "" "" )
174186 if (PICO_PLATFORM STREQUAL "rp2040" )
175187 message (FATAL_ERROR "RP2040 does not support storing wi-fi firmware in partitions" )
176188 endif ()
177189 target_compile_definitions (${TARGET} PRIVATE CYW43_USE_FIRMWARE_PARTITION=1)
178- get_target_property (picotool_embed_pt ${TARGET} PICOTOOL_EMBED_PT)
179- if (NOT picotool_embed_pt)
190+
191+ if (NOT OPTS_NO_EMBEDDED_PT)
192+ get_target_property (picotool_embed_pt ${TARGET} PICOTOOL_EMBED_PT)
193+ if (NOT picotool_embed_pt)
180194 pico_embed_pt_in_binary(${TARGET} ${PICO_CYW43_DRIVER_CURRENT_PATH} /wifi_pt.json)
195+ endif ()
181196 endif ()
182197
183198 find_package (Python3 REQUIRED COMPONENTS Interpreter)
0 commit comments