hello, support
how can i detect if LIN command from LIN master is off by using S12ZVM LIN stack ?
is there any flag i can use if the master stop sending out LIN command to slave?
i am now using the S12ZVM LIN stack .
thanks!
Hi NoahXu,
I've tried to have a call with PM of LIN Stack. There're 2 proposed next steps from him:
From expectation, the idle_timeout_cnt will be decremented and the state should return SLEEP_MODE after few seconds when you disconnect LIN master (no bus activity)
After got the results of these, if unexpected results, i want to setup a debug call directly with you.
Please help me to try these two suggestions checking first.
Thank you,
Nam.
Hi NoahXu,
I got informed that this below function will count the timeout
Once the function reaches the timeout, it'll call the Gotosleep function, then the flag of Gotosleep should be set and then if you call the get status function, it should return the set flag.
Please set a breakpoint at this line and observe the bit lin_goto_sleep_flg be set or not.
The state from IDLE will be changed to SLEEP_MODE if the timeout_cnt be counted down to 0.
After that, the lin_word_status.word will be updated through lin_update_word_status_lin
If you still can not run it, please share detail of your project and information that i ask before, so i will transfer to your team for directly checking.
Thank you,
Nam.
Hi NoahXu,
Thanks for your sharing.
Please share also your implement code for i_ifc_linstatus. We will check whether your code is working or not.
Please give me detail about devices setup (master-slave), name of chip/derivative and version of LIN Stack that you're using.
Thank you,
Nam.
Hi,Namm
do we have some conclusion on the investigation after you received my code?
Hi NoahXu,
I've already transfered your project to my collegue but still on progress of checking.
Let me ask him check it asap and i will feedback to you when i have his investigation.
Thank you,
Nam.
Hello,Namm
i am okay with that.
when are you available? i think it is better to arrange a teams meeting to show you,it is more efficient.
are you okay?
Hi NoahXu,
I'm actually not familiar with Lin Stack so maybe meeting will not work, but i will transfer your project to an expert developer for checking.
Basically, you just share your project here (the project that you run test of function i_ifc_linstatus and failed), information of mcu - linstack that you're using.
Thank you,
Nam.
Namm,
can you add those flags by yourself? it is just like "flag1= i_ifc_linstatus()"
the project i shared is an original software package from the community which related to AN5201.
On this common base we can avoid any unnecessary changes made by myself.
About the setup, you can do it in any method you like, if you made it success then you can share with me , i will follow your setup. i just connect the lin line of the ECU to the CANcase of vector . it is common setup and the messages can be sent and received.
About the MCU version , you can flash the software to any LIN version S12Z demo board you have, if you made it success then you can share with me , i will follow you.
About the version of lin stack, i think it is LIN_stack_S12_4_6_6_210629 , but it doesnot matter .you can integrate any version you think is ok to demostrate the function you described before. if you made it success then you can share with me , i will follow you.
any way ,thank you. i 'll wait for you meassge.
Hi NoahXu,
Thanks for your response.
I also want you implement the function i_ifc_linstatus(), please spend a little time for it. Because we want to check your implementation and configuration basically.
I want to know your exact devices, mcu and lin stack. We will check depend on your side, not integrate or make it work with our side.
Please consider sharing your current status.
Sorry for any inconveniences causes to you.
Thank you,
Nam.
Hi NoahXu,
In Lin stack specs, there's a note of this one when master bus was down or inactive atleast 4s to 10s.
This parameter can be configured here
So after this time, the go to sleep bit should set to 1.
Please help me to check and try again.
Thank you,
Nam.
Hi, Namm
yes, it is a point we should consider.
i checked the "lin_Status " value after 10s and no change happened.
Do yo have some demo examples that can share with me? or can you just use the lin stack to write some simple code to demonstrate your idea on this topic?
Hi NoahXu,
I'm lacking of devices right now so it's hard to test a sample app for this. But i'll try to ask someone else.
Did you see any header frames send out from the master when you already turn off the "LIN scheduler on/off simulated by tools like Canoe"
Because in slave side, when there's no header frame request from master, the slave goes to sleep mode automatically. After that, the bit Go to sleep should be set.
Please make sure this points are checked:
- No request frame / header frame send to slave. This is beyond your application
- The i_ifc_readstatus(LI0) be called after the timeout amount.
Therefore, this api should work properly.
Thank you,
Nam.
Please help me to take out the connection between master and slave. This bit should be set, due to this basic function be tested and should work.
I asked one developer of lin stack and got this information. I think the header frames from your simulator keep sending out to the slave. Please disconnect it for this bit.
Thank you,
Nam.
Hello, Namm
even i plug out the LIN lin, the value not change itself.
you can find the previous screenshot, if there is lin sent out from master , the SCISR register will change.
can you make a demo for me? consider you donot have a test board, i can test it use my PCBA.
Hi NoahXu,
You confirmed that you already disconnected LIN out of slave, and then after over 10 seconds you call the api lin_getstatus, but the result not change and all flags are still 0? (make sure your function be called after timeout amount)
Could you please share your project here? So i will transfer it to developer for checking directly.
About your hardware setup and debug, can you give me the details? So we will try to reproduce if we can.
Sorry for this inconvenience, the api should work probably but seems it doesn't so we need information to check more.
Thank you,
Nam.
Hi NoahXu,
In the LIN API Specification document, you can find a chapter 7.2.5.8 of l_ifc_read_status
This api can be applied for both master and slave side, the return frame will be different
As the response when master stop sending out frames, there should be master in sleep mode. Please take a look at this chapter and these other's return values also.
Thank you,
Nam.