multicore_fifo_get_status and multicore_fifo_clear_irq functions do not make sense. #459
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#459
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?
I have successfully tested the blocking (multicore_fifo_pop_blocking and multicore_fifo_push_blocking) and non-blocking (multicore_fifo_rvalid and multicore_fifo_wready) functions and I have managed to replicate the behaviour as per SDK.
I am now reading the Pico C SDK documentation about the function multicore_fifo_get_status and the description about the setting of bits does not quite make sense to me.
Maybe someone can help.
So am I correct in my understanding that the setting of bit 0 to 1 is equivalent to multicore_fifo_rvalid returning true and similarly if bit 1 is set to 1 that this is equivalent to multicore_fifo_wready returning true.
Then my point of confusion.
According to the documentation, for bit 2 to be set (and remain set, as in it's sticky) means that the TX FIFO was written to when full and that this write was ignored by the FIFO. Does that mean that somehow the multicore_fifo_push_blocking function did not work (as in it did not block the write event). If that is the case is this not an error code.
Similarly for bit 3 to be set (and remain set, as in it's sticky) means that the RX FIFO was read when empty, as in multicore_fifo_pop_blocking did not block, and thus this read was ignored by the FIFO.
Then if bits 2 and bits 3 are sticky, and then remain set, how do these bits then clear assuming that this is not automated. Is that not the function of multicore_fifo_clear_irq or is there some other method of clearing, which is not documented.
The "wrapper functions" in the SDK don't stop you accessing the lower-level registers directly, if you really wanted to 😉
From an ease-of-use aspect it's not ideal; but I think the answers to most of your questions can be answered by comparing the code in multicore.h and multicore.c with sections 2.1.3.4 and 2.1.3.7 in the RP2040 datasheet?
(Apologies if this is rather a short answer, but I've had a very long day!)