2020-07-27 02:56 AM
Hello,
I'm trying to use the CM4_SEV_IRQHandler to send interrupt to the CM7 by CM4.
Do you know if there is some documentation about that because the reference manual just give the number of NVIC about this interrupt (p.800/3528)?
Can I use this interrupt to communicate between CM4 and CM7 with a shared SRAM?
Thanks
Solved! Go to Solution.
2020-07-27 06:50 AM
The sev appears to be about synchronizing wakeups between processors. The two processors have seperate nvics connected to common sources. One core can start a hardware process that interrupts the other. I have tried this so far with the mdma and using the 2 seperate hsem release interrupts so that the 2 cores can signal back and forth in a simple nonblocking way.
2020-07-27 05:47 AM
There are no examples of this in the CubeH7 repository. Doesn't appear to be commonly used.
Only 9 hits in the larger GitHub in general, none of which appear to actually be using it:
https://github.com/search?q=CM4_SEV_IRQHandler+extension%3Ac&type=Code&ref=advsearch&l=&l=
2020-07-27 06:50 AM
The sev appears to be about synchronizing wakeups between processors. The two processors have seperate nvics connected to common sources. One core can start a hardware process that interrupts the other. I have tried this so far with the mdma and using the 2 seperate hsem release interrupts so that the 2 cores can signal back and forth in a simple nonblocking way.
2020-07-27 06:57 AM
Ok I understand...
Do you some code examples please because i've tried many times with no success.
Thanks
2021-02-15 03:14 AM
I've just had a similar needs and I solved using the "SEV" instruction.
From the ARM Cortex M4/M7 programming manuals (PM0214 and PM0253), when the SEV instruction is called, a signal is sent to all other CPU.
So:
asm ( "sev" );
Viceversa to communicate from CM7 to CM4.
I don't know if this is the best solution but it works for me. So please if someone see somthing wrong, please let me know.
Regards
2021-09-01 12:14 AM
SEV instruction doesn't work for me. I don't know why? Could you give more details about configuring interrupt ? Thank you.
2021-09-05 01:44 AM
Hi,
I configured the two event interrupt on CM4 and CM7 into NVIC1 and NVIC2:
In the two interrupt linked to the event I did a led toggle, as an example:
CM4 - stm32h7xx_it.c:
volatile int CalzoCount = 0;
void CM7_SEV_IRQHandler(void)
{
/* USER CODE BEGIN CM7_SEV_IRQn 0 */
/// Toggle LED2 due to event sent from CM7 core
HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin);
/* USER CODE END CM7_SEV_IRQn 0 */
/* USER CODE BEGIN CM7_SEV_IRQn 1 */
CalzoCount++; // monitor via STLink...
/* USER CODE END CM7_SEV_IRQn 1 */
}
CM7 - stm32h7xx_it.c:
void CM4_SEV_IRQHandler(void)
{
/* USER CODE BEGIN CM4_SEV_IRQn 0 */
HAL_GPIO_TogglePin(LED4_GPIO_Port, LED4_Pin);
/* USER CODE END CM4_SEV_IRQn 0 */
/* USER CODE BEGIN CM4_SEV_IRQn 1 */
/* USER CODE END CM4_SEV_IRQn 1 */
}
Using Timer4 on CM4 and Timer1 on CM7, I generate the SEV event:
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin);
__SEV();
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin);
__SEV();
}
And that's it: the LED4 and LED1 blink at the same time, so LED2 and LED3 do.
Make sure the 5th bit of SCR register is high: if I'm not wrong, according to the ARM manual, this bit means the CPU accepts the event via SEV.
I attatch the project, hoping it could be helpfull. It's developed with:
Regards
2023-01-03 04:48 AM
SEV instruction doesn't work for me in D1Standby Mode. I try use SEV to wakeup CM7 sending a event from CM4. But the Interrupt does not work in this mode in the CM7.