Getting out of interrupts stop the software from running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-09 6:08 PM
I'm using STM8AF5288 and the COSMIC as my IDE.
Everything working great accept for interrupts using.
The interrupt are being fired as I accept but on returning from the interrupt the PC is out of the program memory addresses.
It is happening with external interrupt as well as with UART TX interrupt.
Anyone ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-16 7:04 AM
Check if you somehow alter your stack content inside the interrupt routine. If by error you overwrite the return address in the stack, it will not find the return point by itself...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-16 7:26 AM
Out-of-bounds array access ?
Local stack address passed as a parameter ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-17 5:54 PM
Thanks, but it is not seems to be the case, for example, here are 2 of my interrupts:
//INTERRUPT_HANDLER(UART1_TX_IRQHandler, 4)
void EXTI_PORTB_IRQHandler()
{
uint8_t status_1 = ais3624dq_get_interrupt_1_status();
uint8_t status_2 = ais3624dq_get_interrupt_2_status();
}
//INTERRUPT_HANDLER(UART1_TX_IRQHandler, 7)
void EXTI_PORTE_IRQHandler()
{
uint8_t status_1 = ais3624dq_get_interrupt_1_status();
uint8_t status_2 = ais3624dq_get_interrupt_2_status();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-17 10:33 PM
How do you know the PC is wrong on the return, you read it with the debugger or it jumps elsewhere in the program?
Try not to call any function in the interrupt handler, just reset the interrupt flag, to see it the problem persists. If not, you know one of the called functions is messing up the stack.
