Add call to tud_task in getchar() #918
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!918
Loading…
Reference in a new issue
No description provided.
Delete branch "stdio_usb_getchar"
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?
tud_task()during `getchar()tud_task()to not be called after an IRQ if the mutex wasn't available (previously we tried again automatically ever 1ms)ha, as I looked at this again, i realize it should be canceling the existing alarm.. i will add a fix
So AFAICT you're setting
one_shot_timer_crit_secto NULL, here, and then elsewhere you're doingcritical_section_is_initialized(&one_shot_timer_crit_sec). But given thatcritical_section_is_initializedcheckscrit_sec->spin_lock != 0, won't that lead to a null-pointer dereference? 🤷♂️setting the contents of one_shot_timer_crit_sec to zero.
@ -25,6 +25,11 @@ static uint8_t stdio_usb_core_num;Which core is this supposed to be? The one taking the IRQs for the default timer pool? Maybe it's worth making that constraint explicit in the doc comment for
stdio_usb_init, especially if the outcome of this assertion is that you won't be getting any stdout.Might it also be worth failing earlier, at init time, if the USB IRQ is not shared and the init is called on a different core than the default timer IRQ is serviced on?
@ -25,6 +25,11 @@ static uint8_t stdio_usb_core_num;I have moved the assertion (it remains an assertion)... i added a return code to
stdio_init_all()as it wasn't even previously passed thru.Note, i also notice that
stdio_usb.cwon't even compile ifPICO_TIME_DEFAULT_ALARM_POOL_DISABLED=1though no one has apparently needed this. It might be worth adding the ability to initializestdio_usbwith your own alarm pool instead, but that is for another day