Hello.
We made the ADAS camera board with SPC5746CHK1AMMH6(Power PC) and UJA1159 chip.
And then, i am loading .elf image of flexcan_mpc5746c example, which is provided by S32DS SDK
(MPC 5746C - demoapp - flexcan_mpc5746c in MpC57XX RTM SDK v1.0.0 Example Project)
However, when the image for this example is loaded via Trace 32 debugger, some value tried to be written within MCR register at FLEXCAN_EnterFreezeMode function in FLEXCAN_DRV_Init.
I checked the register status through our trace 32 debugger.
base->MCR = ERROR:BUSERROR is indicated via trace 32 tool.
And then, in FLEXCAN_Disable function,
-------------------------------------------------------------------------------------------
void FLEXCAN_Disable(CAN_Type * base)
{
/* To access the memory mapped registers */
/* Entre disable mode (hard reset). */
if(((base->MCR & CAN_MCR_MDIS_MASK) >> CAN_MCR_MDIS_SHIFT) == 0U)
{
/* Clock disable (module) */
base->MCR = (base->MCR & ~CAN_MCR_MDIS_MASK) | CAN_MCR_MDIS(1U);
/* Wait until disable mode acknowledged */
while (((base->MCR & CAN_MCR_LPMACK_MASK) >> CAN_MCR_LPMACK_SHIFT) == 0U) {}
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------
It entered infinitely within "while loop"
That is, I guess its cause seems any value isn't written within MCR register.
I'd like to get your solution.