This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: Create SYS/BIOS HWI for CAN

Part Number: TMS320F28377D

Tool/software:

Hi all,

I need a help to create a Hwi/Swi module to handle CAN-Bus interrupts.

My code looks like this:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Void hwiCanHandler(xdc_UArg arg)
{
//
// Acknowledge this interrupt located in group 9
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
CanHwiCounter++;
Swi_post(Can_swi);
}
void CAN_INIT(uint32_t canX_base, uint32_t device_sysCLK_freq, uint32_t can_bitrate)
{
Hwi_Params hwiParams;
Swi_Params swiParams;
Error_Block eb;
uint32_t interruptNumber;
Error_init(&eb);
Hwi_Params_init(&hwiParams);
Swi_Params_init(&swiParams);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have create a messagebox for the CAN interface.
I send CAN messages on the bus and I can see that the messagebox are ready, but the interrupt routine is newer called.

What I am doing wrong / missing in my code?

Thanks for any help.

  • Hi Fabrice,

    Does the sys/bios you are using support F29377D device?

    After Hwi_create() is called, please check if the address of the ISR handler is written to vector table. The table address is 0xd00 + INT_number *2

    If CANA IE0 is used the interrupt number is 100, the address is 0xd00 + 0x64*2 = 0xDC8

  • Thank you QJ Wang for your help.

    I could resolve my issue.

    The problem was that I enable CAN module before setting up the message objects.