S32 Design Studio 3.6.2 generates invalid driver code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32 Design Studio 3.6.2 generates invalid driver code

Jump to solution
560 Views
durga_choudhury
Contributor IV

Here are the relevant details:

S32 Design Studio for S32 Platform

Version: 3.6.2

Build id: 250529 (Update 2)

 

Target processor: S32K148

 

Autogenerated driver: Adc_Ip

 

The autogenerated code that seems invalid:

 

/**

* @brief ADC Ip Config for the ADC0 configuration variant .

*/

const Adc_Ip_ConfigType AdcHwUnit_0 =

{

ADC_IP_CLK_FULL_BUS, /* ClockDivide */

ADC_IP_CLK_EIGHTH_BUS, /* CalibrationClockDivide */

ADC_IP_CLK_ALT_1, /* InputClock */

1U, /* SampleTime */

(boolean)FALSE, /* AvgEn */

ADC_IP_AVG_4_CONV, /* AvgSel */

ADC_IP_RESOLUTION_12BIT, /* Resolution */

ADC_IP_TRIGGER_SOFTWARE, /* TriggerMode */

#if (ADC_IP_ENABLE_SIM_SOURCE_SELECTION == STD_ON)

ADC_IP_PRETRIGGER_SEL_PDB, /* PretriggerSel */

ADC_IP_TRIGGER_SEL_PDB, /* TriggerSel */

#endif /* (ADC_IP_ENABLE_SIM_SOURCE_SELECTION == STD_ON) */

(boolean)FALSE, /* DmaEnable */

ADC_IP_VOLTAGEREF_VREF, /* VoltageRef */

(boolean)FALSE, /* ContinuousConvEnable */

#if (ADC_IP_SUPPLY_MONITORING_ENABLED == STD_ON)

(boolean)FALSE, /* SupplyMonitoringEnable */

#endif /* (ADC_IP_SUPPLY_MONITORING_ENABLED == STD_ON) */

(boolean)FALSE, /* CompareEnable */

(boolean)FALSE, /* CompareGreaterThanEnable */

(boolean)FALSE, /* CompareRangeFuncEnable */

0U, /* CompVal1 */

0U, /* CompVal2 */

4U, /* UsrGain */

0U, /* UsrOffset */

1U, /* NumChannels */

AdcIpChansConfig_0, /* ChannelConfigs */

#if (ADC_IP_AIEN_INTERRUPT_ENABLE == STD_ON)

&NULL_PTR /* ConversionCompleteNotification */

#endif /* (ADC_IP_AIEN_INTERRUPT_ENABLE == STD_ON) */

};

 

(The line that fails to compile: &NULL_PTR)

 

The compiler (correctly) fails to compile this code with error:

lvalue required as unary '&' operand

 

Is this an user error on my part? If not, is a fix available or will become available?

 

Thanks

Durga Choudhury

 

0 Kudos
Reply
1 Solution
502 Views
durga_choudhury
Contributor IV

Hello @VaneB 

 

Thank you very much for your help in this matter. This is more of a code formality issue for us ("was the auto-generated code altered in any way?") than a show stopper. This is not blocking us.

 

Regards

Durga Choudhury

View solution in original post

0 Kudos
Reply
3 Replies
503 Views
durga_choudhury
Contributor IV

Hello @VaneB 

 

Thank you very much for your help in this matter. This is more of a code formality issue for us ("was the auto-generated code altered in any way?") than a show stopper. This is not blocking us.

 

Regards

Durga Choudhury

0 Kudos
Reply
491 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @durga_choudhury 

It is good to hear that it is not impacting your progress.

I will still make sure the team is aware, just in case it helps improve future versions of the tool or documentation.

0 Kudos
Reply
506 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @durga_choudhury 

Thanks so much for your feedback. I took a look at the generated code and, as you pointed out, there is an error when assigning NULL_PTR to the Conversion Complete Notification. I will share this information with the appropriate team for further investigation.

In the meantime, here are a couple of quick suggestions that might help:

  • You can manually remove the "&" symbol from the ADC configuration struct. Please note that this character will be reinserted each time the code is updated in ConfigTools.
  • Alternatively, you could assign a dummy handler where the interrupt is disabled.

 

