This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS0332: Problems with DCAN2 shutdown by PCR

Part Number: TMS570LS0332
Other Parts Discussed in Thread: TMS570LS3137

Tool/software:

We are trying to disable the unused peripherals on a TMS570LS0332 processor, specifically DCAN1 and DCAN2 peripherals, they are related with pcrREG->PSPWRDWNSET1, bits 0 and 2 respectively, so a value of 0x5 is written into the register: 

Pcr.PSPwrDwnSet1 = 0x5

Setting the bit works for DCAN1 (bit 0) but not for DCAN2 (bit 2) so when reading back the PSPwrDwnSet1 register the value is: 0x1

The processors seem to not allow the DCAN2 to be disabled once the peripherals are started in the periphInit() function.

Before periphInit() function is executed, the default value of the Pcr.PSPwrDwnSet1 is set to 0x5 which means they are disabled by default

But after executing the instructions inside the periphInit() function, the DCAN2 related bit in the PSPWRDWNSET1 register is set to 0 and it's not possible to set it back to 1, making not possible to disable the DCAN2 peripheral anymore.

This is the code in the periphInit():

void periphInit(void)
{
    /** - Disable Peripherals before clock powerup*/
    systemREG1->CLKCNTL &= 0xFFFFFEFFU;  // PENA =  All peripheral/peripheral memory frames are in reset.

 

    /** - Power-up all peripheral clocks */
    pcrREG->PSPWRDWNCLR0 = 0xFFFFFFFFU;
    pcrREG->PSPWRDWNCLR1 = 0xFFFFFFFFU;
    pcrREG->PSPWRDWNCLR2 = 0xFFFFFFFFU;
    pcrREG->PSPWRDWNCLR3 = 0xFFFFFFFFU;

 

    /** - Enable Peripherals */
    systemREG1->CLKCNTL |= 0x00000100U; // PENA =  All peripheral/peripheral memory frames are out of reset.
} // end of periphInit

 

P.S. We already tried to remove the DCAN2 peripheral from the initialization by setting the PSPWRDWNCLR1 = 0xFFFFFFFBU but still the peripheral can't be disabled by using PCR from this point on.

  • As additional information, on a TMS570LS3137 processor we use as a Master, we are able to disable successfully the DCAN2 peripheral, the issue seems to be present only on the TMS570LS0332 

  • Hi Steven,

    Apologies for the delay in late response.

    Can you try with two things:

    1. Can you try to disable SPI and then try to disable the CAN2?

    Write zero to the above highlighted bit and then try to disable the DCAN?

    2. If above method didn't work then can you try below method along with disabling SPI like as mentioned in first step also reset the SPI module by writing below highlighted and then try for disabling?

    I don't have this board right now to test from my side.

    --
    Thanks & regards,
    Jagadish.

  • Hi,

    Don't worry!

    The code we have for TMS570LS0332 in which the problem appears, doesn't use SPI before trying to disable the unused peripherals, is in a part of code in which SPI is not used yet, still I did the test but registers for SPIGCR0 and SPIGCR1 at that point are all in 0 as expected, so the changes to disable the bits mentioned don't have an impact.

    It seems a specific issue with disabling just the DCAN2 peripheral, as the DCAN1 peripheral is disabled successfully.

    In case of the other processor, we use as Master (TMS570LS3137), we have a similar code to disable the unused peripherals (also without using SPI before that point), however, for this processor we are able to disable successfully both peripherals DCAN1 and DCAN2.

    Regards,

    Steven

  • Hi Steven,

    My apologies for the last comment.

    You are correct there won't be any relationship between SPI and DCAN for power disabling. So, please ignore my last comment.

    Can you try to use below code once for disabling DCAN2:

    /** - Disable Peripherals before peripheral powerup*/
    systemREG1->CLKCNTL &= 0xFFFFFEFFU;
        
    pcrREG->PSPWRDWNSET1 = 0x5; /*Disable DCAN1 and DCAN2*/   
        
    /** - Enable Peripherals */
    systemREG1->CLKCNTL |= 0x00000100U;    

    Use above code after periphInit function API calling only, use it in main code.

    --

    Thanks & regards,
    Jagadish.

  • Hi,

    Thanks for your quick response, it seems we are close to find a solution, in the original code we have for periphInit(), we are already disabling/enabling the peripherals, it seems even before disabling the Peripherals, the PSPWRDWNSET1 has already a value of 0x10000005, which means DCAN1 and DCAN2 are disabled by default. See image below

    Then, we added the suggestion you mentioned, to repeat the process right before the call to disable DCAN1 and DCAN2 (See line 106). The PSPWRDWNSET1 seems to be set correctly to a value of 5.

    However, once the peripherals are enabled again on line 110, the PSPWRDWNSET1 register sets a value of 1, meaning that only DCAN1 was disabled, but not DCAN2 as it's supposed. 

    That is the main issue we have been dealing with, that even the PSPWRDWNSET1 register is set to disable DCAN1 and DCAN2, just the first one is disabled for some reason. 

    I Will be pending on any other suggestions

    Regards,

    Steven

  • Hi Steven,

    I don't have TMS570LS0332 board, so i tested this condition on couple of other Hercules boards:

    RM46Lx:

    TMS570LS3137:

    Here i could easily be able to disable the power down for both DCAN1 and DCAN2. I don't understand why we are unable to power down for this particular TMS570LS0332 controllers only.

    Maybe it should be a silicon register level issue, before confirming this can we setup one live debugging session from your end because i don't have this board to debug from my end.

    --
    Thanks & regards,
    Jagadish.