Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

User11996
Level 3
Level 3
Hi.

I've problems with a interrupt.

I have add 3 interrupts in a project and the xmc controller is running in the Default_Handler.


Interrupt0 is configured with dave to a timer and is working with a user service handler (event_time_intervall is calling Timetick_Handler() ).

Interrupt1 is configured with dave to a CAN-RX interrupt and is not working with a user service handler (event_lmo_01_rxinp should calling USR_CAN_RX_Handler() ).

Interrupt2 is configured with dave to a CAN-TX interrupt (event_lmo_02_txinp should calling USR_CAN_TX_Handler() ).


Timetick_Handler() is called every 500ms.

If a CAN-Message is received, it seems a interrupt is called.
the debugger says: "No source available for "() at 0xfffffff9" "

and the controller is looped in the Default_Handler: SysTick_Handler at 10001098.

The irq should call my USR_CAN_RX_Handler().


The HW-Signal Connector is done for all Interrupt.

A Look at Adress 0xE000ED04 shows: 0x011, that meens: 0x11 - 16 = IRQ1 as irq source.
That's my designated Interrupt1 correct?.

What can the problem be?



Thanks for help.
0 Likes
5 Replies
DRubeša
Employee
Employee
First solution authored First like received
Hi,

can you please tell me which board are you using? I saw that you mentioned in some other post that you´re doing a project for XMC1302 and while that microcontroller does not have CAN module, I guess you´re using different board.

Best regards,
Deni
0 Likes
User11996
Level 3
Level 3
Hi Deni.

I'm using a XMC1404 Boot-Kit Board (64-Pin Device).

The Baud-Rate is correct (250k) and if i start a CAN_NODE_MO_Transmit() in the Timer_Handler, the controller sends one CAN-Message (but only one time..).
So the baud rate is correct and the Controller can receive.

For the receive test, i didn't send a frame, only wait for receiving a frame..

If i place a dummy in my Main.c:
extern void SysTick_Handler(void)
{
}
the controller now hangs at the same adress (0x10001098) but now in SVC_Handler..

Here are the configuration:
2270.attach

2271.attach

2272.attach

2273.attach
0 Likes
User11996
Level 3
Level 3
Hi.

Amazing things are happend.
It is incomprehensible to me....

If i put the CAN-Rx Interrupt Handler in a separate C-File
the controller hangs.
If i put the same function with the same name in the main.c (with copy and paste), the interrupt handler is called!

If i place the function in my can_user.c file, it is a normal function: void USR_CAN_RX_Handler(void)
If i place the function in my main.c file, it is a IRQ1_Handler(void) -> amazing....

The definition is:
XMC1400.h: #define IRQ_Hdlr_1 IRQ1_Handler
interrupt_extern.h: #define USR_CAN_RX_Handler IRQ_Hdlr_1



Now: what is the magic differed for the compiler, to compile the function as irq-handler in main.c and compile the same function as normal void function in a other c-file???

Can i set a magic property to a c-file, so the compiler knows, the the interrupt handler is realy realy a interrupt handler, or have i to place all my interrupt handler in main.c?


Thanks for helpful comments.
0 Likes
User11996
Level 3
Level 3
Hi to all.

For all with the same problem.

If you:
#include
your interrupt handler will be working 🙂
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi xmcuser17,

if I understood correctly, you have successfully solved your issue?
And also regarding this #include . This include should be already there if you make a new project and select DAVE CE (kind of projects that are used for DAVE APPs).

Regards,
Deni
0 Likes