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.

TMS570LC4357: Power domain PD4 deactivation (Flexray and FTU) leads to CPU in reset

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi,

I am using a TMS570LC4357 and I am experiencing some issues while trying to deactivate the Power domain 4 (Flexray and FTU).
I want to disable power domain 3, 4 and 6. Then in my code I repeat 3 times the logic described in chapter 5.3.4.1 of TMS570LC4357 TRM, that is:
1. Write to the PDCLK_DISx register to disable all clocks to the power domain.
2. Write 0xA to the LOGICPDPWRCTRL0 register to power down the domain.
(I didn't code the third step, as it is optional, as indicated in spna173).

My code is as follow:
// Disable power domain #3 (PCR3 peripherals)
PDCLKDISSET->S_FIELDS.PDCLKDISSET1 = 1;
LOGICPDPWRCTRL0->S_FIELDS.LOGICPDON1 = 0xA;

// Disable power domain #4 (Flexray and Flexray Transfer Unit)
PDCLKDISSET->S_FIELDS.PDCLKDISSET2 = 1;
// PATCH: The line below leads to a CPU halted in WinIdea (at the bottom right of the IDE, "RESET" state appears).
// LOGICPDPWRCTRL0->S_FIELDS.LOGICPDON2 = 0xA;

// Disable power domain #6 (ePWM, eCAP, eQEP)
PDCLKDISSET->S_FIELDS.PDCLKDISSET4 = 1;
LOGICPDPWRCTRL1->S_FIELDS.LOGICPDON4 = 0xA;


With the code executed as presented above (PD4 power down command is commented), the code executes correctly and the software continues its execution. When stopping the execution (in the debugger), I can see that the status registers indicate that power domains PD3 and PD6 are in OFF state. I can also see that PD4 is in IDEL state (as the clocks have been disabled.
If I un-comment the PD4 power down command, when this line of code is executed the CPU is indicated as in RESET in the debugger, and I am forced to perform a "reset CPU" operation to be able to control the CPU again.

I checked the TRM, datasheet and errata (silicon B) documents but nothing is listed about this problem, neither in the Hercules safety microcontrollers forum.

Do you have any clue what the problem could be?

For info, I am using iSystem WinIdea debugger (IC5000 probe). I am also forwarding this post to their support but I think this is more a TMS-related issue than a debugger-related issue.

Thanks,
Best regards,
Gael

  • I am not familiar with the structures you are using. Were they created by WinIdea? Have you verified that the assembly code generated is writing to the correct register bytes? The HALCoGen function used to disable power domains looks like this:

    /** @fn void pmmTurnOFFLogicPowerDomain(pmm_LogicPD_t logicPD)
    *   @brief Turns off Logic Power Domain
    *    @param[in] logicPD - Power Domain to be tured off
    *              - PMM_LOGICPD2: Power domain PD2 will be turned off
    *              - PMM_LOGICPD3: Power domain PD3 will be turned off
    *              - PMM_LOGICPD4: Power domain PD4 will be turned off
    *              - PMM_LOGICPD5: Power doamin PD5 will be turned off
    *              - PMM_LOGICPD6: Power doamin PD5 will be turned off
    *
    *   This function turns off the selected Logic Power Domain
    *
    */
    boolean pmmTurnOFFLogicPowerDomain(pmm_LogicPD_t logicPD)
    {
    	boolean status = TRUE;
    
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    
    	/* Disable clocks to the power domain */
    	pmmREG->PDCLKDISSET = (uint32)1U << logicPD;
    
    	/* Power Down the domain */
    	if(logicPD == PMM_LOGICPD2)
    	{
    		pmmREG->LOGICPDPWRCTRL0 = (pmmREG->LOGICPDPWRCTRL0 & 0xF0FFFFFFU) | 0x0A000000U;
    	}
    	else if(logicPD == PMM_LOGICPD3)
    	{
    		pmmREG->LOGICPDPWRCTRL0 = (pmmREG->LOGICPDPWRCTRL0 & 0xFFF0FFFFU) | 0x000A0000U;
    	}
    	else if(logicPD == PMM_LOGICPD4)
    	{
    		pmmREG->LOGICPDPWRCTRL0 = (pmmREG->LOGICPDPWRCTRL0 & 0xFFFFF0FFU) | 0x00000A00U;
    	}
    	else if(logicPD == PMM_LOGICPD5)
    	{
    		pmmREG->LOGICPDPWRCTRL0 = (pmmREG->LOGICPDPWRCTRL0 & 0xFFFFFFF0U) | 0x0000000AU;
    	}
    	else if(logicPD == PMM_LOGICPD6)
    	{
    		pmmREG->LOGICPDPWRCTRL1 = 0x0A000000U;
    	}
    	else
    	{
    		/* Invalid input */
    		status = FALSE;
    	}
    
    	if(status == TRUE)
    	{
    		/* Wait until the domain is powered down */
    		while((pmmREG->LOGICPDPWRSTAT[logicPD] & PMM_LODICPWRSTAT) != 0U)
    		{
    			/* Add timeout code here */
    		}
    	}
    
    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    
    	return status;
    }
    
    

  • Hi Bob,

    I wrote this code for our DAL-A software project (for avionics product), that is why it doesn't look like HALCOGEN.

    I checked the assembly code and there is no problem associated to it.

    I performed an other test: using the same ELF file with Code Composer Studio and connected on USB to a COTS board, and there the issue doesn't appear >> it seems that the problem is related to WinIdea.

    I have contacted their support, waiting for an answer. I'll post evrything I will have that could be usefull to WinIdea users when I'll get a response from iSystem support team.

    Best regards,

    Gael

  • Hi Bob,

    Do you have any news on the subject?

    Best regards,
    Gael
  • No, I was hoping that you got some feedback from WinIdea. I am thinking that in their debugger interface they may be reading some registers in the FlexRay or FTU. They would get an error response and that may be causing the problem.
  • Hi Bob,

    The iSystem support agreed that the bug was WinIdea and they provided me with a new version correcting the bug.
    I received WinIdea v9.17.23 and I checked that it corrects the bug.

    So for anyone using the TMS570LC4357 Silicon B with WinIdea + IC5000 probe and experiencing the same issue, you should expect it corrected in the latest WinIdea version.

    Thanks Bob for your answers.
    Have a great day.

    Gael