BR, VaneB

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2152910%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32%20Design%20Studio%203.6.2%20generates%20invalid%20driver%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2152910%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHere%20are%20the%20relevant%20details%3A%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CP%3ES32%20Design%20Studio%20for%20S32%20Platform%3C%2FP%3E%3CP%3EVersion%3A%203.6.2%3C%2FP%3E%3CP%3EBuild%20id%3A%20250529%20(Update%202)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ETarget%20processor%3A%20S32K148%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAutogenerated%20driver%3A%20Adc_Ip%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20autogenerated%20code%20that%20seems%20invalid%3A%3C%2FP%3E%3CBR%20%2F%3E%3CDIV%3E%3CDIV%3E%3CP%3E%3CSPAN%3E%2F**%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%40brief%20ADC%20%3C%2FSPAN%3E%3CSPAN%3EIp%3C%2FSPAN%3E%20%3CSPAN%3EConfig%3C%2FSPAN%3E%3CSPAN%3E%20for%20the%20ADC0%20configuration%20variant%20.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Econst%3C%2FSPAN%3E%20%3CSPAN%3EAdc_Ip_ConfigType%3C%2FSPAN%3E%3CSPAN%3E%20AdcHwUnit_0%20%3D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EADC_IP_CLK_FULL_BUS%3C%2FSPAN%3E%3CSPAN%3E%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20ClockDivide%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EADC_IP_CLK_EIGHTH_BUS%3C%2FSPAN%3E%3CSPAN%3E%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20CalibrationClockDivide%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EADC_IP_CLK_ALT_1%3C%2FSPAN%3E%3CSPAN%3E%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20InputClock%20*%2F%3C%2FSPA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ELECTION%20%3D%3D%20STD_ON)%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eboolean%3C%2FSPAN%3E%3CSPAN%3E)FALSE%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20DmaEnable%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EADC_IP_VOLTAGEREF_VREF%3C%2FSPAN%3E%3CSPAN%3E%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20VoltageRef%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eboolean%3C%2FSPAN%3E%3CSPAN%3E)FALSE%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20ContinuousConvEnable%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%23if%3C%2FSPAN%3E%3CSPAN%3E%20(ADC_IP_SUPPLY_MONITORING_ENABLED%20%3D%3D%20STD_ON)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(boolean)FALSE%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20SupplyMonitoringEnable%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%23endif%3C%2FSPAN%3E%20%3CSPAN%3E%2F*%20(ADC_IP_SUPPLY_MONITORING_ENABLED%20%3D%3D%20STD_ON)%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eboolean%3C%2FSPAN%3E%3CSPAN%3E)FALSE%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20CompareEnable%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eboolean%3C%2FSPAN%3E%3CSPAN%3E)FALSE%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20CompareGreaterThanEnable%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Eboolean%3C%2FSPAN%3E%3CSPAN%3E)FALSE%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20CompareRangeFuncEnable%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E0U%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20CompVal1%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E0U%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20CompVal2%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E4U%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20UsrGain%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E0U%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20UsrOffset%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E1U%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20NumChannels%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAdcIpChansConfig_0%2C%20%3C%2FSPAN%3E%3CSPAN%3E%2F*%20ChannelConfigs%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%23if%3C%2FSPAN%3E%3CSPAN%3E%20(ADC_IP_AIEN_INTERRUPT_ENABLE%20%3D%3D%20STD_ON)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26amp%3B%3C%2FSPAN%3E%3CSPAN%3ENULL_PTR%3C%2FSPAN%3E%20%3CSPAN%3E%2F*%20ConversionCompleteNotification%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%23endif%3C%2FSPAN%3E%20%3CSPAN%3E%2F*%20(ADC_IP_AIEN_INTERRUPT_ENABLE%20%3D%3D%20STD_ON)%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%7D%3B%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E(The%20line%20that%20fails%20to%20compile%3A%20%26amp%3BNULL_PTR)%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EThe%20compiler%20(correctly)%20fails%20to%20compile%20this%20code%20with%20error%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Elvalue%20required%20as%20unary%20'%26amp%3B'%20operand%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EIs%20this%20an%20user%20error%20on%20my%20part%3F%20If%20not%2C%20is%20a%20fix%20available%20or%20will%20become%20available%3F%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EDurga%20Choudhury%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2153826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32%20Design%20Studio%203.6.2%20generates%20invalid%20driver%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2153826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250000%22%20target%3D%22_blank%22%3E%40durga_choudhury%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20good%20to%20hear%20that%20it%20is%20not%20impacting%20your%20progress.%3C%2FP%3E%0A%3CP%3EI%20will%20still%20make%20sure%20the%20team%20is%20aware%2C%20just%20in%20case%20it%20helps%20improve%20future%20versions%20of%20the%20tool%20or%20documentation.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2153822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32%20Design%20Studio%203.6.2%20generates%20invalid%20driver%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2153822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F201913%22%20target%3D%22_blank%22%3E%40VaneB%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThank%20you%20very%20much%20for%20your%20help%20in%20this%20matter.%20This%20is%20more%20of%20a%20code%20formality%20issue%20for%20us%20(%22was%20the%20auto-generated%20code%20altered%20in%20any%20way%3F%22)%20than%20a%20show%20stopper.%20This%20is%20not%20blocking%20us.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ERegards%3C%2FP%3E%3CP%3EDurga%20Choudhury%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2153814%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32%20Design%20Studio%203.6.2%20generates%20invalid%20driver%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2153814%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F250000%22%20target%3D%22_blank%22%3E%40durga_choudhury%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20so%20much%20for%20your%20feedback.%20I%20took%20a%20look%20at%20the%20generated%20code%20and%2C%20as%20you%20pointed%20out%2C%20there%20is%20an%20error%20when%20assigning%20NULL_PTR%20to%20the%20Conversion%20Complete%20Notification.%20I%20will%20share%20this%20information%20with%20the%20appropriate%20team%20for%20further%20investigation.%3C%2FP%3E%0A%3CP%3EIn%20the%20meantime%2C%20here%20are%20a%20couple%20of%20quick%20suggestions%20that%20might%20help%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EYou%20can%20manually%20remove%20the%20%22%26amp%3B%22%20symbol%20from%20the%20ADC%20configuration%20struct.%20Please%20note%20that%20this%20character%20will%20be%20reinserted%20each%20time%20the%20code%20is%20updated%20in%20ConfigTools.%3C%2FLI%3E%0A%3CLI%3EAlternatively%2C%20you%20could%20assign%20a%20dummy%20handler%20where%20the%20interrupt%20is%20disabled.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E