Skip to content

Impossible to install ISR Handler from within library #1319

@ventZl

Description

@ventZl

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-sdk code is prioritized via the pico_stdlib INTERFACE library.

Consider the following file (isr.c)

void SVC_Handler()
{
    // do something
}

Then if this code is integrated like following (CMakeLists.txt):

add_library(isr STATIC isr.c)
add_executable(hello main.c)
target_link_libraries(hello isr pico_stdlib)

Then the SVC_Handler() function from within isr.c will 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions