aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-09-21 10:05:54 +0200
committerMikael Olsson <mikael.olsson@arm.com>2023-09-21 13:23:33 +0200
commitca4c342dc38385b081c1e4aeee3880ea1aaaf3b5 (patch)
tree5ce3a1e54bfdcdecd840bd7679e264f2263e23d5
parent8d3074b0e82ed46e45d13c22a39e40388a9df8c7 (diff)
downloadethos-u-core-platform-ca4c342dc38385b081c1e4aeee3880ea1aaaf3b5.tar.gz
Set mailbox interrupt priority in message handler
When the mailbox interrupt is triggered, the mailbox interrupt handler will invoke the remote processor mailbox callback, which in turn will use FreeRTOS's xSemaphoreGiveFromISR to wake up a task to handle the new message. Until now, the interrupt priority for the mailbox interrupt has been left at its default value but this stopped working since FreeRTOS kernel V10.6.0 because since that version, the ISR functions will only work from an interrupt with the same or lower priority than configMAX_SYSCALL_INTERRUPT_PRIORITY in the FreeRTOS configuration. Therefore, a priority is now set for the mailbox interrupt that is compatible with the FreeRTOS configuration used. Change-Id: I0186fdc9951dfa73a2692ba95530094abb0e4d4a Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
-rw-r--r--applications/message_handler_openamp/main.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/applications/message_handler_openamp/main.cpp b/applications/message_handler_openamp/main.cpp
index e281f6e..7b755b9 100644
--- a/applications/message_handler_openamp/main.cpp
+++ b/applications/message_handler_openamp/main.cpp
@@ -1,6 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
- *
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
@@ -152,6 +151,7 @@ void mailboxIrqHandler() {
LOG_DEBUG("");
mailbox.handleMessage();
}
+#define MHU_IRQ_PRIORITY 5
#endif
} // namespace
@@ -185,8 +185,9 @@ int main() {
#ifdef MHU_IRQ
// Register mailbox interrupt handler
- NVIC_SetVector((IRQn_Type)MHU_IRQ, (uint32_t)&mailboxIrqHandler);
- NVIC_EnableIRQ((IRQn_Type)MHU_IRQ);
+ NVIC_SetVector(static_cast<IRQn_Type>(MHU_IRQ), (uint32_t)&mailboxIrqHandler);
+ NVIC_SetPriority(static_cast<IRQn_Type>(MHU_IRQ), MHU_IRQ_PRIORITY);
+ NVIC_EnableIRQ(static_cast<IRQn_Type>(MHU_IRQ));
#endif
// Start Scheduler