UJA1169 CAN communication has not been able to be debugged out

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UJA1169 CAN communication has not been able to be debugged out

745 Views
Brady_Li
Contributor I

{B5423AC5-C883-4FED-95F2-1D4CE8E384C2}.png{541CE5A4-1D9B-437B-8778-D8025B02E527}.png{A49E9CE0-630D-4819-B17F-580025BA2046}.png1, first CAN communication through other CAN PHY communication is normal.
2, used https://community.nxp.com/t5/S32K/S32K144EVB-Q100-UJA1169-CAN/m-p/870022#M3872中的例程.
3, Some posts mentioned that V2 voltage is off by default, now it is also on, and there is 5V output from V2 measured with a multimeter;
4, debugging has found that the status register 22H of trans has an error bit, as well as CTS =inact, after debugging now the status of 22H is also considered normal;

5、IDE version:S32DS studio for ARM


But CAN communication still can not be established, please help to see what else to debug? Or what is the problem?

This is all the code to configure the SBC:

/*! @brief User configuration structure 0 */
const sbc_int_config_t sbc_uja1169_InitConfig0 =
{
/* Regulator control register group. */
.regulatorCtr =
{
/* Regulator control register. */
.regulator =
{
.pdc = SBC_UJA_REGULATOR_PDC_HV,
.v2c = SBC_UJA_REGULATOR_V2C_N_S_S_R,
.v1rtc = SBC_UJA_REGULATOR_V1RTC_90,
},
/* Supply event capture enable register. */
.supplyEvnt =
{
.v2oe = SBC_UJA_SUPPLY_EVNT_V2OE_DIS,
.v2ue = SBC_UJA_SUPPLY_EVNT_V2UE_DIS,
.v1ue = SBC_UJA_SUPPLY_EVNT_V1UE_DIS,
},
},
/* Watchdog control register. */
.watchdog =
{
.modeControl = SBC_UJA_WTDOG_CTR_WMC_TIME,
.nominalPeriod = SBC_UJA_WTDOG_CTR_NWP_4096,
},
/* Mode control register. */
.mode = SBC_UJA_MODE_MC_NORMAL,
/* LIMP home control. */
.lhc = SBC_UJA_FAIL_SAFE_LHC_FLOAT,
/* System event capture enable registers. */
.sysEvnt =
{
.owte = SBC_UJA_SYS_EVNT_OTWE_DIS,
.spife = SBC_UJA_SYS_EVNT_SPIFE_DIS,
},
/* Lock control register. */
.lockMask = (sbc_lock_t)( SBC_UJA_LOCK_LK0C_F(0) \
| SBC_UJA_LOCK_LK1C_F(0U) \
| SBC_UJA_LOCK_LK2C_F(0U) \
| SBC_UJA_LOCK_LK3C_F(0U) \
| SBC_UJA_LOCK_LK4C_F(0U) \
| SBC_UJA_LOCK_LK5C_F(0U) \
| SBC_UJA_LOCK_LK6C_F(0U) ),
/* CAN configuration group. */
.can =
{
/* CAN control register. */
.canConf =
{
.cfdc = SBC_UJA_CAN_CFDC_DIS,
.pncok = SBC_UJA_CAN_PNCOK_DIS,
.cpnc = SBC_UJA_CAN_CPNC_DIS,
.cmc = SBC_UJA_CAN_CMC_ACMODE_DD,
},
/* Transceiver event capture enable register. */
.canTransEvnt =
{
.cbse = SBC_UJA_TRANS_EVNT_CBSE_DIS,
.cfe = SBC_UJA_TRANS_EVNT_CFE_DIS,
.cwe = SBC_UJA_TRANS_EVNT_CWE_DIS,
},
/* CAN data rate selection. */
.datRate = SBC_UJA_DAT_RATE_CDR_500KB,
/* ID registers. */
.identif = {
(sbc_identifier_t)0U,
(sbc_identifier_t)0U,
(sbc_identifier_t)0U,
(sbc_identifier_t)0U,
},
/* ID mask registers. */
.mask = {
(sbc_identif_mask_t)0U,
(sbc_identif_mask_t)0U,
(sbc_identif_mask_t)0U,
(sbc_identif_mask_t)0U,
},
/* Frame control register. */
.frame =
{
.ide = SBC_UJA_FRAME_CTR_IDE_11B,
.pndm = SBC_UJA_FRAME_CTR_PNDM_DCARE,
.dlc = (sbc_frame_ctr_dlc_t)0U,
},
/* Data mask 0 - 7 configuration. */
.dataMask = {
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
(sbc_data_mask_t)0U,
}
},
.wakePin =
{
.wpre = SBC_UJA_WAKE_EN_WPRE_EN,
.wpfe = SBC_UJA_WAKE_EN_WPFE_EN,
},
};

status = SBC_GetFactoriesSettings(&factoriesConf);
    //DEV_ASSERT(status == STATUS_SUCCESS);
    if(factoriesConf.control.fnmc == SBC_UJA_SBC_FNMC_EN ||
            factoriesConf.control.sdmc == SBC_UJA_SBC_SDMC_EN ||
            factoriesConf.control.slpc == SBC_UJA_SBC_SLPC_IG)
    {
        /* Set correct settings. */
        factoriesConf.control.fnmc = SBC_UJA_SBC_FNMC_DIS;
        factoriesConf.control.sdmc = SBC_UJA_SBC_SDMC_DIS;
        factoriesConf.control.slpc = SBC_UJA_SBC_SLPC_AC;
 
        /* If this function return SBC_NVN_ERROR. Factory settings must be preset
         * to default state by Hardware configuration. Please read
         * SBC_ChangeFactoriesSettings descriptions for correct settings.
         * Conditions for Hardware reset value are
         * -pin RSTN is held LOW
         * -CANH is pulled up to VBAT
         * -CANL is pulled down to GND
         * When HW reset is done you can change factory settings by running
         * this example. Be carefully device will be reseted,
         * initialization sequence must be done again. Run the example again
         * with new configuration.
         * */
        status = SBC_ChangeFactoriesSettings(&factoriesConf);
        DEV_ASSERT(status == STATUS_SUCCESS);
    }
 
    status = SBC_GetCanConfig(&canConfig);
    canConfig.canConf.cfdc = SBC_UJA_CAN_CFDC_EN;
    canConfig.canConf.pncok = SBC_UJA_CAN_PNCOK_EN;
    canConfig.canConf.cpnc = SBC_UJA_CAN_CPNC_EN;
canConfig.canConf.cmc = SBC_UJA_CAN_CMC_ACMODE_DA;
status = SBC_SetCanConfig(&canConfig);
    SBC_SetMode(SBC_UJA_MODE_MC_NORMAL);


Attached are the status registers read.

0 Kudos
Reply
2 Replies

733 Views
Brady_Li
Contributor I

 

Update, it's this device, I removed it before and didn't solder it properly, now I removed it and just shorted it, I did it, I have comms!Brady_Li_0-1728617827007.png

 

0 Kudos
Reply

716 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

good to see you found this PCB/soldering issue.

BR, Petr 

0 Kudos
Reply