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.

  • Resolved

CCS/CC1352P: ADCBuf SwiFxn issue

Prodigy 180 points

Replies: 17

Views: 409

Part Number: CC1352P

Tool/software: Code Composer Studio

Hi,

I'm using multiple ADC channels. one of them is used by the Sensor controller.

Randomly when using ADC measurement from both sides (MCU and SC, note:  HW semaphore is used to determine which is the current controller and work great), I get HW reset.

after investigation of this issue, I'm noticed that the function 'ADCBufCC26X2_swiFxn' in 'ADCBufCC26X2_open' randomly set the 'object->activeSamplebuffer' from normal address to 0XFFFFFFF and then we got assertion.

  • Hi Moshe,

    What mode are you running the ADCBuf driver in? Have you made a convert prior to this or do you go straight from open -> exception?

    Best regards,

    M-W

    I'm currently out of office until January 2020, there will be no answers during this period. Please feel free to open a new thread using the "Ask a related question" if you feel that your see your thread with me has not been picked up by someone else.

  • In reply to M-W:

    Hi,

    This is my Implementation:


    // Set up an ADCBuf peripheral
    ADCBuf_Params_init(&gADCData.adcBufParams);
    gADCData.adcBufParams.callbackFxn = ADC_BufCallback;
    gADCData.adcBufParams.recurrenceMode = ADCBuf_RECURRENCE_MODE_ONE_SHOT;
    gADCData.adcBufParams.returnMode = ADCBuf_RETURN_MODE_CALLBACK;
    gADCData.adcBufParams.samplingFrequency = gADCData.A2DCfg.frequencyHz; // Hz
    gADCData.adcBufParams.custom = &gADCData.adcBufParamsExt;
    gADCData.adcBuf = ADCBuf_open(gADCData.A2DCfg.ADCBufId, &gADCData.adcBufParams);

    if (NULL == gADCData.adcBuf)
    {
    // AdcBuf did not open correctly.
    break;
    }

    // Control ADC Hardware semaphore to keep while converting //
    ADCBuf_control(gADCData.adcBuf, ADCBufCC26X2_CMD_KEEP_ADC_SEMAPHORE, NULL);
    ADCBuf_control(gADCData.adcBuf, ADCBufCC26X2_CMD_ACQUIRE_ADC_SEMAPHORE, NULL);

    // Configure the conversion structure
    gADCData.continuousConversion.arg = NULL;
    gADCData.continuousConversion.adcChannel = gADCData.A2DCfg.ADCBufChannel;
    gADCData.continuousConversion.sampleBuffer = gADCData.pBuffer;
    gADCData.continuousConversion.sampleBufferTwo = NULL;
    gADCData.continuousConversion.samplesRequestedCount = gADCData.A2DCfg.NumOfSamples;



    // Start converting.
    if (ADCBuf_STATUS_SUCCESS != ADCBuf_convert(gADCData.adcBuf, &gADCData.continuousConversion, 1))
    {
    // Convert failed
    break;
    }
  • In reply to moshe genish:

    Thanks for sharing Moshe,

    Could you also elaborate on when the exception happens more exactly? Based on the callstack you provided, I can see that you are inside the Swi, now the question is how you got there. Did you get there directly following the ADCBuf open, or following the convert?

    Best regards,

    M-W

    I'm currently out of office until January 2020, there will be no answers during this period. Please feel free to open a new thread using the "Ask a related question" if you feel that your see your thread with me has not been picked up by someone else.

  • In reply to M-W:

    Hi M-W,

    I get there directly following the 'ADCBuf open'.
  • In reply to moshe genish:

    Hi Moshe,

    Are you still applying the fix proposed to you in this thread (the post marked as resolved)?

    e2e.ti.com/.../759875

    Best regards,

    M-W

    I'm currently out of office until January 2020, there will be no answers during this period. Please feel free to open a new thread using the "Ask a related question" if you feel that your see your thread with me has not been picked up by someone else.

  • In reply to M-W:

    Yes.
  • In reply to Aviv Agam:

    Hi Aviv,

    This sounds strange, in that case I would assume you are actually not having the exclusive access to the ADC that you assume you have.

    I can see that you don't check the return value of the "ADCBufCC26X2_CMD_ACQUIRE_ADC_SEMAPHORE" call, could you do this and make sure that you are actually successful in acquiring the ADC semaphore before proceeding?

    Best regards,

    M-W

    I'm currently out of office until January 2020, there will be no answers during this period. Please feel free to open a new thread using the "Ask a related question" if you feel that your see your thread with me has not been picked up by someone else.

  • In reply to M-W:

    Hi M-W,

    OK, Thanks.
    I will implement checking the return value of "ADCBufCC26X2_CMD_ACQUIRE_ADC_SEMAPHORE" call, and I will update.
  • In reply to moshe genish:

    Hi Moshe,

    Do you have any update on the issue?

    Best regards,

    M-W

    I'm currently out of office until January 2020, there will be no answers during this period. Please feel free to open a new thread using the "Ask a related question" if you feel that your see your thread with me has not been picked up by someone else.

  • In reply to M-W:

    Hi M-W,

    still in tests. I will update as soon as possible.

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.