0
1

AUTOSAR(26) 状態遷移を網羅する 図(7)

Last updated at Posted at 2021-05-29

AUTOSARに限らず、自動車のソフトウェア仕様に限らず、ソフトウェア仕様を自然言語で記述すると、分かりにくいことがある。
仕様記述言語、UMLなどで記述すればよいのにしないことがある。
大人の事情かもしれず、そっとしている。

自動車用ソフトウェアの基本は、排ガス規制対応のエンジン制御であるらしい。ECUという名前はEngine Control Unitとして有名だったことがある。

その後、ありとあらゆる自動車の制御に関する計算機システムを
ECUと呼ぶらしい。

AUTOSARでは、UMLを参照し、UMLのファイルを参考配布している。

AUTOSARで規定しているすべての状態をUML記述している訳ではないかもしれない。

そこで、AUTOSARに出てくる、すべての状態(state, mode, phaseなど)を名前がなんであれ、網羅していこうと思おう。

<この項は書きかけです。順次追記します。>

AUTOSARでは、文書番号がついている。
2.0の時代には、文書番号がついていなかった。
そこで、2.0で、現在利用可能な仕様のうち、
文書番号の若そうな文書から状態を洗い出すことにする。

状態遷移の命名の難しいところは、
状態名と遷移名を同一にしたり、
遷移名を状態名にして、遷移名を別につけたりしたり、
いろいろある点かもしれない。

それぞれ、歴史的な経緯があるかもしれない。

AUTOSAR文書の読み方(文書番号と発行年)
https://qiita.com/kaizen_nagoya/items/daa3f7de7e86b89bcc33
#CAN

short name No. title filename state mode
C.D. 11 Specification of CAN Driver AUTOSAR_SWS_CAN_Driver.pdf 76 43

state

state001-can, Bus-off, Wake-up(events)

C.D.p.22

Furthermore the CAN driver provides services to control the state of the CAN controllers. Bus-off and Wake-up events are notified by means of callback functions.

C.D.p.24

There are two possibilities for triggering these state changes by external events: �
Bus-off
�HW wakeup
These are indicated either by an interrupt or by a status bit that is polled in the Can_MainFunction_BusOff or Can_MainFunction_Wakeup.

state002-can CAN_UNINIT, Can_Init, CAN_READY

C.D.p.22

7.1 Driver State Machine
CAN103: After reset the driver is in the state CAN_UNINIT until the function Can_Init is called.

state003-can "a 'software' state machine"

C.D.p.23

For each CAN controller a 'software' state machine is implemented in the CAN interface. [5] shows the implemented software state machine. Any CAN hardware access is encapsulated by CAN driver functions, but the CAN driver does not memorize the state changes.
� During a transition phase the software controller state inside the CAN interface may differ from the hardware state of the CAN controller.
[5] Specification of CAN Interface, AUTOSAR_SWS_CAN_Interface.pdf

いろんなことを言いすぎて、どの状態遷移について記述したいかが分からない。ソフトウェアの状態遷移と、ハードウェアの状態遷移と、CAN Driverの状態遷移について語っている。
さらにわかりにくいのが、Driver以外に、CANIfというモジュールがあるらしいことだ。interfaceといえば、モジュールとモジュールの界面(iterface)を規定するものである。インタフェースがモジュールであれば、インタフェースというモジュールのインタフェースが必要なんじゃないかと疑問に感じる人がいるかもしれない。インタフェースはモジュールにしないのがソフトウェアの仕様なのではないのだろうか。

state004-can UNINIT, STOPPED, STARTED, SLEEP

C.D. p.23

7.2 CANControllerStateMachine
7.2.1 State Description

CANIF_CS_UNINIT

The CAN controller is not initialized. All registers belonging to the CAN module are in reset state, CAN interrupts are disabled. The CAN Controller is not participating on the CAN bus.

CANIF_CS_STOPPED

In this state the CAN Controller is initialized but does not participate on the bus. Also error frames and acknowledges must not be sent.
(Example: For many controllers entering an 'initialization'-mode causes the controller to be stopped.)

CANIF_CS_STARTED

The controller is in a normal operation mode with complete functionality, that means it participates in the network. For many controllers leaving the 'initialization'-mode causes the controller to be started.

CANIF_CS_SLEEP

CAN052: The hardware settings only differ for CAN hardware that support a sleep mode (wake-up over CAN bus directly supported by CAN hardware).
In this case the CAN hardware must be set to a state from which the hardware can be woken over CAN Bus.

状態遷移表にしてみた。

CANIF_CS_UNINIT CANIF_CS_STOPPED CANIF_CS_STARTED CANIF_CS_SLEEP
CANIF_CS_UNINIT Can_Init
CANIF_CS_STOPPED Can_InitController Can_SetControllerMode(CAN_T_START) Can_SetControllerMode(CAN_T_SLEEP)
CANIF_CS_STARTED Can_SetControllerMode(CAN_T_STOP)
Bus-Off (triggered by state change of CAN controller)
CANIF_CS_SLEEP Can_SetControllerMode(CAN_T_WAKEUP)
Hardware Wakeup (triggered by wake-up event from CAN bus)

mode

error

e.1 CAN_E_TRANSITION

C.D.p.24

