EB Tresos want post selectable build only for one module

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

EB Tresos want post selectable build only for one module

289 次查看
vr_2007
Contributor I

Hello,

How to configure variant handling only for one module, say Port module?

Have configured 2 "SelectablePostBuildVariant" using EcuC and only for Port module the "Post Build variant" is ticked, not for other modules. On generation, all other modules also are getting generated for both variants though "Post Build variant" is not  ticked, the content is same just different names according to variant. 

Also in Port module is there a way to have the variant selection at PortContainer level instead of each pin level, as sometimes we have 2 hardware variants with different number of pins configured.

Using EB tresos version v29 and s32K3 Mcal V3

Thanks for your support

0 项奖励
回复
3 回复数

236 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @vr_2007,

With Post build variant, you need to add pointer of your Module config when call Init() function (Ex: Port_Init(&Port_VS_0_PBcfg). So, in your Init module step, you need to put which module config set you want to use. These files are generated depending on your variant references: 

Julin_AragnM_0-1719264738464.png

Julin_AragnM_1-1719264764538.png

With Precompile variant, you don't need to add pointer of your Module config when call Init() function (Ex: Port_Init(NULL_PTR),  I2c_Init(NULL_PTR)).

So, in order to just configure variant handling on port module, select the "Post Build variant" and configure the pointer in the initialization function. 

As for hardware variants, AUTOSAR differentiates between PreBuild and PostBuild variation points.

  • PreBuild variation points support the variability of several ECUs.
  • PostBuild variation points support variants on one ECU.

So, I understand a PreBuild variant is the adequate support for different ECUs.

Best regards,
Julián

0 项奖励
回复

215 次查看
vr_2007
Contributor I

Hello Julián,

thank you for taking time to give a detail reply.

My question is more in direction, I would like to have PostBuild only for one module (Port) and not for all modules.

As seen in your example also, for every module it generates the files for both variants VS_0 and VS_1.

vr_2007_0-1719336990717.png

For e.g. even though I have not ticked the postbuild checkbox in MCU module, it still generates Mcu_VS_0_PBcfg.h and Mcu_VS_1_PBCfg.h. So even though I want Mcu to be a pre-compile variant and do not want to send any specific parameter to Mcu_Init, I have to send one of the config structure as argument, as the files are generated accordingly. Same is the case for all the other modules.

Sure there are workarounds to get it working somehow, like create 2 separate projects, one for pre-compile modules and another one just for port module with post build only of port module or another option is let tresos generate for all modules both variants and during compilation select only one for, e.g. compile only Mcu_VS_0_*.* . 

 

Thank you and Regards

 

 

 

0 项奖励
回复

202 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @vr_2007,

I believe as long as you have PostBuild variants, the PostBuild configuration files (VS_0, VS_1) will generate. The only difference when ticking Post Build variant used is the following line in McuCfg:

Julin_AragnM_0-1719355637479.png

You can check for precompile support when initializing your application as in the RTD examples:

Julin_AragnM_1-1719355687818.png

Best regards,
Julián

0 项奖励
回复