Ease integration of RTOS, we need cmsis-compatible exceptional handler naming or API to install exceptional handler in RAM #211

Closed
opened 2021-03-01 20:12:02 -06:00 by xiongyu0523 · 12 comments
xiongyu0523 commented 2021-03-01 20:12:02 -06:00 (Migrated from github.com)

I'm porting Azure RTOS threadx to PICO and I can't submodule the threadx repo because I need to hook the pendsv and systick exceptional handlers.

In crt0.S, the SDK declare as isr_pendsv and isr_systick which are private and not conform to CMSIS standard, so the cm0 processor port of Azure RTOS need to be modified.

Or if you can provide a API similar to irq_set_exclusive_handler but work for all entries include 0-15 exceptional handlers. Then I can install by user code after main. This is also good.

Now, I can only modify the source of threadx to align with SDK naming, which is not flexible

I'm porting Azure RTOS threadx to PICO and I can't submodule the threadx repo because I need to hook the pendsv and systick exceptional handlers. In crt0.S, the SDK declare as isr_pendsv and isr_systick which are private and not conform to CMSIS standard, so the cm0 processor port of Azure RTOS need to be modified. Or if you can provide a API similar to `irq_set_exclusive_handler` but work for all entries include 0-15 exceptional handlers. Then I can install by user code after main. This is also good. Now, I can only modify the source of threadx to align with SDK naming, which is not flexible
kilograham commented 2021-03-01 20:43:04 -06:00 (Migrated from github.com)

yes we plan to add ability to set exception handlers (an omission)

also we can make these public; we may not rename them, but at that point you can inject a header via cmake to rename them via #define.

yes we plan to add ability to set exception handlers (an omission) also we can make these public; we may not rename them, but at that point you can inject a header via cmake to rename them via #define.
lurch commented 2021-03-01 21:03:49 -06:00 (Migrated from github.com)

Links to #21 and #127

Links to #21 and #127
michael-ring commented 2021-03-02 04:58:22 -06:00 (Migrated from github.com)

Where can I put my vote that at least the cortex specific handlers get proper CMSIS names?

Where can I put my vote that at least the cortex specific handlers get proper CMSIS names?
kilograham commented 2021-03-02 10:35:00 -06:00 (Migrated from github.com)

Actually since these were private, we can likely rename them.

Actually since these were private, we can likely rename them.
michael-ring commented 2021-03-02 15:34:35 -06:00 (Migrated from github.com)

That would be really great! https://github.com/raspberrypi/pico-sdk/issues/21 has all necessary links to cmsis docs.

That would be really great! https://github.com/raspberrypi/pico-sdk/issues/21 has all necessary links to cmsis docs.
xiongyu0523 commented 2021-03-02 18:50:05 -06:00 (Migrated from github.com)

yes we plan to add ability to set exception handlers (an omission)

also we can make these public; we may not rename them, but at that point you can inject a header via cmake to rename them via #define.

So your suggestion is to add below global macro definition in CMakeLists.txt to replace the symbol, right?

add_definitions(-DPendSV_Handler=isr_pendsv)
add_definitions(-DSysTick_Handler=isr_systick)
> yes we plan to add ability to set exception handlers (an omission) > > also we can make these public; we may not rename them, but at that point you can inject a header via cmake to rename them via #define. So your suggestion is to add below global macro definition in CMakeLists.txt to replace the symbol, right? ``` add_definitions(-DPendSV_Handler=isr_pendsv) add_definitions(-DSysTick_Handler=isr_systick) ```
kilograham commented 2021-03-02 18:53:28 -06:00 (Migrated from github.com)

that was an option that would have workedd - albeit ugly-ly - but i've decided to add the real names now

that was an option that would have workedd - albeit ugly-ly - but i've decided to add the real names now
kilograham commented 2021-03-02 18:54:19 -06:00 (Migrated from github.com)

(setting variables yes, via global CMake add_defitions - which is eveil - no!)

(setting variables yes, via global CMake add_defitions - which is eveil - no!)
xiongyu0523 commented 2021-03-03 01:23:32 -06:00 (Migrated from github.com)

at least it works and I can now submodule my threadx repo without any change. I left this ticket open and let you decide when a better solution is ready

at least it works and I can now submodule my threadx repo without any change. I left this ticket open and let you decide when a better solution is ready
michael-ring commented 2021-03-11 07:56:01 -06:00 (Migrated from github.com)

Could this be a candidate for Release 1.2?
#127 seems to be so this one will propably make sense to have in, too

Could this be a candidate for Release 1.2? #127 seems to be so this one will propably make sense to have in, too
kilograham commented 2021-05-06 12:21:50 -05:00 (Migrated from github.com)

merged

merged
kilograham commented 2021-05-06 12:22:24 -05:00 (Migrated from github.com)

closing this for the ability to set exception handlers, see #21 if you want the CMSIS exception handler naming instead

closing this for the ability to set exception handlers, see #21 if you want the CMSIS exception handler naming instead
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#211
No description provided.