How to configure LIN Stack for a Firmware which shall support more then one slaves on Bus?

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

How to configure LIN Stack for a Firmware which shall support more then one slaves on Bus?

3,516 Views
albrechtmichael
Contributor I

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?

Tags (1)
0 Kudos
7 Replies

2,462 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Albrecht,

Attached are steps to have two interfaces on one MCU.

Each interface needs one UART, so we can have 3 interfaces on S32K144.

Regards,

Daniel

2,462 Views
albrechtmichael
Contributor I

Hi Daniel,

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.

Regards,

Michael 

0 Kudos

2,461 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Michael,

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:

pastedImage_1.png

Step3: use these code in Main function to switch nodes:

pastedImage_2.png

Regards,

Daniel

0 Kudos

2,461 Views
albrechtmichael
Contributor I

Hi Daniel,

I get the idea. I'll have a look into this.

Thank you very much for your effort! :-)

Regards,

Michael

0 Kudos

2,461 Views
mohdtajbaba
Contributor I

Hello Michael

Hope your doing Good

I would like to know how do you handle the multi slave concept ?

Regards

0 Kudos

2,461 Views
albrechtmichael
Contributor I

My MCU is S32K144.

0 Kudos

2,461 Views
jiri_kral
NXP Employee
NXP Employee

Hi 

what is your MCU?

Jiri

0 Kudos