Part Number: RM42L432
Other Parts Discussed in Thread: HALCOGEN
Hi,
I am porting a project from STM32 that is using some external peripherals. My problem boils down to this:
In interrupt handler that is caused by gioNotification from external peripheral i have to communicate through SPI. To do this, I have to enter/exit critical section. When exiting critical section I get undefEntry (program stuck at line 4).
resetEntry
b _c_int00
undefEntry
b undefEntry
svcEntry
b svcEntry
prefetchEntry
b prefetchEntry
b _dabort
b phantomInterrupt
ldr pc,[pc,#-0x1b0]
ldr pc,[pc,#-0x1b0]
So my problem would look like:
void gioNotification(gioPORT_t *port, uint32 bit) {
//code
ENTER_CRITICAL();
//communicate
EXIT_CRITICAL();
//code
}
and the error occurs at EXIT_CRITICAL();
As EXIT_CRITICAL() I used:
1. _enable_interrupts();
2. _enable_IRQ();
3. asm(" cpsie i ");
Of course ENTER_CRITICAL() uses complementary functions at the same time.
All with the same result.
1. I am not using FIQ at the moment
2. It doesn't seem that the same or any other pending interrupt fires when executing EXIT_CRITICAL(), it just goes straight to undefEntry.
3. I used HalcoGen to generate config code. I did not change much with regards to interrupt handling except enabling them.
Does anybody have a clue?