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.

RTOS/LAUNCHXL-CC26X2R1: CPU hangs when starting I2S function in ble5stack project

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi 

We try to integrate the "ti/simplelink_cc13x2_26x2_sdk_3_10_00_53/examples/rtos/CC26X2R1_LAUNCHXL/drivers/i2secho" example into ble5stack project(project_zero & simple_peripheral).
The CPU will hang when running the program(without any exceptions, errors and logs). 

I try to step by step debug, if the program execute I2S_startRead()/I2S_startWrite() function, then the program can't be executed anymore(CCS still keep run state).

Because without any exceptions & errors, we don't have any idea to debug. could you help to check this issue?

Thanks.

BR

Trevor  

  • Hi Trevor,

    I'm assigning this to our I2S expert.

  • Hi 

    I use ROV tool, then catch the two errors:

    1. In BIOS module(SCAN FOR ERRORS)

    ti.sysbios.family.arm.m3.Hwi Module
    exception
    An exception has occurred!
    ti.sysbios.knl.Clock Module
    Caught exception in view init code: "/home/qic/ti/xdctools_3_51_02_21_core/packages/xdc/rov/StructureDecoder.xs", line 518: java.lang.Exception: Target memory read failed at address: 0x20007c08, length: 32 This read is at an INVALID address according to the application's section map. The application is likely either uninitialized or corrupt.
    2. In Task module
    Error: java.lang.Exception: Target memory read failed at address: 0x20004dbc, length: 76 This read is at an INVALID address according to the application's section map. The application is likely either uninitialized or corrupt.
    Do you have any suggestion to us?
    Thanks.
    BR
    Trevor
  • Hi Trevor,

    An important remark to begin: you should avoid to use the step by step debug when the I2S driver is active (meaning between I2S_startRead()/I2S_startWrite() and I2S_stopRead()/I2S_stopWrite()). This mess up with the interrupts and the I2S module runs out of data (causing trouble). I recommend you to use different ways to debug (such as toggle an IO pin). If you stop (pause) the execution while the I2S is active, you have to reset the board.

    Regarding your errors, in order to get more details, you can try the following:

    -          Identify what the read failed addresses are mapping

    -          Identify “who” is trying to read to these addresses

    Best regards,

  • Hi  Clément,

      Because there are no exceptions and errors, I try to debug it step by step.

      I guess it must use icall_malloc to create an I2S buffer in ble5stack(Right?). In the old example, it uses RAM as the I2S buffer .

    It is easy to add I2s_echo into ble5stack project, could you help to try it on your side?

    Thanks

    BR

    Trevor

  • Hi Clément,

    Please ignore the previous ROV error. Regarding this error, it will happen in the default ble5stack project, I have opened a new thread to discuss this issue: ROV_Error

    Regarding the CPU hangs, we really need TI's help, because there are no exceptions and errors, we don't know how to debug this problem.

    We don't make any modifications to the SDK/source code, we just copy/paste from i2secho to simple_peripheral(please see the following photo).

    After run this program, we observed the following behavior:

    1. CCS is still running(it looks like everything is okay).

    2. UART doesn't display any logs.

    3. Button does not respond.

    Thanks.

    BR

    Trevor

  • Hi Trevor,

    Regarding the ROV error you are experiencing, this is a known issue (due to the way of working of the ROV and the way of the BLE stack is allocating heap). You can have a look to this file: simplelink_cc13x2_26x2_sdk_3_10_01_06/docs/ble5stack/ble_user_guide/html/ble-stack-5.x-guide/debugging-index.html#workaround-for-rov (or look for “Workaround for ROV”). Hopefully, this will help you to get the ROV to work.

    Regarding your code, can you verify the following for me please?

    -          Verify if you do no run out of stack or heap (to do so, the best solution is to use the ROV)

    -          Verify the content of your callbackFunctions

    -          Verify if I2S_open() does not generate an error (i.e. returns NULL)

    -          Verify if the I2S returns an error (to do so, you can put a breakpoint in the errCallbackFxn and eventually read the status you get)

    You can as well try to write the I2S code after calling “ICall_registerApp(&selfEntity, &syncEvent);”.

    It would be also interesting to understand where the program ends up (I guess you have a non-responding program because you end up in the infinite loop of an exception or something close to that). To do so, you can suspend the execution after a while then have a look to the assembly code (or ROV can do the work for you).

    Best regards,

  • Hi Clément,

    After fixing the ROV problem, I only catch the HWI exception, please see the following photo. Do you have any idea?

    I also trace/debug the code, it seems that CPU may have an HWI exception after executing the following function. 

    __STATIC_INLINE void
    I2SIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
    {
        // Check the arguments.
        ASSERT(I2SBaseValid(ui32Base));
    
        // Enable the specified interrupts.
        HWREG(I2S0_BASE + I2S_O_IRQMASK) |= ui32IntFlags;
    }

    Thanks.

    BR

    Trevor

  • Hi,

    Good to see that we are progressing! Have you verify all the points I have listed in my previous message (it would be nice to so)?

    Can you also confirm that you do execute I2S_init() before the rest of your I2S code?

    Regards,

  • Hi Clément,

    Ohhhhhhhh, I didn't run the I2S_init() function, it works. Thank you very much. 

    BR

    Trevor