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.

EtherCAT app crashing with SWI enabled

Other Parts Discussed in Thread: SYSBIOS

I removed all TI software. I installed Code Composer Studio 5.4.0.00091, Industrial SDK 1.0.0.8, and IPC 1.25.02.12. I built the example EtherCAT project and ran it on the ICE board just fine. I opened the ethercat.cfg and in the BIOS->Runtime settings, enabled the "Enable Software Interrupts" (SWI) option and rebuilt the example. The application crashes when I try to put it in Free Run Mode (using TwinCAT as the master).

Could someone at TI confirm this issue?

I've attached the map file. Here is the register dump:
[CortxA8]
Hwi handle: 0x0.
Hwi stack base: 0x800245dc.
Hwi stack size: 0x2000.
R0 = 0x8001b1d8  R8  = 0x00000000
R1 = 0x00000000  R9  = 0x00000002
R2 = 0x8001b3e0  R10 = 0x000000ff
R3 = 0x8001b3ec  R11 = 0xffffffff
R4 = 0x8000019f  R12 = 0x8001b3ec
R5 = 0x00000001  SP(R13) = 0x80026538
R6 = 0x80023978  LR(R14) = 0x80016814
R7 = 0x00000000  PC(R15) = 0x8001a564
PSR = 0x6000019f
ti.sysbios.family.arm.exc.Exception: line 176: E_dataAbort: pc = 0x8001a564, lr = 0x80016814.
xdc.runtime.Error.raise: terminating execution

  • Hi,

    We do not use SWI in the application - you might want to set below config option to true as otherwise it will be conflicting 

    ti_sysbios_hal_Hwi.dispatcherSwiSupport = true;

  • Hi Pratheesh,

    I know that the SWI is not used in the example. However, I need to use the SWI for my own application that will be using the EtherCAT application. This problem is not specific to just this example. I have this problem with every application that is being built with the latest TI software. I have worked with previous versions of CCS (5.3 and older) and previous versions of the Industrial SDK (1.0.0.4 and older) without any issues. I'm trying to port my application to the latest versions and am running into this exception. I am trying to showcase a standard example out of the box that is also having an issue with simply enabling support for SWIs.

    I have also tried enabling software interrupt support in the Hwi module. The result is still an exception. Please take a few minutes to test for yourself to confirm the issue.

  • Hi Pratheesh,

    Did you have a chance to confirm whether you could duplicate the issue with enabling SWIs? I don't mean to consume too much of your time, but I couldn't think of a simpler setup and application to demonstrate the issue. Please let me know your results.

  • Hi,

    if you see issues with a Sys/Bios component but it is not really in use then I would assume it is not a problem of our IA-SDK code. So I would suggest to post the issue in Bios forum instead.

    I do assume that it should be possible to recreate the issue with a normal task application that calls an SWI if it exists. However this could also be related to something else (e.g. a stack overflow due to more memory required in case of SWI enabled).

    Regards.

  • Hello,

    We are still working on CCS 5.3 and we could not reproduce the issue. I will try your changes on CCS 5.4 soon and will let you know the results.

    Thanks,

    Shahid

  • Frank,

    Please let me correct my earlier statement: "This problem is not specific to just this example. I have this problem with every application that is being built with the latest TI software.". I'm actually having this problem only when building my application with EtherCAT using the latest TI software. I observed the problem for both the demo EtherCAT application and for the "full" EtherCAT application (the one where I have to provide the EtherCAT slave code). The problem occurs when I try to activate Free Run mode via TwinCAT.

    I can build my application (without the EtherCAT application), which does use HWIs and SWIs, and run it with no issues. I initially observed the exception after porting my application to the latest EtherCAT application. I have been able to isolate the problem to just the EtherCAT applications.

    I've tried bumping up the HWI and SWI stack size, but this didn't help.

  • Hi Fyang,

    Thank you for bringing this up, there is an issue with EtherCAT when swi module is enabled. 

    The issue is related DISABLE_ESC_INT and ENABLE_ESC_INT. These functions conflicts with Sysbios swi module in some cases. This can be fixed by modifying 

    these two macros in tieschw.h as given below. This fix will be available in the next release.

    #define DISABLE_ESC_INT() Hwi_disableMIR0(0xB00000);
    #define ENABLE_ESC_INT() Hwi_enableMIR0(0xB00000);

    Regards,

    Shahid

  • Shahid,

    I have verified that the fix works. Thanks for investigating this problem.