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.

Problem with initialization of ICSS in MAC/Switch Mode (TaskOSAL)

Other Parts Discussed in Thread: SYSBIOS

Hi,

I use IDKAM437x with sdk 2.1.1.2, sysbios 6.42.3.35 and ndk 2.24.3.35 and would like to establish PRUICSS1/PRU0/1 in double Mac mode based on the ethernet_mac example from sysbios sdk.

I copied most of the main() function into one of my functions executed before start of BIOS. Most of the commands is executed properly, but my code breaks down when achieving functions: ICSS_EmacInit(emacHandle1, &pruss_intc_initdata, ICSS_EMAC_MODE_MAC1 | ICSS_EMAC_MODE_DUALMAC); However, it is executed without problems when downloading ethenet_mac example or NIMU_ICSS_BasicExample_idkAM437x_wSoCLib_armExampleproject from latest pdk. The way and sequence of peripheral initialization is preserved, also the *cfg configuration files (Global Network Settings and IP blocks) of all these projects look the same - and I really do not know what more should be modified. With step by step debugging, I know the critical moment of ICSS configuration is TaskOSAL_create in ICSS_EmacOSInit.

Is there any essential thing to be set before these steps which might have been omitted by me?

Thank you,

JJ

  • The ISDK team will look into this.
  • Hi JJ,

    Did you check the build options to see if it makes difference? for example,

    "C:/ti/ccsv6/tools/compiler/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a -marm -mfloat-abi=hard -Dam4379 -DSOC_AM437x -DAM4XX_FAMILY_BUILD..."

    You can select and define these build options in your CCS project properties -> Build->GNU Compiler->Runtime and Symbols.

    And what exact error are you observing from ICSS_EmacInit()? Do you mean TimerP_create instead of TaskOSAL_create in ICSS_EmacOSInit()?

    Regards, Garrett

     

  • Hi Garrett

    Thank you for your answer.

    I tried changing the bulid options what gave me no result- however majority of them is consistent with what you wrote above.

    My problem exists after entire build process and downloading the code into the idk am437x. The code of ICSS preparation for MAC service (copied from ethernet_mac example) need to be done before starting BIOS. In the code copied to my application, the handles for PRUICSS and EMAC are obtained and a switchEmacCfg object is configured for the respective EMAC handle. The last thing to be done is initialization of PRUICSS/EMAC by the following set of instructions (taken from ethernet_mac example):

    PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTCX_INITDATA;
    ICSS_EmacInit(emacHandle1, &pruss_intc_initdata,ICSS_EMAC_MODE_MAC1 | ICSS_EMAC_MODE_DUALMAC);
    ICSS_EmacInit(emacHandle2, &pruss_intc_initdata,ICSS_EMAC_MODE_MAC2 | ICSS_EMAC_MODE_DUALMAC);

    When the ethernet_mac example is built and downloaded into my idkam437x, the above code is executed without any problems. In my application (with EMAC configuration code copied into separate function) execution of first ICSS_EmacInit() function gives an error and the BIOS runs the __exit() function. Second time I followed the code step by step into that function and found out that the problem exists during a call of ICSS_EmacOSInit() function. Inside of it, one of the functions (named TaskOSAL_create) is repsonsible for generating the Task for emac handling. I do not know why but the task cannot be created and it crashes when trying to do it. That is probably because I missed initialization of something, but I do not know what could be essential when creating this task.

    Regards,

    JJ

  • Hi Jacek,
    you may use ROV to check for any BIOS issues such as stack overrun...

    Regards,
  • Jacek,

    Regarding stack overrun Frank suggested, you can refer to SYS/BIOS (TI-RTOS Kernel) v6.45 User's Guide,
    3.6.4 Testing for Stack Overflow
    7.5.3 ROV for System Stacks and Task Stacks

    Also below links may help. Check if you run out of heap memory when you dynamically create a Task instance.
    e2e.ti.com/.../369203 Task_create() returns null handle
    e2e.ti.com/.../924687 Task_create Problem

    Regards,
    Garrett
  • Hi Frank & Garett,
    Well, indeed that was a stack overflow - what is weird because I reserved the same size as in ethernet_mac example. There is quite a big difference in memory usage between the tasks of ethernet_mac example and 'my' tasks doing the same job - but it is not the issue of this topic.
    Thank you very much for your help!
    JJ