Hi:
To receive all the message from LIN BUS, adding a LinFlexd component in S32DS for PA, There are some question:
1.There's a sentence on the schematic of MPC5748G Devkit, That is "Master Mode Pullup Enable". So the Lin component on the Devkit can not be configured as a slave? And There is no API to confige it to slave or master.
2.The VSUP1 on the Devkit must be connected to external power supply(12V) ?
BR
Solved! Go to Solution.
Hi,
for receiving data be sure CANoe is set to respond on given ID and check the RX frame on bus with the scope too.
You can refer to master/slave example on https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5748G-LINFlex-LIN-Master-Slave-test-G...
BR, Petr
By the way, is there an example for LIN working as a slave node? I want the two devkit boards to communicate with each other, so
I made some configuration changes base on the "linflexd_lin" example. Unfortunately, It didn't work out.
Hi,
1) it will work as Slave node too, but to follow LIN standard this pullup should be removed. You can just solder out R4 and place header to have this configurable.
Yes, there is no LIN driver in the SDK. You can find simple baremetal code for LIN in S32DS called "linflex_lin".
2) yes, the LIN transceiver requires 12 V supply on pin P3.3
BR, Petr
Hi, Perts:
I new a project from example called "linflexd_lin" , and download it to the devkit, using oscilloscope one can observe transmitted waveforms.
Next step, Adding "receiveLINframe();"function to the main loop, while connecting the P3.4 of devkit to the Lin pin of the CANOE.
And then, sending periodic messages to simulated slave node using CANOE, as shown below:
I set a breakpoit in the function "reveiveLINframe" 。
But it doesn't stop running at this breakpoint, it seems that the MCU did not receive the message from slave node. Where is the problem?
BR,
Hi,
for receiving data be sure CANoe is set to respond on given ID and check the RX frame on bus with the scope too.
You can refer to master/slave example on https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5748G-LINFlex-LIN-Master-Slave-test-G...
BR, Petr
Hi,PetrS:
Thanks for your advice. I transplanted the master/slave example to my project. But there are still some problems:
1)The Rx/Tx ISR of LINFlexD_0 as slave node is registered in the interrupt vector table.
But where and how to register the Rx/Tx ISR in my project using S32_SDK_S32PA_RTM_3.0.3?
I try to use the API "LINFLEXD_UART_DRV_InstallRxCallback()" and "LINFLEXD_UART_DRV_InstallTxCallback()", but failed. The result is that while the master sends data, the slave does not receive it.
2)Whether as a slave or a master, The VSUP pin on DEVKIT must connect to power supply(12V)?
BR.
There are the API to register the ISR: