MCU-PLUS-SDK-AM263PX: Drivers_Open() Now Mandatory To Call

Part Number: MCU-PLUS-SDK-AM263PX


Tool/software:

Hello,

In ti_drivers_open_close.h there is the following comment many times:

"Driver open/close - can be used by application when Driver_open() and Driver_close() is not used directly and app wants to control the various driver open/close sequences"


Until now that is precisely how our application has been working. e.g. Driver_open() is not called from the application but Drivers_mcanOpen() is called.

I have just updated the SDK from mcu_plus_sdk_am263px_09_02_00_56 to mcu_plus_sdk_am263px_10_02_00_15 to find that for the ADC there is now extra code in Driver_open() before Driver_adcOpen():

Of course, just calling Driver_adcOpen() skips this code. If this code is to be executed, then Driver_Open() must be called breaking the previously (sensible) principle for all drivers.

This obviously has a big impact on my application and forcing unnecessary effort.

<Opening Question>

- Why on earth isn't this extra code inside Driver_adcOpen()?

  • I see this problem is present in SDK 11 too. Unamused

    Please can I have a response? This is blocking my project.

  • Hi Kier, 

    I understand your confusion. the configurations you see are related to ADC but not present or specific to any of the ADC instances. these controls are global and are needed for group of ADC's at a time instead for each of the ADCs. You can consider these to be "more like clock configurations" outside the IP. 

    A little explanation of what this set of code does...

    1. Sets up the reference buffers for ADC internal references (shared in groups) if internal reference is selected. waits for the Reference buffers to be active
    2. Sets up the reference buffer monitors to check whether the input (internal / external reference provided to the ADC Front Ends) is in voltage range mentioned in Data Sheet. this step is important, otherwise the ADC results may have been validated / calculated in the Front end against an improper voltage.
    3. Checks the Monitor status and moves ahead for ADC initializations. 

    if you wish to bypass Drivers_open, please consider making a utility function that mirrors this generated code in your application.

    Hope this clarifies your question.

    thanks and regards,

    Madhava

  • Hi Madhava,

    Thank you but I'm annoyed, not confused.

    these controls are global and are needed for group of ADC's at a time instead for each of the ADCs.

    - I repeat my opening question. Why does that mean the code should be outside Driver_adcOpen()? From a program flow point of view, why can't you put it inside Driver_adcOpen()?

    if you wish to bypass Drivers_open, please consider making a utility function that mirrors this generated code in your application.

    - The code generated in Drivers_open() is dependent on the SysCfg contents so this solution will be broken if the SysCfg file contents for is changed for the number of ADCs used, for example. Furthermore I have to do this for all cores that use an ADC. This is not a serious proposal.

  • Given the silence, I assume you guys won't be backtracking on this.

    At least remove the following untrue comments from the generated source please:

    "Driver open/close - can be used by application when Driver_open() and Driver_close() is not used directly and app wants to control the various driver open/close sequences"

  • Hi Kier,

    Let me try to help you here. the ADC configurations are part of the driver_adcOpen(), but the global configurations that really do not configure the ADC IP itself, but are needed for ADC's usage are not supposed to be part of the ADC's driver_adcOpen(). 

    To phrase in an analogous way, think of these like pinmux / clock configurations, they are needed for the IP's usage, but aren't part of IP's functional configurations. 

    Thanks and regards,
    Madhava

  • Hi Madhava,

    Thanks but, again, it's missing my point.

    I could call Driver_adcOpen() with SDK 9.x but I can't with SDK 10.x. Now I have to refactor my application to suit your change of direction and call  Drivers_Open(). It's mandatory if I want the ADCs to work.

  • Hi Kier,

    Yes. but these are one time configs and need not be done from each core. You can choose to add this peice of code in application / sbl and keep using the drivers_adcOpen/drivers_adcClose functions in your application as you have been. 

  • You can choose to add this peice of code in application

    That breaks the point of auto code generation. I doubt anyone would choose to do that. 

    Never mind. I'll just have to deal with it.