@@ -179,6 +179,17 @@ if (EXISTS ${PICO_CYW43_DRIVER_PATH}/${CYW43_DRIVER_TEST_FILE})
179
179
# NO_EMBEDDED_PT argument (for example, if you need to chain into the binary, it
180
180
# can't contain a partition table).
181
181
#
182
+ # This will create additional UF2 files for the CYW43 firmware - both a regular version,
183
+ # and a TBYB version to use if you're updating it using the TBYB feature (see section
184
+ # 5.1.17 of the RP2350 datasheet). You will need to flash your chosen version to each
185
+ # new device once, after loading the partition table. For example using picotool:
186
+ #
187
+ # `picotool load TARGET.uf2`;
188
+ # `picotool reboot -u`;
189
+ # `picotool load -ux TARGET_wifi_firmware.uf2`;
190
+ #
191
+ # Then on subsequent updates, you can just flash the TARGET.uf2 file to the device.
192
+ #
182
193
# \param\ NO_EMBEDDED_PT If set, will not embed a partition table in the binary
183
194
function (pico_use_wifi_firmware_partition TARGET )
184
195
set (options NO_EMBEDDED_PT )
@@ -204,50 +215,50 @@ if (EXISTS ${PICO_CYW43_DRIVER_PATH}/${CYW43_DRIVER_TEST_FILE})
204
215
)
205
216
206
217
# Create UF2s for regular and TBYB firmwares
207
- add_executable (${TARGET} _firmware
218
+ add_executable (${TARGET} _wifi_firmware
208
219
${PICO_CYW43_DRIVER_CURRENT_PATH} /wifi_firmware.S )
209
- add_executable (${TARGET} _firmware_tbyb
220
+ add_executable (${TARGET} _wifi_firmware_tbyb
210
221
${PICO_CYW43_DRIVER_CURRENT_PATH} /wifi_firmware.S )
211
222
212
- add_dependencies (${TARGET} _firmware ${TARGET} _firmware_blob )
213
- add_dependencies (${TARGET} _firmware_tbyb ${TARGET} _firmware_blob )
223
+ add_dependencies (${TARGET} _wifi_firmware ${TARGET} _firmware_blob )
224
+ add_dependencies (${TARGET} _wifi_firmware_tbyb ${TARGET} _firmware_blob )
214
225
215
- target_include_directories (${TARGET} _firmware PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )
216
- target_include_directories (${TARGET} _firmware_tbyb PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )
226
+ target_include_directories (${TARGET} _wifi_firmware PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )
227
+ target_include_directories (${TARGET} _wifi_firmware_tbyb PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )
217
228
218
- target_compile_definitions (${TARGET} _firmware PRIVATE
229
+ target_compile_definitions (${TARGET} _wifi_firmware PRIVATE
219
230
NO_PICO_PLATFORM=1
220
231
)
221
- target_compile_definitions (${TARGET} _firmware_tbyb PRIVATE
232
+ target_compile_definitions (${TARGET} _wifi_firmware_tbyb PRIVATE
222
233
NO_PICO_PLATFORM=1
223
234
PICO_CRT0_IMAGE_TYPE_TBYB=1
224
235
)
225
236
226
- target_link_options (${TARGET} _firmware PRIVATE -nostartfiles -nodefaultlibs LINKER:--script=${PICO_CYW43_DRIVER_CURRENT_PATH}/wifi_firmware.ld )
227
- target_link_options (${TARGET} _firmware_tbyb PRIVATE -nostartfiles -nodefaultlibs LINKER:--script=${PICO_CYW43_DRIVER_CURRENT_PATH}/wifi_firmware.ld )
237
+ target_link_options (${TARGET} _wifi_firmware PRIVATE -nostartfiles -nodefaultlibs LINKER:--script=${PICO_CYW43_DRIVER_CURRENT_PATH}/wifi_firmware.ld )
238
+ target_link_options (${TARGET} _wifi_firmware_tbyb PRIVATE -nostartfiles -nodefaultlibs LINKER:--script=${PICO_CYW43_DRIVER_CURRENT_PATH}/wifi_firmware.ld )
228
239
229
- target_link_libraries (${TARGET} _firmware boot_picobin_headers )
230
- target_link_libraries (${TARGET} _firmware_tbyb boot_picobin_headers )
240
+ target_link_libraries (${TARGET} _wifi_firmware boot_picobin_headers )
241
+ target_link_libraries (${TARGET} _wifi_firmware_tbyb boot_picobin_headers )
231
242
232
243
get_target_property (hasSigfile ${TARGET} PICOTOOL_SIGFILE )
233
244
if (hasSigfile )
234
- pico_sign_binary (${TARGET} _firmware ${sigfile} )
235
- pico_sign_binary (${TARGET} _firmware_tbyb ${sigfile} )
245
+ pico_sign_binary (${TARGET} _wifi_firmware ${sigfile} )
246
+ pico_sign_binary (${TARGET} _wifi_firmware_tbyb ${sigfile} )
236
247
endif ()
237
248
238
- pico_hash_binary (${TARGET} _firmware )
239
- pico_hash_binary (${TARGET} _firmware_tbyb )
249
+ pico_hash_binary (${TARGET} _wifi_firmware )
250
+ pico_hash_binary (${TARGET} _wifi_firmware_tbyb )
240
251
241
- pico_set_uf2_family (${TARGET} _firmware cyw43-firmware )
242
- pico_set_uf2_family (${TARGET} _firmware_tbyb cyw43-firmware )
252
+ pico_set_uf2_family (${TARGET} _wifi_firmware cyw43-firmware )
253
+ pico_set_uf2_family (${TARGET} _wifi_firmware_tbyb cyw43-firmware )
243
254
244
- pico_package_uf2_output (${TARGET} _firmware 0x10000000 )
245
- pico_package_uf2_output (${TARGET} _firmware_tbyb 0x10000000 )
255
+ pico_package_uf2_output (${TARGET} _wifi_firmware 0x10000000 )
256
+ pico_package_uf2_output (${TARGET} _wifi_firmware_tbyb 0x10000000 )
246
257
247
- pico_add_extra_outputs (${TARGET} _firmware )
248
- pico_add_extra_outputs (${TARGET} _firmware_tbyb )
258
+ pico_add_extra_outputs (${TARGET} _wifi_firmware )
259
+ pico_add_extra_outputs (${TARGET} _wifi_firmware_tbyb )
249
260
250
261
add_dependencies (${TARGET}
251
- ${TARGET} _firmware ${TARGET} _firmware_tbyb )
262
+ ${TARGET} _wifi_firmware ${TARGET} _wifi_firmware_tbyb )
252
263
endfunction ()
253
264
endif ()
0 commit comments