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.

CC2630: ICall_createRemoteTasks excepts on Task_restore call, I'm not sure what to make of the data.

Part Number: CC2630
Other Parts Discussed in Thread: TIMAC, SYSBIOS

I am trying to init the ICall stack similar to the MSA example for TIMAC (I am stuck with this hardware so switching isnt possible). I am properly making the ICall calls from a task function. This issue seems common with many causes. This and this case were having a disabled application security stack while it was enabled in the stack (I tried both ways wothout success). I do not know how to evaluate which stack I am running with -- I am writing this for a deployed product so I am completely stuck with whatever is on that ROM. It's whatever the chip shipped with.

I am also observing Task_restore be called earlier in the programs execution without issue so its not that function, per se. My program also works fine without the ICall functions at all (I have working support for GPIO, UART and i2c).

The exception redirects to my handler function but the reported registers don't make any sense. I'm guessing its just a pointer to uninitialized memory.

  • PC -> 0x20000208 (user0Cfg)
    • Why would PC point at this address?
    • I set a breakpoint here just in case but it never runs
  • SP -> 0x1001B429 (ti_sysbios_knl_Task_exit__E)
    • Why is SP pointing to rom?

Stepping through the code and assembly the call chain is

  1. Taskfxn (called as a task from main)
  2. ICall_createRemoteTasks
    1. Task_restore
    2.  ti_sysbios_knl_Task_restore__E():
      1. ICall_taskEntry
        1. Jump to 0x9001 (thumb to ICALL_STACK0_ADDR)
          1. Jump to 0x897C which has no label (ICall_threadStackSizes + 0x18E4)
          2. The exception sometimes happens on the jump, sometimes dozens of steps later.

I'm lost on what to do here or how to make sense of the info I have. It's not even clear to me what insturction is cuasing the issue.

  • Hi Daniel,

    Have you evaluated the default MSA example and verified that it works?  Are you attemptingSection 2.1.2 of the CC26xx MAC Sample Application Software Design:

    ICall stands for indirect function call dispatcher. ICall allows radio stack software to support both OSAL and TI-RTOS and to allow independent update of application image and stack software image. The ICall hides the OSAL and TI-RTOS differences by working independently of actual handler function address. In other words, ICall separates OSAL and TI-RTOS domains, allows independent upgrade of either domain and provides interface between the two domains through indirect function calls. 

    And Section 3.2:

    The Stack API provides MSA application interface to MAC stack over ICall. The Stack API and message format are listed in ‘MacStackMSG.h’. User’s application should include ‘ICall.h’, ‘Macs.h’, and ‘MacStackMSG.h’ header files to use Stack APIs. The Stack API allows MSA or user’s application to call the MAC stack with one-on-one matching function name and data structure of MAC’s legacy API listed in ‘mac_api.h’.

    Are you trying to use ICall without the TIMAC or create an application outside of MSA?  Either way, I would suggest starting with a working MSA example and build up your application from there.  Make sure you are compiling and programming both the stack and application images (follow the MAC User's Guide in C:\ti\simplelink\timac_1_05_02_43299\Documents), as missing the Stack image could result in missing symbols which causes your device to enter an unknown state.

    Regards,
    Ryan

  • The stack was the issue. I flashed the stack project from the MSA example and it suddenly works. I had thought that these calls were already in ROM.

    I'm still not clear on what's being put where. The file produced by that project is being flashed to address 9000-D050 -- which if I'm not mistaken is flash not ROM.

  • Not all 15.4-Stack resources exist in ROM and must be accounted for in the flash.

    Regards,
    Ryan