Only for development errors the transition has to be checked and in case of wrong implementation of CAN interface the development error CAN_E_TRANSITION is raised to the Development Error Tracer.

関連資料

' @kazuo_reve 私が効果を確認した「小川メソッド」
https://qiita.com/kazuo_reve/items/a3ea1d9171deeccc04da

' @kazuo_reve 新人の方によく展開している有益な情報
https://qiita.com/kazuo_reve/items/d1a3f0ee48e24bba38f1

' @kazuo_reve Vモデルについて勘違いしていたと思ったこと
https://qiita.com/kazuo_reve/items/46fddb094563bd9b2e1e

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

逆も真:社会人が最初に確かめるとよいこと。OSEK(69)、Ethernet(59)
https://qiita.com/kaizen_nagoya/items/39afe4a728a31b903ddc

「何を」よりも「誰を」。10年後のために今見習いたい人たち
https://qiita.com/kaizen_nagoya/items/8045978b16eb49d572b2

自己記事一覧

物理記事 上位100
https://qiita.com/kaizen_nagoya/items/66e90fe31fbe3facc6ff

量子(0) 計算機, 量子力学
https://qiita.com/kaizen_nagoya/items/1cd954cb0eed92879fd4

数学関連記事100
https://qiita.com/kaizen_nagoya/items/d8dadb49a6397e854c6d

統計(0)一覧
https://qiita.com/kaizen_nagoya/items/80d3b221807e53e88aba

図(0) state, sequence and timing. UML and お絵描き
https://qiita.com/kaizen_nagoya/items/60440a882146aeee9e8f

品質一覧
https://qiita.com/kaizen_nagoya/items/2b99b8e9db6d94b2e971

言語・文学記事 100
https://qiita.com/kaizen_nagoya/items/42d58d5ef7fb53c407d6

医工連携関連記事一覧
https://qiita.com/kaizen_nagoya/items/6ab51c12ba51bc260a82

自動車 記事 100
https://qiita.com/kaizen_nagoya/items/f7f0b9ab36569ad409c5

通信記事100
https://qiita.com/kaizen_nagoya/items/1d67de5e1cd207b05ef7

日本語(0)一欄
https://qiita.com/kaizen_nagoya/items/7498dcfa3a9ba7fd1e68

英語(0) 一覧
https://qiita.com/kaizen_nagoya/items/680e3f5cbf9430486c7d

転職(0)一覧
https://qiita.com/kaizen_nagoya/items/f77520d378d33451d6fe

仮説(0)一覧(目標100現在40)
https://qiita.com/kaizen_nagoya/items/f000506fe1837b3590df

Qiita(0)Qiita関連記事一覧(自分)
https://qiita.com/kaizen_nagoya/items/58db5fbf036b28e9dfa6

鉄道(0)鉄道のシステム考察はてっちゃんがてつだってくれる
https://qiita.com/kaizen_nagoya/items/26bda595f341a27901a0

安全(0)安全工学シンポジウムに向けて: 21
https://qiita.com/kaizen_nagoya/items/c5d78f3def8195cb2409

一覧の一覧( The directory of directories of mine.) Qiita(100)
https://qiita.com/kaizen_nagoya/items/7eb0e006543886138f39

Ethernet 記事一覧 Ethernet(0)
https://qiita.com/kaizen_nagoya/items/88d35e99f74aefc98794

Wireshark 一覧 wireshark(0)、Ethernet(48)
https://qiita.com/kaizen_nagoya/items/fbed841f61875c4731d0

線網(Wi-Fi)空中線(antenna)(0) 記事一覧(118/300目標)
https://qiita.com/kaizen_nagoya/items/5e5464ac2b24bd4cd001

OSEK OS設計の基礎 OSEK(100)
https://qiita.com/kaizen_nagoya/items/7528a22a14242d2d58a3

Error一覧 error(0)
https://qiita.com/kaizen_nagoya/items/48b6cbc8d68eae2c42b8

プログラマによる、プログラマのための、統計(0)と確率のプログラミングとその後
https://qiita.com/kaizen_nagoya/items/6e9897eb641268766909

官公庁・学校・公的団体(NPOを含む)システムの課題、官(0)
https://qiita.com/kaizen_nagoya/items/04ee6eaf7ec13d3af4c3

「はじめての」シリーズ  ベクタージャパン 
https://qiita.com/kaizen_nagoya/items/2e41634f6e21a3cf74eb

AUTOSAR(0)Qiita記事一覧, OSEK(75)
https://qiita.com/kaizen_nagoya/items/89c07961b59a8754c869

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

LaTeX(0) 一覧 
https://qiita.com/kaizen_nagoya/items/e3f7dafacab58c499792

自動制御、制御工学一覧(0)
https://qiita.com/kaizen_nagoya/items/7767a4e19a6ae1479e6b

Rust(0) 一覧 
https://qiita.com/kaizen_nagoya/items/5e8bb080ba6ca0281927

小川清最終講義、最終講義(再)計画, Ethernet(100) 英語(100) 安全(100)
https://qiita.com/kaizen_nagoya/items/e2df642e3951e35e6a53

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>
This article is an individual impression based on the individual's experience. It has nothing to do with the organization or business to which I currently belong.

文書履歴(document history)

ver. 0.01 20230526

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1