I have 4 nearly identical slaves on the Bus, which shall be supported by one firmware. Depending on runtime configuration this firmware shall act as the choosen node.
With processor expert I found only the way to generate code for one slave.
Is it possible to configure the LIN stack to support more then one slaves?
thank you for the effort.
But sorry, perhaps we have a misunderstanding here. I try to explain again:
I write a firmware for a LIN slave.
This firmware shall be used for 4 ECU's on one bus in one vehicle. The LIN Master is provided by a different supplier..
This firmware uses the NXP Stack.
In the LDF there are four nodes, each having a similar interface but with different frame ID's and signal names.
The Firmware shall configure itself at boot time, to be one of the nodes depending on e.g. I/O Pin configuration. So I avoid to have four firmware versions with 4 configured stacks, but one.
The problem is, that I can do the configuration of the NXP Stack for a special node only at compile time.
I am looking for a way to do this at run time/boot time.
I got the steps I posted from LIN Stack team.
Currently, the stack doesn’t support this feature. But with S32K144 we can work around to have one slave firmware for 3 slaves and during run time assign them IDs and signal names. Because the current pex can be able to generate maximum(3) interface for S32K144 which depends on the number of LPUART of the chip.
Here is the way to workaround 3 slaves using UART2 with one firmware.
An example to switch 3 interfaces by a button:
Step1: create pex as attached file(pex) and generate configuration for LinStack. You can see that Device of LI1 and LI2 is LPUART0 and LPUART1 but we will ignore it.
Step2: in file lin_cfg.c:
Step3: use these code in Main function to switch nodes: