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.

The problems of Fee in MCAL module based on TMS570LS0714 chip

Other Parts Discussed in Thread: TMS570LS0714, HALCOGEN

Hello all,

      1. First, set a breakpoint in Fee_Init() and let the program run to Fee_Init(), and then step to the Fee_MainFunction().State, a symbol for debugging, showing MEMIF_BUSY,              indicates the Fee module is currently busy (see Figure 1), which correspond to the Specification of AUTOSAR (see Figure 3).

                                                            

                                                                                                                           Figure 1

     2.  Then, set a breakpoint in Fee_Write() to let the program continue to run, but the program can't run to Fee_Write() and jump to Fee_Init(),State, a symbol for debugging,                  shows  MEMIF_BUSY. The initialization of Fee module fails (see Figure 2). it does not comply with the Specification of AUTOSAR,which specifies State as MEMIF_IDLE              after Fee_Init() (see Figure 4).

                                                             

                                                                                                                             Figure 2

                                                                    

                                                                                                                           Figure 3

                                                                                  

                                                                                                                            Figure 4

        3. In addition,I wonder if it needs to initialize Fls module before  initializing Fee module(i.e. call Fls_Init before Fee_Init()).

         Can someone do a favor for me?

  • Hello Hong,

    After Fee_Init is called, please check the value in variable TI_Fee_GlobalVariables[0].Fee_Error. If it shows Error_SetupStateMachine, it means the Ewait states is not correctly configured. Please check device data sheet and configure correct EWAIT state. Fls module initializing is not required.
  • Hi Vishwanath,

       After Fee_Init is called, the value in variable TI_Fee_GlobalVariables[0].Fee_Error is 0xff(see Figure 1).

       In addition, When I set a breakpoint in Fee_Init(), let the program run to Fee_Init(), then set a breakpoint in Fee_Write(), let the program continue to run, the program does not

    run to  Fee_Write(), but jumps to Fee_Init().


                                                                                                                                      Figure 1

    Regards,

    Yunqiang.Hong

     

  • Hi,

    Looks like FEE sections are not correctly assigned in linker command file. Below is an example of FEE memory sections. Please check if you have similar settings in your linker command file.

    FEE_TEXT_SECTION : {} > FLASH0 | FLASH1
    FEE_CONST_SECTION : {} > FLASH0 | FLASH1
    FEE_DATA_SECTION : {} > RAM
  • Hi  Vishwanath,

         There are't similar FEE sections settings in my linker command file(see Figure 1 and Figure 2).

                                                                                                                          Figure  1

                                                                                                                                 Figure 2

       Should  I  add  FEE sections in SECTIONS of  Figure 2 ?  How to add ? Can you provide me an example for reference ?  I‘m a green hand. :)

    Thanks and Regards,

    Yunqiang.Hong

  • Hi,

    Based on the linker settings you sent, please use following:

    FEE_TEXT_SECTION : {} > FLASH0
    FEE_CONST_SECTION : {} > FLASH0
    FEE_DATA_SECTION : {} > RAM

  • Hi Vishwanath,

      Now, the value in variable TI_Fee_GlobalVariables[0].Fee_Erro  shows Error_SetupStateMachine(see Figure 1) . As you said, it should the Ewait states is not correctly configured.

                                                                                                                                 Figure 1

      I spend a lot of time studying device data sheet(TMS570LS0714), but I don't know How to configure correct EWAIT state. Instruct me:)

    Thanks and Regards,

    Yunqiang.Hong

  • Hi,

    Are you using HALCoGen as startup code? Is yes, following piece of code does(write to EEPROM_CONFIG_HL) the setting of wait states for FEE bank.

    void setupFlash(void)

    {

    /* USER CODE BEGIN (6) */

    /* USER CODE END */

       /** - Setup flash read mode, address wait states and data wait states */

       flashWREG->FRDCNTL =  0x00000000U

                          | (uint32)((uint32)3U << 8U)

                          | (uint32)((uint32)1U << 4U)

                          |  1U;

       /** - Setup flash access wait states for bank 7 */

       FSM_WR_ENA_HL    = 0x5U;

       EEPROM_CONFIG_HL = 0x00000002U

                        | (uint32)((uint32)3U << 16U) ; /*EWAIT states */

    /* USER CODE BEGIN (7) */

    /* USER CODE END */

       /** - Disable write access to flash state machine registers */

       FSM_WR_ENA_HL    = 0xAU;

       /** - Setup flash bank power modes */

       flashWREG->FBFALLBACK = 0x00000000U

                             | (uint32)((uint32)SYS_ACTIVE << 14U) /* BANK 7 */

                             | (uint32)((uint32)SYS_ACTIVE << 2U)  /* BANK 1 */

                             | (uint32)((uint32)SYS_ACTIVE << 0U); /* BANK 0 */

    /* USER CODE BEGIN (8) */

    /* USER CODE END */

    }

    In data sheet, page 42 has following. Based on the frequency of the device, you need to configure correct EWAIT states.

  • Hi Vishwanath ,

      I'm using HALCoGen as startup code and using  PGE,160MHz(see Figure 1 and Figure 2). Do you  realize  160MHz  in your code? If not, Should I modify in your code?Instruct me.:)

                                                                            Figure  1

    Thanks and Regards

    Yunqiang.Hong

                                                                                                                                Figure 2

  • Hi,

    Please refer system.h file for operating frequency. Normally GCLK_FREQ/HCLK_FREQ is the CPU operating frequency. In system.c file, refer setupFlash() and verify if the wait states are configured correctly.

    FEE operating frequency should be same as the frequency configured in system.h file.
  • Hi Vishwanath,

       How to verify if the wait states are configured correctly? Because I am specializing in MCAL, I am not familiar with the operation of the TMS570 chip and registers. Please instruct me.:)

                                                                                  Figure 1

    Thanks and Regards

    Yunqiang.Hong

  • Hi,

        Fee_Init passed, but it can't be written(See Figure 1).Please instruct me.:)

                                                                                                                                Figure 1

    Thanks and Regards

    Yunqiang.Hong

  • Hi,

    After Fee_Init is called, please check the value in variable TI_Fee_GlobalVariables[0].Fee_Error. Is Fee_Init was successful, sector header should have been written into FEE bank.

  • Hi,

        Now,Fee module can write and read(see Figure 1),but the frequency at which Flash will operate isn't  160MHz ,but 80MHz .  Can  the frequency of Flash be operate in 160MHz? If any ,what should I do?

                                              

                                                                                                          Figure 1

    Thanks and Regards

    Yunqiang.Hong

  • Hi,

    FEE can operate at 160MHz. You need to correctly configure frequency in HALCoGen and generate the files. Verify if the Ewait state is generated correctly. In next step, configure the same frequency in EBTresos and generate files. Run Fee_Init any verify if data is getting written to sector header.
  • Hi,

        How  correctly configure frequency in HALCoGen ? Can you provide some pictures about it?

    Thanks and Regards,

    Yunqiang Hong.

  • Hi,
    I have correctly configure 160MHz in HALCoGen and generate the files, but it can't pass Fee_Init(). However, 80Mhz is work.
    Why?
    Thanks and Regards
    Yunqiang Hong.
  • Hi,

    I have attached HALCoGen based TI FEE project for TMS570LS0714 device. I have configured TI FEE to operate at 180MHZ and was able to perform Writes. Please compare it with your project. Please note that the FEE  I have used is HALCogen based but not Autosar API's. However, this should not make any difference in FEE operation as Autosar FEE is a wrapper around HALCoGen based FEE.https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/2134.Fee_5F00_Forum0714.7z

  • Hi,

       I know that you have revised minor problems on PORT  in the previous version of the code in order to being consistent to the code which EB configuration tool generates?

        Have you ever configured  FEE in the EB configuration tool and tested it please?

    Thanks and Regards

    Yunqiang.Hong