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.






