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.

TMS570LS0714: the confilict between Vector Autosar OS and TI VIM

Part Number: TMS570LS0714
Other Parts Discussed in Thread: MOTORWARE, HALCOGEN

After flashing hex of StartApplicationBug project into the board, it is found that the program cannot run in the board. At this time, the board consumes very little current, only 0.082A, as shown in the figure below:

6866.StartApplicationGood.zip

After flashing hex of StartApplicationGood project into the board, it is found that the program can run in the board. At this time, the board consumes current, 1.087A, as shown in the figure below:

These two projects in the attachment.

 

Both these two procjects use AcPmsm_FocLoop() function, the difference is:

In the project of StartApplicationGood,AcPmsm_FocLoop() is running in the task of “1ms runnable”, which is from Vector Autosar.

 

In the project of StartApplicationBug,AcPmsm_FocLoop() is running in the Interrupt of “epwm”, which is from Ti Vim.

So, we just don’t know why this interrupt cause this hex can’t run in TMS570LS0714.

  • Hello,

    The StartApplicationGood uses the Vector AutoSar. The MCAL driver in Vector Autosar uses N2HET to generate PWM signals, and capture the input pulses. 

    The StartApplicationBug uses ePWM. Please make sure that your FOC supports ePWM. Is the ePWM interrupt interval long enough to process the FOC? What is the frequency of the ePWM signal? 

  • Hi Mr Wang,

    Thanks for your reply.

    But the truth is: FOC must use ePWM interrupt operation. The PWM frequency is 16KHz, so the ePWM interrupt period is 62.5us. The running length of FOC is less than 30us. The length is enough. In addition, experiments have proved that even if there is no execution code in the ePWM interrupt, the same problem will occur as long as the ePWM interrupt is turned on. Therefore, there is no correlation with the operating time of the FOC. There must be some another reason caused this issue.

  • Hello Zhenzhen,

    What is the relationship between ePWM and your FOC algorithm? Did you get any issue in ePWM interrupt if FOC is not used?

  • Hi Mr Wang,

    If I want to make the motor to turn well, I have to use my FOC algorithm. If I want to use my FOC algorithm, I have to use ePWM of Ti. If I use Ti's ePWM interrupt, the Ti's interrupt has the confilict with the Vector Autosar OS. This is the problem.

  • Our motorware example doesn't use ePWM for PWM generation. I will check C2k FOC example how the ePWM interrupt is used.

    Do you have any issue to generate ePWM interrupt without using FOC?

  • Hi Mr.Wang

    Thanks for you check.

    For your question: "Do you have any issue to generate ePWM interrupt without using FOC?"

    The truth is: If I initialize the ePWM interrupt, no mater FOC has been used or not, the hex can't running in the chip.

  • zhenzhen duan said:
    The truth is: If I initialize the ePWM interrupt, no mater FOC has been used or not, the hex can't running in the chip.

    This might be the cause of your issue. Please double check if the ePWM interrupt is configured properly:

    1. Use ETSEL to select the event trigger and enable the ePWM interrupt

    2. Enable the proper channel of VIM table

    To start the ePWM, the pinmux37 should be configured properly. Call etpwmStartTBCLK()  

    The ePWMx modules implement a mechanism that allows their time bases to be synchronized. This is done by using a signal called TBCLKSYNC, which is a common input to all the ePWMx modules. This TBCLKSYNC is generated by a register bit in the I/O multiplexing module. PINMMR37[1] is the TBCLKSYNC signal. This bit is clear (0) by default.

    When TBCLKSYNC = 0, the time-base clock of all ePWMx modules is stopped. This is the default condition.
    When TBCLKSYNC = 1, the time-base clocks of all ePWMx modules are started aligned to the rising edge of the TBCLKSYNC signal.

  • Hi Mr.Wang,

    The ePWM configuration you mentioned, we make it excatly according to Ti datasheet. The ETSEL, VIM, startTBCLK(),..., we make them all according to Ti datasheet.

    If you really look at our codes carelly, you can find what we did to ePWM is according to Ti datasheet.

    If you can't point any valuealbe technonoly route to resolve this problem, please transfer this issue to your American colleague.

  • Hello,

    1. The zip file you posted contains MCAL driver, the MCAL configuration files (generated by EB Tresos), peripheral drivers generated through HALCoGen, and some BSW files. It is not a complete project which can be imported to CCS. It's not easy to understand the structure of your project: For example, I found the main() function located in BrsAsrMain.c, but I could not find the functions called in main(): OS_InitMemory(), Init_Init(), EcuM_Init(),etc.   

    2. Your zip file contains etPWM.c which is generated by HALCoGen, but you added your own ePwm_init() in this file. The functions called in ePwm_Init() are not from HALCoGen. I have to check all the registers used in your ePWM config functions. Yes, ePWM2 interrupt is enabled in your code, and VIM channel 92 is also selected to use FIQ. But I could not find where the FIQ is enabled in your code. If FIQ (CPSR) is not enabled, the peripheral can not generated a FIQ interrupt.  The ePwm_Init() is only called in Tle9180.c. The ePwm_Init() is commented out in startApplication.c, MotorDriver.c. 

    3. From your compile log file (makelog.txt), the etPwm.c is not included. My understanding is that the etPWM is not really used.  

    4. Both the MCAL PWM code and etPWM code are used in your project. MCAL PWM is generated using N2HET. How to you use those PWM for your motor control. If you want to use the PWM generated from ePWM module, you need to add ePWM functions to AutoSar complex driver.    

    5. If you think my questions make no sense, Please provide us detailed information about your code, don't let me guess. Thanks

  • 1. The missing function is the static code of AUTOSAR. main() is called in the _start() function. 

    2. FIQ interrupt mode can be entered. The prove is that in debugger interface of CCS, the etpwm2interrupt function can be entered if a breakpoint has been settled here. Another prove is that the interrupt CPSR register can be enabled. Although this function is created y us, but the definition is as same as the halcogen define function. Yes, Etpwm initialization is only called in tle9180.c.

    3. The makelog.txt is created by us manually, which is used to debug other issues. Compilation will not generate makelog.txt file, so this file has no any reference value.

    4. Pwm is used in FOC, shielding the entire FOC means that pwm is not used, and it will not affect the operation of the program. Our etpwm driver has epwm_init and FIQ related to it, which doesn't work correctly. We need to find the reason together.

    5. We will try our best to provide the useful information to locate the root cause.And we have sent  the code package to you by email.

     Looking forward to your email confirmation.Thank you.

    Thanks and Regards

  • working on thi soffline.