MCAL Initialization Parameter Question

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

MCAL Initialization Parameter Question

512 Views
MateoSegura413
Contributor III

Context

I'm using the MCAL for the S32K344 version below

MateoSegura413_3-1658384560053.png

All modules have an Init function that takes in a configuration parameter

MateoSegura413_0-1658384403254.png

But in most examples, NULL is passed as this argument, as shown below

MateoSegura413_1-1658384457659.png

And I'm aware that this is somehow linked to the ConfiTimeSupport page in the ConfigTools, shown below

MateoSegura413_2-1658384535211.png

Questions

1. What is the difference between the two statements below?

MateoSegura413_4-1658384913280.png

2. How do I find the ConfigPtr for the module? I tried to find the Eth init parameter but had no luck

MateoSegura413_5-1658384997228.png

Thanks in advance for your help!

0 Kudos
1 Reply

497 Views
cuongnguyenphu
NXP Employee
NXP Employee

1. What is the difference between the two statements below?
If you configured Config Variant as Pre-Compile, you don't need to add Parameter for Init function (e.g Eth_Init(NULL) )
If you configured Config Variant as Post-Build, It's necessary to add pointer to your configure type name as parameter (e.g Eth_Init(&Eth_Config_BOARD_INITPERIPHERALS))

In Pre-Compile case, technically it will auto find the config in your module (normally, will be predefined for the name) and start the Init process.
In Post-Build case, Init function will find the config name which is given by Parameter in post-build time. 

2. How do I find the ConfigPtr for the module?
You can check the generated files for corresponds module (for Eth, it can be Eth_BOARD_InitPeripherals_PBcfg.c then check config setup Eth_ConfigType, such as Eth_Config_BOARD_INITPERIPHERALS)

cuongnguyenphu_0-1659086684720.png

 





0 Kudos