cancel
Showing results for 
Search instead for 
Did you mean: 

CAN transmit Interrupt Not Working

Alok Nigam
Associate
Posted on July 21, 2017 at 08:40

Hi

I am working on SPC560B50x controller and trying to send CAN messages from the controller to the busmaster tool.

I am unable to hit CAN transmit ISR breakpoint, but messages transmitted through my controller is getting reflected in the busmaster tool.

CAN configuration is as follows-:

1) Using CAN channel 0.

2) Baudrate 500 kbps.

3) No FIFO being used.

4) Lowest Buffer transmitted first

5) Max Message Buffers used are 32 for all IMASK1 is enabled ( value given = 0xFFFFFFFF).

6) Bus Off, Error, Tx Warning, Rx Warning all are enabled.

7) All being done in the freeze mode.

In CAN_Transmit function I am setting appropriate code for transmission.

I am using 32 message buff to transmit 32 different data, same message ID over CAN bus and clearing all IFLAG1 after transmission.

Code snippet is attached.

Please help so that I may be able to hit the CAN transmit ISR breakpoint and I may proceed further.
1 REPLY 1
Erwan YVIN
ST Employee
Posted on August 09, 2017 at 14:15

Hello Alok ,

Sorry for the late answer ,

Did you try set the corresponding INTC PSR (Priority Select Register) ?

(cf below) SPC5RLA Can Driver from SPC5Studio Suite Development

/**
 * @brief Low level CAN driver initialization.
 *
 * @notapi
 */
void can_lld_init(void) {
#if (SPC5_CAN_USE_FLEXCAN0 == TRUE)
 /* Driver initialization.*/
 CAND1.config = NULL;
 CAND1.flexcan = &SPC5_FLEXCAN_0;
#if (SPC5_FLEXCAN0_SHARED_IRQ == FALSE)
 INTC_PSR(SPC5_FLEXCAN0_ESR_ERR_INT_NUMBER) =
 SPC5_CAN_FLEXCAN0_IRQ_PRIORITY;
 INTC_PSR(SPC5_FLEXCAN0_ESR_BOFF_NUMBER) =
 SPC5_CAN_FLEXCAN0_IRQ_PRIORITY;
 INTC_PSR(SPC5_FLEXCAN0_BUF_00_NUMBER) =
 SPC5_CAN_FLEXCAN0_IRQ_PRIORITY;
 INTC_PSR(SPC5_FLEXCAN0_BUF_01_NUMBER) =
 SPC5_CAN_FLEXCAN0_IRQ_PRIORITY;
 INTC_PSR(SPC5_FLEXCAN0_BUF_02_NUMBER) =
 SPC5_CAN_FLEXCAN0_IRQ_PRIORITY;
 INTC_PSR(SPC5_FLEXCAN0_BUF_03_NUMBER) =
 SPC5_CAN_FLEXCAN0_IRQ_PRIORITY;�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Best regards

Erwan