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.

CCS/CC3220S-LAUNCHXL: Sensor Driver(OPT3001) Failed to open When Debugging takes place.

Part Number: CC3220S-LAUNCHXL
Other Parts Discussed in Thread: OPT3001, SYSCONFIG

Tool/software: Code Composer Studio

in my project i have work with opt3001 sensor drivers,

during debugging the compiler failed to open the driver file.

here you can see,

opt3001Handle = OPT3001_open(Board_OPT3001_LIGHT, i2cHandle,&opt3001Params);  //Error - failed to open

can anyone get this clear??

  • The sensor is accessed via I2C. There can be multiple reasons for the failure but the I2C connection is the first i would suspect. 

    You should check the error code received against the OPT3001 driver documentation.

    Make sure the I2C interface is configured correctly (in sysconfig).

    What do you mean during debugging? does it open the driver successfully in non-debugging mode?

    Br,

    Kobi

  • yes it open driver file in  ono-debugging mode..

    also it works well in TI Cloud CCS Compiler.

    but when debug mode::

    opt3001Handle = OPT3001_open(Board_OPT3001_LIGHT, i2cHandle,&opt3001Params);

    /* Check if the open is successful */
    if(opt3001Handle == NULL)

    {
    Display_print0(display, 0, 0, "OPT3001 Open Failed!");   // OPEN FAILED ==Program counter always stays here.
    while(1);
    }

    i don't know what to do.

  • I'm not familiar with the  OPT3001_open code. Can you step into and check exactly the point of failure?

    Again, this is probably related to the I2C configuration. Please verify the sysconfig settings carefully.

    Br,

    Kobi