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.

EVMK2GX: Stuck acquiring hardware semaphore

Part Number: EVMK2GX

Trying to implement the NDK in a project. Whether I use my own project, or use the NIMU_Basic example or the NIMU_Ftp example, I get stuck at the same place in NC_NetStart. 

Ptr Osal_qmssCsEnter (void)
{
    /* Get the hardware semaphore.
     *
     * Acquire Multi core QMSS synchronization lock
     */
    while ((CSL_semAcquireDirect (NIMU_QMSS_HW_SEM)) == 0);

    return NULL;
}

Never returns. I'm not sure what I could have done to break this. My only thought at this point is that somehow the lock is not possible, but this did work the first time I loaded the example projects. 

This function is in nimu_osal.c, and the same function seems to be used in all example projects for the NDK. NIMU_QMSS_HW_SEM is defined as 2 in the header. Again, nothing has been touched as far as the example projects are concerned. This code was copied for use in my own projects.

Any thoughts would be appreciated.

  • Hi,

    Which Processor SDK RTOS is this? How do you build your NIMU_Basic example?

    Best Regards,
    Yordan

  • Hi Yordan,

    I am using SDK Ti-RTOS v6 (latest). The NIMU example is built by importing it into CCS 9 (as up to date as the updater will do).

    This used to work. I don't know what has changed, but any project that I load that tries to run NC_NetStart() will get stuck trying to aquire the hardware lock. I have powered the evm off and on multiple times. I'm loading the project using the normal target config for the evm.

    There is nothing loaded on the DSP. What else could cause this?

  • You load the GEL file first, to initialize the SoC, right?

    Best Regards,
    Yordan

  • Hi Yordan,

    Correct. The process is launch target config, which uses the evm66akg gel file. Then connect to the A15 core, then load the .out file. The dip switches on the EVM are set to no boot. I can debug and step through the code. It just stalls on getting the lock.

    I tried just skipping that call and returning, but the project crashes if I do. I assume that means that the lack of lock is a real issue.

    I have also tried to create a new project from scratch, using TI-RTOS, and adding the NDK from XCONF. The new projects also get stuck at this point. 

  • Hi Brett,

    I tested the NIMU_BasicExample_evmK2G_armExampleproject on my side.

    I created the project as follows:
      installed the latest Processor SDK RTOS and opened CCS to install the new components

      then executed the following commands to create the project:
      ykovachev@lin-0373:~/ti/pdk_k2g_1_0_14/packages$ source pdksetupenv.sh

      ykovachev@lin-0373:~/ti/pdk_k2g_1_0_14/packages$ ./pdkProjectCreate.sh K2G all little nimu all arm

    Imported the project in CCS, built it and ran it on EVMK2G. The result is as follows:

    In CCS Console I get:
     

    From UART console:

    And the ping is running as expected:

    Can you try fresh, following the above steps?

    Best Regards,
    Yordan

  • I am attaching my target configuration file as well.

    NewTargetConfiguration_K2G.ccxml

  • Yordan,

    As I have said, I used to get the same thing. It worked perfectly. Right now, I need to figure out what is causing the problem because both the production project and the example project are having the same problem. Making a brand new project did not solve the problem. I should not have to restart a production project to solve the problem. Reinstalling and re-importing an example project doesn't fix my production project. I'm going to compare your target config with the one I was using to see if there are any differences. I'm still running off the default one, but that does seem like a likely common thing.

    Does anyone know what would cause the proc to not give the lock? I've checked the power domains, and it should be enabled. The clocks should be enabled. I am certain there is nothing running on the DSP.

  • Hi,

    Does anyone know what would cause the proc to not give the lock?

    The only thing that comes to my mind is some change in the code, i.e. adding new thread in your app or some race condition.

    Best Regards,
    Yordan

  • Attached is an example project that is basically the bare bones example with the NDK added for the evmk2g. There was code there for the network open hook, but it is all commented out. On my system, it just hangs on the lock.

    Please try this and let me know if it works for you, or if you can see what I'm doing wrong, let me know. My first time with Ti-RTOS, and I'm at a loss. You might need to re-link the cppi_device.c and qmss_device.c files for your system. What ever I'm doing wrong, I'm consistent.pNDK.zip

  • Hi,

    I'll try it on my side and let you know the results.

    Best Regards,
    Yordan

  • Yordan,

    Were you able to try my example project?

    Sincerely,

    Brett

  • Hi Brett,

    Sorry for the delay, I just started testing your code, I started with the prebuilt binary available in the project and I am getting:
      CortexA15: Unhandled ADP_Stopped exception 0x800AA498

    I am trying to locate & overcome this problem.

    Best Regards,
    Yordan

  • Hi,

    I am trying your attached CCS project and will update you.

    As you mentioned earlier, this is something worked before but now stopped, what is the change you made: e.g., some change in the code? tested with a new K2G PDK? newer CCS environment? Have your tried any existing PDK NIMU/NDK projects and make sure they were working on your setup?

    Regards, Eric

  • Hi Eric,

    I was honestly just switching back and forth between the sample projects and my own projects trying to replicate the network setup. Then all of the sudden they all stopped working. Powering off/on solved nothing. Coincidentally, they now appear to work again. I'm primarily using the ftp example and the basic example. I'm not sure what is going on, but as of last Sunday it no longer stops on the hardware semaphore any longer. I'm still curious as to what could cause this. I'm still getting weird things on my project with the ndk, but the ftp project works correctly. I'll be investigating this today.

    (this is a contract project, so I mostly work on the weekends on it)

  • Hi Brett,

    I am closing this as you don't have acquiring semaphore issue. "I'm still getting weird things on my project with the ndk, but the ftp project works correctly", please open a new thread if you have other issues using NDK.

    Regards, Eric