HAL CAN Driver on PCLKB and clock source = HOCO (48MHz)

Hello,

I have a problem with the HAL CAN Driver of SSP v1.33.

I selected Clock Source HOCO = 48 MHz, PCKLB=24MHz.

The problem is the api g_can0.p_api->open(g_can0.p_ctrl, g_can0.p_cfg); always returns SSP_ERR_CAN_INIT_FAILED

The CAN config is :

Here is the Clock config.

If I choose PLL source with Quartz 12Mhz, CAN is OK...

I use Synergy S3A7 with e2Studio v5.4.023 and SSP v1.33

Someone can help me?

Thanks in advance.

Eric

  • In reply to josh222:

    Thanks for your message, Josh.

    But the problem seems only for CAN API, and I use already SSP v1.33

    I tried the HOCO at 32MHz, it is the same problem... I added the function R_BSP_WarmStart indicated on your link, but my problem is persisting...

    Eric
  • In reply to Eric:

    Hi Eric,

    CAN can be clocked from PCLKB or CANMCLK. If PCLKB is selected, it must be generated by the PLL clock:

    That's why the assertion fails:

    Regards,
    adboc

  • In reply to adboc:

    Waow OK Adboc, and thanks for your response !...

    Effectively, I missed this paragraph of the doc ... Sorry.

    But if I look at the next figure, and "Figure 9.1 Clock generation circuit block diagram", I understand that it is not possible to use the CAN without EXTAL.

    Is it correct?

    Best Regards,

    Eric

  • In reply to Eric:

    Hi Eric,

    Yes, you're right, because PLL clock on S3A7 can be generated from main clock oscillator only.

    Regards,
    adboc
  • In reply to adboc:

    OK Adboc, and thanks for this confirmation.

    Regards,
    Eric
  • In reply to Eric:

    I haven't checked if you would end up with a usable frequency for CAN, but how about a 'from behind, throug the chest, in the eye' approach:
    Starting with HOCO you route its output to the CLKOUT-pin, this is connected to EXTAL so you have a main clock and it even can used by PLL. That may give you a HOCO-based clock for CAN.
    Maybe some timer-output would work for EXTAL-input too.
  • In reply to josh222:

    Hello Josh222,

    thank you for idea, it seems possible. For the moment we're keeping a quartz on EXTAL.
    But I think your solution acceptable, I will try in future.

    Regards,
    Eric