infineon4engi@twitter infineon@linkedin infineon4engineers infineon@youtube
twitter Facebook Linkedin Youtube

Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_OnzerOS Banner_AURIX_DevelopmentStudio


+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: DAP and Tricore PFLASH programming

  1. #11
    Beginner Beginner alexeyPhyton is on a distinguished road
    Join Date
    Dec 2019
    Posts
    7
    Points
    65
    Quote Originally Posted by UC_wrangler View Post
    Are you writing the registers through DAP, or from executing code? The registers are Safety ENDINIT protected, so a simple write will result in a bus error.

    If you're writing them directly via DAP, consider disabling ENDINIT protection by setting CBS_OCNTRL to 0xC0.

    Here's a small code example of setting an SCU Safety ENDINIT protected register, using the iLLD IfxScuWdt functions:
    Code:
    uint16  endinitSfty_pw;
    
    endinitSfty_pw          = IfxScuWdt_getSafetyWatchdogPassword();
    
    /* Select fback (fosc-evr) as CCU input clock */
    IfxScuWdt_clearSafetyEndinit(endinitSfty_pw);
    
    while (SCU_CCUCON0.B.LCK != 0U)
    {
    	/*Wait till ccucon0 lock is set */
    	/*No "timeout" required, because if it hangs, Safety Endinit will give a trap */
    }
    
    SCU_CCUCON0.B.CLKSEL = 0; /*Select the EVR as fOSC for the clock distribution */
    SCU_CCUCON0.B.UP     = 1; /*Update the ccucon0 register */
    IfxScuWdt_setSafetyEndinit(endinitSfty_pw);
    I already tried to do in this way and result the same - bus error, while CCUCON0.LCK is clear (((

  2. #12
    Advanced Advanced UC_wrangler will become famous soon enough
    Join Date
    Jun 2019
    Posts
    73
    Points
    1540
    OK then show us the code

  3. #13
    Beginner Beginner alexeyPhyton is on a distinguished road
    Join Date
    Dec 2019
    Posts
    7
    Points
    65
    Quote Originally Posted by UC_wrangler View Post
    OK then show us the code
    There are a part of code. For debugging, I put real registers address:


    //---------------------------------------------------------------------------------
    ushort _pass = DAPgetSafetyWatchdogPassword();
    //---------------------------------------------------------------------------------

    DAPSetAddr(0xF000047C);
    _bf[0] = DAPClientReadW();
    DisplayL("OCNTRL", _bf[0]);
    _bf[0] |= 0x00C0;
    DAPClientWriteW(_bf[0]);

    DAPclearSafetyEndinit( _pass );

    do{
    DAPClientReadBlock(&_bf[0], 1, 0xF0036030);
    }
    while(_bf[0] & (1<<31));

    DisplayL("CCUCON0", _bf[0]);

    _bf[0] &= ~(3<<28); // clear the CLKSEL bits
    DAPClientWriteBlock(&_bf[0], 1, 0xF0036030); // !!!!!!!!!!!!!!!!!!!!!!!!!!!

    _bf[0] |= 1<<30; // set UP bit to 1
    DAPClientWriteBlock(&_bf[0], 1, 0xF0036030);

    //DisplayL("Safety ENDINIT was set", 1);

    DAPsetSafetyEndinit( _pass );

    DAPClientReadBlock(&_bf[0], 1, 0xF0036130);
    DisplayL("TRAPDIS_0 WR", _bf[0]);

    DAPClientReadBlock(&_bf[0], 1, 0xF0036010);
    DisplayL("OSCCON RD", _bf[0]);


    The bus error appear during the first CCUCON0 writing attempt (marked //!!!!!!!!!!!!!!!!)
    Last edited by alexeyPhyton; Jan 15th, 2020 at 02:32 AM.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.