[CanTp] Vehicle Diagnostic Communication Part 28 [Simulation 16]

[CanTp] Vehicle Diagnostic Communication Part 28 [Simulation 16] 車両診断通信
[CanTp] Vehicle Diagnostic Communication Part 28 [Simulation 16]

Click here for back issues.
https://www.simulationroom999.com/blog/diagnostic-communication-en-back-issue/

Introduction.

Let’s simulate ISO-TP. series.
We need to solve MCAL-CANDRV before AUTOSAR CanTp.

The following issues are to be addressed

  • Not okay situation in implementing MCAL-CANDRV with XL driver library.
  • How to realize receive interrupt and transmission completion interrupt in XL driver library.

MCAL-CANDRV equivalent

In the last issue, I mentioned that the XL driver library seemed to be OK or not OK in realizing MCAL-CANDRV.
As it turns out, it should be okay, but if you do it without thinking, it probably isn’t.
(Well, you might ask me to explain this part quickly…)

Not okay situation in realizing MCAL-CANDRV with XL driver library.

Simply put, it is necessary to realize interrupt-like behavior.
This refers to so-called receive interrupts, etc.

The XL driver library allows CAN reception and transmission via the XL driver library, but there is no equivalent for interrupts.

Error interrupts may be ignored, but we need receive interrupts and transmission completion interrupts.

How to realize receive interrupt and transmit complete interrupt in XL driver library?

Does this mean that CanTp can’t be used with virtual CAN Bus?

There is a way to make it work in one way or another.
(You’re going to ask me to tell you this as soon as possible…)

The answer is to use threads.
Threads are the ones that make multi-threading possible.

The XL driver library notifies us of receive and error events via event objects.
See below for more information on the event object.

Event Objects (Synchronization) - Win32 apps
An event object is a synchronization object whose state can be explicitly set to signaled by use of the SetEvent functio...

In addition, the result of the transmission comes around as a reception, so the completion of the transmission also needs to be picked up by the reception API.

Some of you may not understand what I am talking about.
I would like to have the source code for the actual thread part by next time.

Conclusion

  • To realize MCAL-CANDRV, it is necessary to reproduce the receive and transmit completion interrupts.
  • The XL driver library notifies the events of received, sent, and error via Win32API event object.
    • Therefore, knowledge of thread and event object handling by Win32API is required.

Click here for back issues.

コメント

タイトルとURLをコピーしました