Impossible to install ISR Handler from within library #1319
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#1319
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?
If the code of the application is split into several static and/or object libraries, then it is impossible to install ISR routine from within code provided by any of these libraries. Such routine will get ignored during the link, because
pico-sdkcode is prioritized via the pico_stdlib INTERFACE library.Consider the following file (isr.c)
Then if this code is integrated like following (CMakeLists.txt):
Then the
SVC_Handler()function from withinisr.cwill silently be ignored by the linker (default no-op implementation from pico SDK is used instead). The only possible workaround here is to include the isr.c file as part of the main binary, which may not always be possible/feasible.another possible workaround is to call
exception_set_exclusive_handlerfrom within your lib to do it at runtimeUsing any such call would make the code highly non-portable.
can use use INTERFACE rather than STATIC for your library
In this specific case this is not feasible. Static library is used as a handle for precise organization of .data and .bss in memory which is needed for memory protection to be usable. Yet still certain pieces may still want to install ISRs.
Why is the pico_stdlib itself organized as INTERFACE library? That's a highly non-standard approach which almost looks as a hack.