TC4xx promo banner Banner_Aurix_Competition Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_DevelopmentStudio

+ Reply to Thread
Results 1 to 3 of 3

Thread: TLF35584 TC234 WWD application - device not going into normal mode

  1. #1
    New Member New Member Fernandes is on a distinguished road
    Join Date
    Aug 2020

    TLF35584 TC234 WWD application - device not going into normal mode

    I swear you guys at infineon have made life unnecessarily difficult. Why can't I find a single working example with the TLF?

    I am following the AP32342 app note on the tc234 application kit v1.0

    I have spi comms up and running and the TLF communicating with the tc234. I need to be able to refresh the WWD (not interested in FWD) periodically. Following is the code I have used to set this up :

    // Send unlock sequence 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_SYSPCFG0, 0x01U), &spiMasterRxBuffer); // Default value 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_SYSPCFG1, 0x08U), &spiMasterRxBuffer); // [3] ERREN=1 (Enable ERR input monitor) 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_WDCFG0,   0x9AU), &spiMasterRxBuffer); // [3] WWDEN=1,[2] FWDEN=0, [1] WWDTSEL=1 (aka SPI), [0] WDCYC=0 (aka WDCYC=0.1ms) 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_WWDCFG0,  0x00U), &spiMasterRxBuffer); // Close window CW = (0+1)*50*0.1ms = 5ms 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_WWDCFG1,  0x01U), &spiMasterRxBuffer); // Open window OW = (1+1)*50*0.1ms = 10ms 
       // Send lock sequence 
       // Refresh watchdog first call
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_WWDSCMD, 0x00U),&spiMasterRxBuffer); 
       // Go to normal state
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_INITERR, 0xFFU),&spiMasterRxBuffer); // 21. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_OTFAIL,  0xFFU),&spiMasterRxBuffer); // 22. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_OTWRNSF, 0xFFU),&spiMasterRxBuffer); // 23. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_MONSF0,  0xFFU),&spiMasterRxBuffer); // 24. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_MONSF1,  0xFFU),&spiMasterRxBuffer); // 25. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_MONSF2,  0xFFU),&spiMasterRxBuffer); // 26. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_MONSF3,  0xFFU),&spiMasterRxBuffer); // 27. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_SPISF,   0xFFU),&spiMasterRxBuffer); // 28. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_WKSF,    0xFFU),&spiMasterRxBuffer); // 29. Clear any error 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_DEVCTRL, 0xFAU),&spiMasterRxBuffer); // 30. Go to NORMAL and wait the State transition time ttr = 100us 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_DEVCTRLN,0x05U),&spiMasterRxBuffer); // 31. Inverted Go to NORMAL and wait the State transition time ttr = 100us 
       // Wait for recommended 100us for registers to set
       // Second service call 
       TLF_SPI_Exchange(TLF_ENCODE_TX_WRITE(TLF_ADDR_WWDSCMD, 0x01U),&spiMasterRxBuffer); 
       // registers to set
       // Here, Read back above protected registers and confirm if configured accurately FIXME
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_SYSFAIL  , 0x00U), &spiMasterRxBuffer);  // Read status
       stat_SYSFAIL   = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_IF       , 0x00U), &spiMasterRxBuffer);  // Read status
       stat_IF        = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_SYSSF    , 0x00U), &spiMasterRxBuffer);  // Read status
       stat_SYSSF     = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_WWDSTAT ,  0x00U), &spiMasterRxBuffer);  // Read status
       stat_WWDSTAT   = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_RSYSPCFG0, 0x00U), &spiMasterRxBuffer);  // Read status
       stat_RSYSPCFG0 = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_RSYSPCFG1, 0x00U), &spiMasterRxBuffer);  // Read status
       stat_RSYSPCFG1 = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_RWDCFG0,   0x00U), &spiMasterRxBuffer);  // Read status
       stat_RWDCFG0   = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_RWWDCFG0,  0x00U), &spiMasterRxBuffer);  // Read status
       stat_RWWDCFG0  = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_RWWDCFG1,  0x00U), &spiMasterRxBuffer);  // Read status
       stat_RWWDCFG1  = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
       TLF_SPI_Exchange(TLF_ENCODE_TX_READ(TLF_ADDR_DEVSTAT ,  0x00U), &spiMasterRxBuffer);  // Read status
       stat_DEVSTAT   = (uint8_t) TLF_DECODE_RX(spiMasterRxBuffer);
    The TLF refuses to go into NORMAL mode. The status errors I get are as follows:

    DEVSTAT : 0xF9 (still in init mode)
    WWDSTAT : 0x03
    IF: : 0x01
    SYSSF :0x02

    The device stays in init mode even if I ask it to go to another mode. Above errors pop up immediately after first watchdog service call

    What am I missing?

  2. #2
    New Member New Member Fernandes is on a distinguished road
    Join Date
    Aug 2020
    if i disable the "execute commands on rset" option (turning off the workaround for tlf reset), should the board automatically reset on POR cuz of the tlf and stay in reset loop?

  3. #3
    New Member New Member Fernandes is on a distinguished road
    Join Date
    Aug 2020
    Setting TLF_ADDR_SYSPCFG0 to 0 instead of 1 solved the issue. Little information is available in the manual/datasheet as to why

+ Reply to Thread

Tags for this Thread


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.