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.

AM2634-Q1: Autosar : ADC result buffer updation inconsistency

Part Number: AM2634-Q1

There are some observations related to the buffer updation in the ADC Result register and the SW buffer collected using Adc_ReadGroup API.

Both HW and SW triggered SoCs for the ADC groups have the below configurations:

Group access and conversion modes : Single One-Shot

Streaming buffer mode : Linear.

Streaming samples : 1

Scenario 1 : HW and SW SoC enabled and triggered

Case 1:  Adc_ReadGroup API not called

ADC Result register has as many entries as the HW and SW channels mapped to the group

Case 2: HW and SW SoC trigger enabled; Adc_ReadGroup API called

Query : More number of result registers are getting updated (for the HW triggered group) only when Adc_ReadGroup API is called. Is it a valid behavior?

Scenario 2 : SW buffer collected does not match the ADC result register values for the HW triggered SoC (using  Adc_ReadGroup API)

Case 1:  Only HW triggered SoC. Read results do not match

Case 2:  Only SW triggered SoC. Read results match

 

Scenario 3 : Adc_GetGroupStatus does not seem to show a change in the ADC group status. Always remains in ADC_BUSY state after initiation of SoC (both HW and SW triggered). Hence we are unable to get to a confirmed state for collecting ADC results in polling mode. 

Can we have short alignment to discuss the observed behaviors please.

  • Hi Ashish,

    We are checking on this and will get back to you if need to align.

    Thanks,

    Sunil

  • Thanks for the quick update Sunil. The main control boards have arrived now and we would need to start validating the peripheral drivers on them. If any inputs are needed from my end (incase the scenarios are not clear and so on..) to speed up the process do let me know. 

  • Hi Sunil,

    Any update from your side related to the issue. Do you think we could have a short alignment today?

  • Hello Ashish,

    Please find the updates:

    Scenario 1 and Scenario 3 :

    <<
    We were able to reproduce the issue.
    We shall update on it.
    >>


    Scenario 2 : SW buffer collected does not match the ADC result register values for the HW triggered SoC (using Adc_ReadGroup API)
    <<

    We are able to get correct result.
    Please confirm the HW triggering rate to ADC module.

    Please check by providing voltage.

    >>

    Regards,

    Pratik

  • Hello Ashish,

    Please find the updated MCAL Code for ADC module. 

    5314.mcal.zip

    Please verify at your end and confirm the same.

    Regards,

    Pratik

  • I am able to get the correct results for the HW triggered channels on giving the voltage inputs on the LP eval board.

  • Hi Pratik,

    Can you let me know what fix does the patch contain?

  • Hello Pratik,
    I would suggest that we could have a quick meeting to check things quickly; as I am in the middle of HW testings; and I am a bit short of time. So, it would be faster over the call i feel. Can we have a call tomorrow please?

  • Hello Ashish,

    As per Changes we updated: 

    Scenario 1 is fixed, where the High Priority SW Groups were getting converted twice.

    This was leading GROUP status to BUSY always. (Scenario 3  ).

    We can schedule a call for brief understanding. Tomorrow 3PM IST afternoon would be fine. Hope this is fine.

  • Hi Pratik/Sunil,
    Could you kindly suggest in which MCAL release would this fix be planned?

    Also, I had discussed with Pratik, that there were some deviations of the current implementation from the Autosar Spec and hence the ADC data collection in polling mode for HW and SW triggered SoCs is a bit tricky in terms of the confirmation of the EoC.

    @Sunil Please do discuss and let us know what would be your suggestion based on the discussion with Pratik. 

  • Hello Ashish,

    We discussed internally and decided to provide the extra API "Adc_PollingMainFunction".
    This API should be called periodically to monitor the status of all ADC groups (configured for POLLING mode).

    The Protype of new API is as shown below:
    "FUNC(void, ADC_CODE) Adc_PollingMainFunction (void)".

    This API "Adc_PollingMainFunction", shall check the status of all the Group's (that are configured as POLLING mode).
    If status in register provides as completed, then the results shall be transferred to ADC software buffer from ADC result register and status of particular Group shall be changed to ADC_STREAM_COMPLETED or ADC_COMPLETED accordingly.

    The Function "Adc_PollingMainFunction", shall be called for update in status of ADC Channel Groups(POLLING Groups only) periodically or using API "Adc_GetStatus".

    Once the status of particular Group is changed, API "Adc_ReadGroup" to be called to get the results of particular ADC Group conversion.

    Regards,

    Pratik

  • Hi Pratik,

    Once you have this implementation ready, could you please provide me the AdcApp.c example implementation to understand the expected code flow. Once I am clear with the expected usage, I could take a patch delivery and integrate it locally and test. It would be better that we do it the same way over a call as we did with the previous patch delivery.

    Also, could you confirm in which release is this feature included? October/December delivery??

  • Hi Sunil,

    Can you please confirm in which release could we find the fix to the multiple result register buffer updatoin; please?

  • Hello Ashish,

    We planned to provide feature in October release.

    Sample application, we shall provide in within October 6, for verification.

    Regards,

    Pratik 

  • Hi Ashish,

    We will discuss this during tomorrow's meeting.

    Thanks And Regards,

    Sunil Kumar M S

  • Hello Ashish,

    Please find the attached file sample application.

    1205.AdcApp.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /* ======================================================================
    * Copyright (C) 2022-2023 Texas Instruments Incorporated
    *
    * All rights reserved. Property of Texas Instruments Incorporated.
    * Restricted rights to use, duplicate or disclose this code are
    * granted through contract.
    *
    * The program may not be used without the written permission
    * of Texas Instruments Incorporated or against the terms and conditions
    * stipulated in the agreement under which this program has been
    * supplied.
    * ==================================================================== */
    /**
    * \file AdcApp.c
    *
    * \brief This file contains the ADC test example
    *
    */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Ashish,

    Please review the patch and confirm the polling implementation is fine with you.

    Thanks And Regards,

    Sunil Kumar M S

  • Hello Ashish,

    The PATCH Release "MCAL_AM263x_09.00.01.01" has issue using Adc_PollingMainFunction().

    The updated patch with fix in Adc_PollingMainFunction shall be provided.

    Thanks for understanding and apologize for inconvenience caused. 

    Regards,

    Pratik

  • Hello Ashish,

    Please find the updated file for ADC module.

    Please use this updated file over PATCH Release "MCAL_AM263x_09.00.01.01"  ADC module

    File_Adc_PrivAdc_Priv.c:

    Thanks and Regards,

    Pratik