2021-08-13 04:33 AM
Here's the issue. I have built a LIN bus with a slave node and a master node using tow STM8AF/AL-Discovery boards. After flashing the boards with the demo of the STM8 LIN driver 5.1 as slave node and master node I can control either the LED or the bars in the LCD display with the user buttons. This works fine.
I have a project and the master knode also has no config schedule table, so I have to do the configuration in the slave node.
However, my idea is to pre-configure the slave node so that it does not need the "schTabConfig" schedule table in the LDF file. I have commented out the line in the "lin_basic_demo_master.c" -file and delete the "schTabConfig" in the LDF File.
Schedule_tables
{
//
// this schedule table will configure the slave node to
// participate in LIN communication
//
schTabConfig
{
AssignNAD { slave1 } delay 20 ms ;
SlaveResp delay 20 ms ;
AssignFrameIdRange { slave1, 0 } delay 20 ms ;
SlaveResp delay 20 ms ;
AssignFrameIdRange { slave1, 4 } delay 20 ms ;
SlaveResp delay 20 ms ;
SaveConfiguration { slave1 } delay 20 ms ;
SlaveResp delay 20 ms ;
}
void l_initTask(void)
{
/*
* bring up LIN driver
*/
l_sys_init();
l_ifc_init(ifc_used);
#ifndef LIN_21
l_ifc_connect(ifc_used);
#endif /* !LIN_21 */
// l_sch_set(ifc_used, LIN_TAB_schTabConfig,0);
// commented out the line above
return ;
}
Now the communication does not work anymore, because the master node does not configure the slave node.
With the function ld_set_configuration() I can configure the slave node, if I understood it correctly.
The function is described in the file "lin_diag_slave.c" or in the LIN Api. The function has three parameters:
The first paramter is clear to me, but I just don't know how the "Data" paramter should look like in the demo example. I know, that data it is a array[n] but what values and data are in it?
Where do I get the parameters?
I have attached an example from the LIN Bus spec
I hope you can help me and thank you
Best Regards
Michael