Skip to content

Commit

Permalink
Change partition ID to 0x776966696669726d (wififirm) and use data UF2…
Browse files Browse the repository at this point in the history
… family

Adds CYW43_WIFI_FW_PARTITION_ID define to override the partition ID
  • Loading branch information
will-v-pi committed Nov 20, 2024
1 parent b600894 commit 6cf28a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/rp2_common/pico_cyw43_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ if (EXISTS ${PICO_CYW43_DRIVER_PATH}/${CYW43_DRIVER_TEST_FILE})
pico_hash_binary(${TARGET}_firmware)
pico_hash_binary(${TARGET}_firmware_tbyb)

pico_set_uf2_family(${TARGET}_firmware 0x12345678)
pico_set_uf2_family(${TARGET}_firmware_tbyb 0x12345678)
pico_set_uf2_family(${TARGET}_firmware data)
pico_set_uf2_family(${TARGET}_firmware_tbyb data)

pico_package_uf2_output(${TARGET}_firmware 0x10000000)
pico_package_uf2_output(${TARGET}_firmware_tbyb 0x10000000)
Expand Down
7 changes: 6 additions & 1 deletion src/rp2_common/pico_cyw43_driver/cyw43_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ static async_context_t *cyw43_async_context = NULL;
#include "boot/picobin.h"
#include <stdlib.h>

// PICO_CONFIG: CYW43_WIFI_FW_PARTITION_ID, ID of Wi-Fi firmware partition, type=int, default=0x776966696669726d (wififirm), group=pico_cyw43_driver
#ifndef CYW43_WIFI_FW_PARTITION_ID
#define CYW43_WIFI_FW_PARTITION_ID 0x776966696669726d // wififirm
#endif

int32_t cyw43_wifi_fw_len;
int32_t cyw43_clm_len;
uintptr_t fw_data;
Expand Down Expand Up @@ -134,7 +139,7 @@ bool cyw43_driver_init(async_context_t *context) {
uint64_t id = 0;
id |= buffer[i++];
id |= ((uint64_t)(buffer[i++]) << 32ull);
if (id == 0x123456789abcdef0) {
if (id == CYW43_WIFI_FW_PARTITION_ID) {
picked_p = p;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/rp2_common/pico_cyw43_driver/wifi_pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
},
{
"name": "Wi-Fi Firmware",
"id": "0x123456789abcdef0",
"id": "0x776966696669726d",
"start": "3500k",
"size": "240K",
"families": ["0x12345678"],
"families": ["data"],
"permissions": {
"secure": "rw",
"nonsecure": "rw",
Expand All @@ -38,7 +38,7 @@
{
"start": "3500k",
"size": "240k",
"families": ["0x12345678"],
"families": ["data"],
"permissions": {
"secure": "rw",
"nonsecure": "rw",
Expand Down

0 comments on commit 6cf28a3

Please sign in to comment.