1 Reply Latest reply on Oct 7, 2018 7:43 PM by HongyanW_86

    S6J337CJ CAN module

    user_3764331

      Greetings...

      I am using the Traveo S6J337CJ microcontroller. In CAN the data is getting pushed out to the CAN transceiver IC.

      It stays the while loop "while ( 0 != (pstcCanFD->unTXBRP.u32Register & 0x00000001 )) /* Check the TRP0 */"

      Can anyone help me to solve this issue.

       

       

      I am using the standard libraries which is provided by the supplier. "canfd.c" ,  "canfd.h" , "canfd_generated.c"

       

      Not coming out of this while loop

       

          /* Check whether Tx buffer is empty or not */

          while ( 0 != (pstcCanFD->unTXBRP.u32Register & 0x00000001 )) /* Check the TRP0 */

          {

              if(pstcCanFD->unCCCR.stcField.u1INIT == 1)

              {

                  return ErrorOperationInProgress ;

              }

          }

       

      My pin configurations:

          /* PORT - port pin configuration */

          stc_port_pin_config_t stc_port_pin_config331 = {

                                                           .enOutputFunction      = PortOutputResourceF,

                                                           .enOutputDrive         = PortOutputDriveA,

                                                           .enPullResistor        = PortPullResistorNone,

                                                           .enInputLevel          = PortInputLevelCmosA,

                                                           .bInputEnable          = FALSE,

                                                           .bNoiseFilterEnable    = TRUE,

                                                           .enGpioDirection       = PortGpioOutput,

                                                           .enGpioInitOutputLevel = PortGpioHigh

                                                                                                    };

          Port_SetPinConfig( 3, 31, &stc_port_pin_config331 );

        

          stc_port_pin_config_t stc_port_pin_config330 = { .enOutputFunction      = PortOutputResourceGPIO,

                                                       .enOutputDrive         = PortOutputDriveA,

                                                       .enPullResistor        = PortPullResistorNone,

                                                       .enInputLevel          = PortInputLevelCmosA,

                                                       .bInputEnable          = TRUE,

                                                       .bNoiseFilterEnable    = FALSE,

                                                       .enGpioDirection       = PortGpioInput,

                                                       .enGpioInitOutputLevel = PortGpioLow};

          Port_SetPinConfig( 3, 30, &stc_port_pin_config330 );