Standardise usage of rom_get_sys_info function #3094
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!3094
Loading…
Reference in a new issue
No description provided.
Delete branch "bootrom_sysinfo_tweaks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I copied the
rom_get_sys_infousage-pattern frombootrom.h.RP2350 Datasheet says "You should always check (the first word in the returned buffer) before interpreting the buffer.", so do that too.
Also some small unique_id tidy-ups.
@ -85,9 +85,9 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi#if !PICO_RP2040I think using
count_ofmight be clearer - and then the uses inbootrom.hcould be updated tocount_oftoo@ -38,16 +43,22 @@ static void __attribute__((PICO_UNIQUE_BOARD_ID_INIT_ATTRIBUTES)) _retrieve_uniq#error unique board ID size is greater than flash unique ID sizeDitto on
count_of@ -85,9 +85,9 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi#if !PICO_RP2040Okay, I can change all of these. Is it still appropriate for
count_ofto continue being used in thewords_returned == count_of(result)check on the next line too? This would mean that the number5only appears in theuint32_t result[5]line. (Which would be fine with me, I'm always happy to see the elimination of duplicated magic-numbers; I'm just double-checking that this is what's desired.)And in that case I guess it might make sense to fold #3089 into this PR too.
@ -85,9 +85,9 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi#if !PICO_RP2040I think it's still appropriate - I also agree it's nice to remove the magic numbers.
Re folding the PRs, I don't mind - you could make the changes to use
count_ofin the existingbootrom.hfunctions in that PR, or fold it into this one and do it here@ -85,9 +85,9 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi#if !PICO_RP2040Taking that idea of removing magic-numbers even further, perhaps it would also make sense to add e.g.
to
bootrom_constants.h, and then we could do?
@ -85,9 +85,9 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi#if !PICO_RP2040Yeah, that sounds good too - for all the
SYS_INFO_XXXdefines having a correspondingSYS_INFO_XXX_WORDS_RETURNEDrather than just having it in the comment above.@ -85,9 +85,9 @@ void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pi#if !PICO_RP2040Finally got round to making and pushing this change 🙂
@ -239,18 +239,25 @@ typedef int (*bootrom_api_callback_generic_t)(uint32_t r0, uint32_t r1, uint32_t// items are returned in orderI think
_WORD_COUNTwould be better, as WORDS_RETURNED is confusing below, and who says they are returned@ -1109,9 +1109,9 @@ typedef struct {} boot_info_t;I think i prefer
wordss_returned == SYS_INFO... + 1as per belowView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.