enum gpio_override missing in SDK documentation #2371
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#2371
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Was mentioned in https://github.com/raspberrypi/pico-sdk/issues/265#issuecomment-801522889 but still (or again) an issue.
For example, the links to gpio_override in gpio_set_inover() and gpio_set_outover() are not working but GPIO_OVERRIDE_INVERT can be found in the source code. PDF version affected as well. Maybe others also (like
struct alarm_poolin 4.2.11.5.1. Detailed Description of 4.2.11.5. alarm).\seeand\saseem to start a new paragraph, so don't work so well in some places (look for See also in PDF):4.1.28.7.34. timer_time_us_64
4.1.15.10.6. pio_claim_free_sm_and_add_program_for_gpio_range
4.1.15.11.3. Function Documentation: sm_config_set_mov_status
Some
See alsoentries in the following entries are not linked:4.1.7.10.10. dma_channel_is_claimed
4.1.15.10.5. pio_claim_free_sm_and_add_program
4.1.15.10.6. pio_claim_free_sm_and_add_program_for_gpio_range
4.1.15.10.13. pio_get_funcsel
4.1.26.5.13. next_striped_spin_lock_num
4.1.28.7.7. hardware_alarm_claim_unused
4.1.28.7.21. timer_get_index
4.1.28.7.24. timer_hardware_alarm_claim
4.1.28.7.25. timer_hardware_alarm_claim_unused
4.1.28.7.31. timer_hardware_alarm_unclaim
4.2.2.5.1. async_at_time_worker_t
4.2.2.5.2. async_when_pending_worker_t
4.2.6.8.4. Function Documentation: multicore_doorbell_claim
…
Maybe you create some scripts to do some consistency checking (or run some AI tool to do it; also for constants and their short versions and their correspondence between hardware registers and SDK).
From a very quick look, there's several different issues here... I'll try to set aside some time later in the week (if I get some spare time) to do an in-depth investigation.
Yup, I've previously partially done that with e.g. https://github.com/raspberrypi/pico-sdk/blob/develop/tools/check_doxygen_groups.py
(which is why I'm assigning this issue to myself).
Could you explain in more detail what you mean here please?
I guess this applies more to the RP2350 datasheet but the PIOASM chapter is shared with the SDK. For example, under
3.4.4. JMP→3.4.4.2. Operation, there isEXECCTRL_JMP_PINmentioned but it doesn't point to anywhere (should at least be a link) and searching for it in the SDK docs as well as in the RP2350 datasheet yields only 1 result each.In the datasheet, bits in the registers sometimes have different names than the corresponding constants for the SDK API. It would be nice if they would somehow be cross-referenced (maybe through some kind of glossary or a keyword index, etc.) because the description of one might be different than the other.
An initial simple check could be to just count all all-caps words with at least an underscore. Words that are only once mentioned (or twice and not somehow linked) would probably be suspect. Words that are a sub-string of another (or otherwise similar) possibly also. Then maybe a similar check for function names (identifier followed by
(), etc.And basically the individual words count of the source and the produced HTML and PDF docs should be about the same (minus markup, etc.) if nothing is lost.
However, I suspect that nowadays some of the AI-based tools (like Grok 3 and others that accept larger files) could be instructed to search for inconsistencies in a (PDF) text…
Could you point to some specific examples please? We have internal tooling which means that the register-tables in the SDK PDF and the actual pico-sdk header files are generated from the same "source data". For example, compare section 12.5.3. of https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf with https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2350/hardware_regs/include/hardware/regs/pwm.h (as well as https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2350/hardware_structs/include/hardware/structs/pwm.h which is also auto-generated).
So if that process is going wrong somewhere, it'd be great to know!
Yeah, there's a (fairly old) separate issue for that: #242
It looks like I mixed up the repositories, and that part is a duplicate of https://github.com/raspberrypi/pico-feedback/issues/437. #2129 is possibly also related.
As I hinted at earlier, there's a range of different issues here (thanks for your comprehensive list), so I'll go through them one at a time...
This is because
enum gpio_overrrideis missing a doxygen-comment, and thus it doesn't appear at https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#enumerations-4 . By contrastenum gpio_slew_ratedoes have a doxygen-comment, and thus it does appear in the list of hardware_gpio Enumerations.alarm_poolis a 'struct', and there are a lot of those in pico-sdk, and we've not yet added support for structs to https://github.com/raspberrypi/doxygentoasciidocYou may be interested to learn that our
doxygentoasciidocrepo is used both to create the API documentation in chapter 4 of the Pico SDK PDF and also the online SDK API documentation, so it's highly likely that any errors in one will also be present in the other. For example you can see the non-functionalstruct alarm_poollink here.Unfortunately this is a weird Doxygen bug (which we've seen previously). For an unknown reason it sometimes randomly repeats a sentence in an unexpected place! For example if you look at
hardware/timer.hyou can see that the string "Busy wait wasting cycles for the given (32 bit) number of microseconds using the given timer instance" only appears once, and the string "Busy wait wasting cycles for the given (64 bit) number of microseconds using the given timer instance" also only appears once. However if you search in the pico-sdk PDF (or at https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#group_hardware_timer ), the string "Busy wait wasting cycles for the given (64 bit) number of microseconds using the given timer instance" (correctly) only appears twice, but the string "Busy wait wasting cycles for the given (32 bit) number of microseconds using the given timer instance" unexpectedly appears 3 times! We've not reported this to the upstream Doxygen project because it's a very low priority, and it happens so rarely that we've not been able to create a standalone testcase.Yeah, that's unfortunate - also visible in the online version https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#group_hardware_pio_1ga53c3bbe939b3c58585d0e19ffe91e18e
I guess we need to modify our doxygen-comments to only use
\seeand\saat the end of the comment, rather than interspersed with the text 🤦I can't see any problem here??
Yeah, looks like it isn't linking to
dma_channel_claim_mask, because it actually should have been linking todma_claim_maskinstead.Looks like it isn't linking to
pio_remove_program_unclaim_smbecause it should have been linking topio_remove_program_and_unclaim_sm.Again, should have been linking to
pio_remove_program_and_unclaim_sminstead ofpio_remove_program_unclaim_sm.Looks like it should have been linking to
gpio_function_tinstead ofgpio_function.It's trying to link to
PICO_SPINLOCK_ID_STRIPED_FIRSTandPICO_SPINLOCK_ID_STRIPED_LASTbut these are just defines inhardware/sync/spin_lock.hwithout any doxygen comments.There are actually 11 places which do
\sa hardware_claiming, all of which are non-functional. My best guess is that they were supposed to be\sa hardware_claim.This one took a bit of head-scratching - it's trying to link to
TIMER_NUMwhich does have doxygen-comments, but it's not appearing here, even though the similar-lookingTIMER_ALARM_IRQ_NUMmacro does appear in the output. I think what's happening is that the C preprocessor is being run with no values defined before Doxygen parses the source, and so:gets reduced to nothing, and so doxygen doesn't believe that the macro exists.
Whereas:
gets reduced to:
and so doxygen does see the
TIMER_ALARM_IRQ_NUMmacro.Feel free to read Appendix B of https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-c-sdk.pdf and then have a fiddle around with https://github.com/raspberrypi/pico-sdk/blob/develop/docs/Doxyfile.in and https://www.doxygen.nl/manual/preprocessing.html to see if you can get any better results, but that's not something that I have time for myself!
Both are trying to link to
async_context_add_worker_atandasync_context_add_worker_in_mswhich should probably have beenasync_context_add_at_time_worker_atandasync_context_add_at_time_worker_in_ms.BTW, it's possible that some of these errors were already being reported by
doxygen, but the pico-sdk codebase is very extensive, and the doxygen output is so verbose, that nobody ever bothers checking it! 🤣Maybe it's fixed now, but in the 20 February 2025 PDF (bottom of page 239), the See also header breaks the Parameters header into 2 headers: first listing
candstatus_sel, and then a lonestatus_nwith its own (repeated) header.Oh yes! I hadn't spotted that 🤦
Yeah, the good news is that this was caught in #2390 by my review of the all the
\seetags that don't occur at the start of a line 😅Large parts of this were fixed in #2390 (and so will be included in 2.2.0) but there are some small parts which aren't fixed, so bumping this issue to the 2.3.0 milestone for later review.