JP2019101972A - Information processing device, control method of information processing device and program - Google Patents

Information processing device, control method of information processing device and program Download PDF

Info

Publication number
JP2019101972A
JP2019101972A JP2017235241A JP2017235241A JP2019101972A JP 2019101972 A JP2019101972 A JP 2019101972A JP 2017235241 A JP2017235241 A JP 2017235241A JP 2017235241 A JP2017235241 A JP 2017235241A JP 2019101972 A JP2019101972 A JP 2019101972A
Authority
JP
Japan
Prior art keywords
usb
error
cpu
reset
communication interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2017235241A
Other languages
Japanese (ja)
Inventor
克也 坂井
Katsuya Sakai
克也 坂井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2017235241A priority Critical patent/JP2019101972A/en
Publication of JP2019101972A publication Critical patent/JP2019101972A/en
Pending legal-status Critical Current

Links

Images

Abstract

To provide an information processing device capable of resetting a device on which an error has occurred while preventing from giving influences on operations of the other devices connected to the information processing device.SOLUTION: The information processing device includes: error detection means that detects whether or not the error of a device connected via a communication interface has continuously occurred exceeding a threshold value; and reset means that is configured so as to, when the error has continuously occurred exceeding a threshold value, reset the communication interface connected with the device on which the error has occurred in a plurality of communication interfaces.SELECTED DRAWING: Figure 7

Description

本発明は、情報処理装置、情報処理装置の制御方法及びプログラムに関するものである。   The present invention relates to an information processing apparatus, a control method of the information processing apparatus, and a program.

USBデバイスは、パーソナルコンピュータ、プリンタ、スキャナ、複合機等のホストコンピュータに接続可能である。ホストコンピュータは、自身の持つUSBホストコントローラを介して、USBインタフェースにより接続されたUSBデバイスと通信を行う。USBは、Universal Serial Busの略称である。ホストコンピュータは、自身のCPUで動作するプログラムとして、前述のUSBホストコントローラを制御するドライバ部分及びアプリケーション部分を有し、これらのプログラムに基づいて動作する。さらに、ホストコンピュータは、自身のシステムを制御するオペレーションシステムを有し、各種処理を行う。   The USB device can be connected to a host computer such as a personal computer, a printer, a scanner, or a multifunction peripheral. The host computer communicates with the USB device connected via the USB interface via its own USB host controller. USB is an abbreviation for Universal Serial Bus. The host computer has, as a program operating on its own CPU, a driver portion and an application portion for controlling the aforementioned USB host controller, and operates based on these programs. Furthermore, the host computer has an operation system that controls its own system and performs various processes.

一方、USBデバイスは、USBデバイスコントローラを有する。USBデバイスは、USBデバイス上に存在するCPUで動作するプログラムとして、USBデバイスコントローラを制御するドライバ部分及びアプリケーション部分を持ち、これらのプログラムに基づいて動作する。なお、USBデバイスは、システムの規模に応じでオペレーションシステムを持つもの、持たないものがある。   On the other hand, the USB device has a USB device controller. The USB device has a driver portion for controlling the USB device controller and an application portion as a program operating on a CPU present on the USB device, and operates based on these programs. The USB device may or may not have an operation system depending on the size of the system.

前述のように、ホストコンピュータとUSBデバイスは、それぞれのCPUを有し、個々のプログラムで動作する。しかし、USBインタフェースの通信上では、ホストコンピュータがマスタとなり、USBデバイスがスレーブの関係で動作し、通信の主導権はホストコンピュータが握っている。   As described above, the host computer and the USB device have respective CPUs and operate with respective programs. However, in the communication of the USB interface, the host computer is the master, the USB device operates in the slave relationship, and the host computer takes control of the communication.

USB2.0インタフェースでは、ホストコンピュータとUSBデバイスが4本の信号線で接続される。1本はグランド(GND)であり、もう1本はUSBデバイスにホストコンピュータから提供される5Vの電力のVBUSと呼ばれる信号線であり、残りの2本はデータが流れるD+とD−の計4本の信号線である。USBデバイスは、ホストコンピュータから供給されるVBUSの5Vがなくなると、自身のシステムを停止させる。ホストコンピュータは、VBUSの5Vのオン/オフを制御することにより、USBデバイスのシステム停止とシステム再起動を制御することが可能である。   In the USB 2.0 interface, the host computer and the USB device are connected by four signal lines. One is a ground (GND), the other is a signal line called VBUS of 5 V power supplied from the host computer to the USB device, and the remaining two lines are a total of four D + and D− through which data flows. It is a signal line of a book. The USB device shuts down its system when 5 V of VBUS supplied from the host computer is exhausted. The host computer can control the system shutdown and system restart of the USB device by controlling the VBUS 5V on / off.

また、USBデバイスを接続した際に接続不良が発生することがあり、それを自動検知して自動復旧する技術が知られている(例えば特許文献1参照)。   In addition, when a USB device is connected, a connection failure may occur, and a technique for automatically detecting it and automatically recovering it is known (see, for example, Patent Document 1).

特許第4872553号公報Patent No. 4872553

しかしながら、特許文献1では、複数のUSBデバイスが接続されていた場合が考慮されておらず、他の正常に動作しているUSBデバイスも一緒にリセットされてしまう可能性がある。   However, Patent Document 1 does not consider the case where a plurality of USB devices are connected, and there is a possibility that other normally operating USB devices may be reset together.

そこで本発明は、デバイスにエラーが発生した場合、情報処理装置に接続されている他のデバイスの動作に与える影響を抑えつつ、エラーが発生したデバイスをリセットすることができるようにすることを目的とする。   Therefore, the present invention aims to enable resetting of a device in which an error occurs while suppressing an influence on the operation of another device connected to the information processing apparatus when an error occurs in the device. I assume.

本発明の情報処理装置は、通信インタフェースを介して接続されているデバイスのエラーが連続して閾値以上の回数発生したか否かを検出するエラー検出手段と、前記エラーが連続して閾値以上の回数発生した場合には、複数の通信インタフェースのうち、前記エラーが発生したデバイスが接続されている通信インタフェースをリセットするリセット手段とを有する。   The information processing apparatus according to the present invention includes an error detection unit that detects whether an error of a device connected via a communication interface has occurred continuously a number of times that is equal to or more than a threshold; And a reset unit configured to reset a communication interface to which the device in which the error has occurred is connected among the plurality of communication interfaces.

本発明によれば、デバイスにエラーが発生した場合、情報処理装置に接続されている他のデバイスの動作に与える影響を抑えつつ、エラーが発生したデバイスをリセットすることができる。   According to the present invention, when an error occurs in a device, the device in which the error occurs can be reset while suppressing the influence on the operation of other devices connected to the information processing apparatus.

情報処理システムの構成例を示す図である。It is a figure showing an example of composition of an information processing system. 画像形成装置のハードウェア構成を例示する図である。FIG. 2 is a diagram illustrating a hardware configuration of an image forming apparatus. VBUS信号のオン/オフを実現する回路構成図である。It is a circuit block diagram which implement | achieves on / off of a VBUS signal. 画像形成装置上で動作するソフトウェアモジュールの構成を示す図である。FIG. 2 is a diagram showing a configuration of a software module operating on the image forming apparatus. 管理テーブルの例を示す図である。It is a figure which shows the example of a management table. ディスプレイに表示されるアプリケーションの画面の例を示す図である。It is a figure which shows the example of the screen of the application displayed on a display. USB制御ライブラリの処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of USB control library. USB制御モジュールの処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of a USB control module. アプリケーションのUSB制御処理の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the USB control processing of an application. USB制御ライブラリの処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of USB control library. USB制御モジュールの処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process of a USB control module.

(第1の実施形態)
図1は、本発明の第1の実施形態による情報処理システムの構成例を示す図である。情報処理システムは、画像形成装置1と、USBデバイス2と、USBデバイス3とを有する。画像形成装置1は、情報処理装置の一例であり、USBホストコントローラ207(図2)を有する。USBは、Universal Serial Busの略称である。USBデバイス2は、USBデバイスコントローラ306(図3)を有する。USBデバイス3は、USBデバイスコントローラ313(図3)を有する。USBデバイス2は、USBケーブル4を介して、画像形成装置1に接続されている。USBデバイス3は、USBケーブル5を介して、画像形成装置1に接続されている。例えば、USBデバイス2はICカードリーダであり、USBデバイス3はUSBメモリであるが、これに限定されるものではなく、どのような種類のデバイスであってもよい。
First Embodiment
FIG. 1 is a diagram showing a configuration example of an information processing system according to a first embodiment of the present invention. The information processing system includes an image forming apparatus 1, a USB device 2, and a USB device 3. The image forming apparatus 1 is an example of an information processing apparatus, and has a USB host controller 207 (FIG. 2). USB is an abbreviation for Universal Serial Bus. The USB device 2 has a USB device controller 306 (FIG. 3). The USB device 3 has a USB device controller 313 (FIG. 3). The USB device 2 is connected to the image forming apparatus 1 via the USB cable 4. The USB device 3 is connected to the image forming apparatus 1 via the USB cable 5. For example, although the USB device 2 is an IC card reader and the USB device 3 is a USB memory, the present invention is not limited to this, and any type of device may be used.

画像形成装置1は、後からアプリケーションを追加でインストールすることにより、機能を拡張することが可能になっている。アプリケーションは、USBデバイス2及び3を制御することも可能である。USBデバイス2及び3を制御するアプリケーションの例としては、ICカードを使った認証を行うICカード認証アプリや、USBメモリに格納された文書データを印刷するメディアプリントアプリなどが挙げられる。   The image forming apparatus 1 can be expanded in function by additionally installing an application later. The application can also control the USB devices 2 and 3. Examples of applications that control the USB devices 2 and 3 include an IC card authentication application that performs authentication using an IC card, and a media print application that prints document data stored in a USB memory.

なお、図1では、画像形成装置1とUSBデバイス2,3とが1対2で接続されている例を示しているが、これに限定されるものではなく、USBの規格上、接続可能な1対127までの接続が可能である。   Although FIG. 1 shows an example in which the image forming apparatus 1 and the USB devices 2 and 3 are connected in a one-to-two manner, the present invention is not limited to this. Up to one-to-one 127 connections are possible.

図2は、画像形成装置1のハードウェア構成を例示する図である。中央処理演算装置(CPU)201は、画像形成装置1を稼働させるためのソフトウェアを実行する。システムバス202は、CPU201が他のユニットにアクセスするため、及び、他のユニット同士がアクセスするための通路である。ハードディスクユニット(HDD)203は、画像形成装置1のソフトウェア、画像形成装置1が動作するために必要なデータベース、及び一次保存ファイル等を格納する。HDD203は、Solid State Drive(SSD)等の他の大容量不揮発メモリでも構わない。Random Access Memory(RAM)204は、画像形成装置1のプログラム、プログラム動作時の変数、及び各ユニットからDMA(ダイレクトメモリアクセス)で転送されるデータ等を格納する。   FIG. 2 is a diagram illustrating the hardware configuration of the image forming apparatus 1. A central processing unit (CPU) 201 executes software for operating the image forming apparatus 1. The system bus 202 is a path for the CPU 201 to access other units and for the other units to access each other. A hard disk unit (HDD) 203 stores software of the image forming apparatus 1, a database necessary for the operation of the image forming apparatus 1, and a primary storage file. The HDD 203 may be another large-capacity non-volatile memory such as a solid state drive (SSD). A random access memory (RAM) 204 stores a program of the image forming apparatus 1, variables during program operation, data transferred from each unit by DMA (direct memory access), and the like.

ネットワークコントローラインタフェース(I/F)206は、画像形成装置1とネットワーク上の他の機器と通信を行う。ネットワークコントローラ205は、ネットワークコントローラI/F206を制御する。USBホストインタフェース(I/F)208及び220は、USBインタフェースであり、画像形成装置1とUSBデバイス2,3との通信を行うための通信インタフェースである。USBホストI/F208は、USBケーブル4を介して、USBデバイス2に接続される。USBホストI/F220は、USBケーブル5を介して、USBデバイス3に接続される。USBホストコントローラ207は、USBホストI/F208及び220を制御する。   A network controller interface (I / F) 206 communicates with the image forming apparatus 1 and other devices on the network. The network controller 205 controls the network controller I / F 206. The USB host interfaces (I / F) 208 and 220 are USB interfaces, and are communication interfaces for communicating between the image forming apparatus 1 and the USB devices 2 and 3. The USB host I / F 208 is connected to the USB device 2 via the USB cable 4. The USB host I / F 220 is connected to the USB device 3 via the USB cable 5. The USB host controller 207 controls the USB host I / Fs 208 and 220.

ディスプレイ210は、画像形成装置1の動作状況をユーザ等が確認できるように表示する。ディスプレイコントローラ209は、ディスプレイ210の表示制御を行う。入力部212は、画像形成装置1へのユーザからの指示を受け付ける。入力部コントローラ211は、入力部212を制御する。入力部212は、具体的には、タッチパネル、10キー、又はキーボード等の操作部である。入力部212がタッチパネルである場合、入力部212は物理的にはディスプレイ210の表面に装着された形態になる。   The display 210 displays the operation status of the image forming apparatus 1 so that the user or the like can confirm it. The display controller 209 performs display control of the display 210. The input unit 212 receives an instruction from the user to the image forming apparatus 1. The input unit controller 211 controls the input unit 212. Specifically, the input unit 212 is an operation unit such as a touch panel, 10 keys, or a keyboard. When the input unit 212 is a touch panel, the input unit 212 is physically attached to the surface of the display 210.

リアルタイムクロック(RTC)213は、画像形成装置1の時計機能、アラーム機能、タイマー機能等を提供する。不揮発メモリ214は、書き換え可能な不揮発な記録メディアである。なお、不揮発メモリ214は、例えば、Static Random Access Memory(SRAM)であってもよい。また、不揮発メモリ214は、Electrically Erasable Programmable Read Only Memory(EEPROM)等であってもよい。   The real time clock (RTC) 213 provides a clock function, an alarm function, a timer function, and the like of the image forming apparatus 1. The non-volatile memory 214 is a rewritable non-volatile recording medium. The non-volatile memory 214 may be, for example, a static random access memory (SRAM). In addition, the non-volatile memory 214 may be Electrically Erasable Programmable Read Only Memory (EEPROM) or the like.

General Purpose Input Output(GPIO)215は、CPU201が基板回路上の信号線のローレベル/ハイレベルの状況を読み取る、又は信号線のローレベル/ハイレベルの状況の設定を変更可能にするユニットである。スキャナ制御部216は、スキャナ217を制御する。スキャナ217は、原稿を読み取る装置である。プリンタ制御部218は、プリンタ219を制御する。プリンタ219は、画像データを用紙に出力するための装置である。   General Purpose Input Output (GPIO) 215 is a unit that allows the CPU 201 to read the low level / high level status of the signal line on the substrate circuit or to change the setting of the low level / high level status of the signal line. . The scanner control unit 216 controls the scanner 217. The scanner 217 is a device for reading a document. The printer control unit 218 controls the printer 219. The printer 219 is a device for outputting image data to a sheet.

図3は、画像形成装置1及びUSBデバイス2,3の構成例を示す図である。画像形成装置1は、USBホストI/F208及び220毎にVBUS302及び309をオン/オフ制御することができる。   FIG. 3 is a view showing a configuration example of the image forming apparatus 1 and the USB devices 2 and 3. The image forming apparatus 1 can perform on / off control of the VBUS 302 and 309 for each of the USB host I / Fs 208 and 220.

USBデバイス2は、USBデバイスコントローラ306と、USBホストコントローラ207と通信するためのUSBデバイスインタフェース(I/F)301とを有する。画像形成装置1とUSBデバイス2とが通信するために、画像形成装置1のUSBホストI/F208と、USBデバイス2のUSBデバイスI/F301との間が4本の信号線302〜305で接続がされている。なお、信号線302〜305は、USBケーブル4に内包されている。VBUS302は、画像形成装置1からUSBデバイス2に5Vの電力を供給するための電力線である。D+(303)とD−(304)は、画像形成装置1とUSBデバイス2との間を通信する実データを差動信号によって通信させる信号線である。GND305は、他の信号線のローレベル/ハイレベルの基準を決める電気回路には必須であるグランド信号線である。   The USB device 2 has a USB device controller 306 and a USB device interface (I / F) 301 for communicating with the USB host controller 207. In order for the image forming apparatus 1 and the USB device 2 to communicate, the USB host I / F 208 of the image forming apparatus 1 and the USB device I / F 301 of the USB device 2 are connected by four signal lines 302 to 305 It has been done. The signal lines 302 to 305 are contained in the USB cable 4. VBUS 302 is a power line for supplying 5 V of power from image forming apparatus 1 to USB device 2. D + (303) and D- (304) are signal lines for communicating actual data communicated between the image forming apparatus 1 and the USB device 2 by differential signals. The GND 305 is a ground signal line that is essential to an electric circuit that determines the low level / high level of other signal lines.

USBデバイス3は、USBデバイスコントローラ313と、USBホストコントローラ207と通信するためのUSBデバイスインタフェース(I/F)308とを有する。画像形成装置1とUSBデバイス3とが通信するために、画像形成装置1のUSBホストI/F220と、USBデバイス3のUSBデバイスI/F308との間が4本の信号線309〜312で接続がされている。なお、信号線309〜312は、USBケーブル5に内包されている。VBUS309は、画像形成装置1からUSBデバイス3に5Vの電力を供給するための電力線である。D+(310)とD−(311)は、画像形成装置1とUSBデバイス3との間を通信する実データを差動信号によって通信させる信号線である。GND312は、他の信号線のローレベル/ハイレベルの基準を決める電気回路には必須であるグランド信号線である。   The USB device 3 has a USB device controller 313 and a USB device interface (I / F) 308 for communicating with the USB host controller 207. In order for the image forming apparatus 1 and the USB device 3 to communicate, the USB host I / F 220 of the image forming apparatus 1 and the USB device I / F 308 of the USB device 3 are connected by four signal lines 309 to 312 It has been done. The signal lines 309 to 312 are included in the USB cable 5. VBUS 309 is a power line for supplying 5 V of power from image forming apparatus 1 to USB device 3. D + (310) and D- (311) are signal lines for communicating actual data communicated between the image forming apparatus 1 and the USB device 3 by differential signals. The GND 312 is a ground signal line that is essential to an electric circuit that determines the low level / high level of another signal line.

GPIO215は、少なくとも、VBUS302のオン/オフを制御する第1のレジスタビットと、VBUS309のオン/オフを制御する第2のレジスタビットを有する。GPIO215は、CPU201の指示により、第1のレジスタビットの値をAND回路306に出力し、第2のレジスタビットの値をAND回路314に出力する。   The GPIO 215 has at least a first register bit that controls the on / off of the VBUS 302 and a second register bit that controls the on / off of the VBUS 309. The GPIO 215 outputs the value of the first register bit to the AND circuit 306 and the value of the second register bit to the AND circuit 314 according to an instruction of the CPU 201.

AND回路306は、GPIO215が出力する第1のレジスタビットと、USBホストI/F208から出力されるVBUSの出力値との論理積(AND)を取り、論理積値をVBUS302に出力する。この構成により、CPU201は、USBデバイス2に与えるVBUS302のオン/オフを制御する。即ち、AND回路306は、GPIO215から出力される第1のレジスタビットに基づいて、VBUS302を介したUSBデバイス2への電力供給を遮断可能である。USBレセクタプル307は、USBケーブル4の先端に設けられたUSBプラグを接続する部分(差し込み口)である。AND回路306は、USBホストI/F208とUSBレセクタプル307の間のVBUS上(即ち、USBインタフェースの電力線上)に設けられる。   The AND circuit 306 takes the logical product (AND) of the first register bit output by the GPIO 215 and the output value of VBUS output from the USB host I / F 208, and outputs the logical product value to the VBUS 302. With this configuration, the CPU 201 controls the on / off of the VBUS 302 provided to the USB device 2. That is, the AND circuit 306 can cut off the power supply to the USB device 2 via the VBUS 302 based on the first register bit output from the GPIO 215. The USB receptacle pull 307 is a portion (insert) for connecting a USB plug provided at the tip of the USB cable 4. The AND circuit 306 is provided on the VBUS between the USB host I / F 208 and the USB host 307 (that is, the power line of the USB interface).

AND回路314は、GPIO215が出力する第2のレジスタビットと、USBホストI/F220から出力されるVBUSの出力値との論理積(AND)を取り、論理積値をVBUS309に出力する。この構成により、CPU201は、USBデバイス3に与えるVBUS309のオン/オフを制御する。即ち、AND回路314は、GPIO215から出力される第2のレジスタビットに基づいて、VBUS309を介したUSBデバイス3への電力供給を遮断可能である。USBレセクタプル315は、USBケーブル5の先端に設けられたUSBプラグを接続する部分(差し込み口)である。AND回路314は、USBホストI/F220とUSBレセクタプル315の間のVBUS上(即ち、USBインタフェースの電力線上)に設けられる。   The AND circuit 314 takes the logical product (AND) of the second register bit output by the GPIO 215 and the output value of VBUS output from the USB host I / F 220, and outputs the logical product value to the VBUS 309. With this configuration, the CPU 201 controls the on / off of the VBUS 309 provided to the USB device 3. That is, the AND circuit 314 can cut off the power supply to the USB device 3 via the VBUS 309 based on the second register bit output from the GPIO 215. The USB receptacle pull 315 is a portion (insert) for connecting a USB plug provided at the end of the USB cable 5. The AND circuit 314 is provided on the VBUS between the USB host I / F 220 and the USB receiver 315 (that is, the power line of the USB interface).

なお、本実施形態では、AND回路306及び314を用いてVBUS302及び309のオン/オフを制御する場合を説明したが、ハイサイドスイッチとOR回路を用いてVBUS302及び309のオン/オフを制御することも可能である。また、VBUS302及び309のオン/オフを切り替え可能な構成であれば、他の構成であってもよい。   In the present embodiment, the on / off control of VBUS 302 and 309 is described using AND circuits 306 and 314, but the on / off of VBUS 302 and 309 is controlled using a high side switch and an OR circuit. It is also possible. In addition, as long as VBUS 302 and 309 can be switched on / off, another configuration may be employed.

図4は、画像形成装置1のCPU201が実行するソフトウェアモジュールの構成例を示す図である。アプリ管理モジュール401は、画像形成装置1上で動作する各種アプリケーションの管理を行う。具体的には、アプリ管理モジュール401は、アプリケーションのインストール、アンインストール、開始、停止などのライフサイクル管理機能とアプリケーション間の連携のためのフレームワーク機能を持つ。SDKライブラリ402は、アプリケーションから画像形成装置1上の機能を利用するためのライブラリ群である。認証アプリ403は、ユーザ認証を行うためのアプリケーションであり、ユーザが認証されると、アプリ管理モジュール401のフレームワーク機能を利用して他のソフトウェアモジュールにイベントを通知する。各ソフトウェアモジュールは、認証アプリ403からこのイベントを受け取ることで、ユーザがログイン中であるか否かを判断できる。複数のアプリ404は、画像形成装置1の機能をユーザに使わせるためのアプリケーションである。認証アプリ403及び複数のアプリ404は、SDKライブラリ402を利用して所望の機能を実現する。   FIG. 4 is a view showing an example of the arrangement of software modules executed by the CPU 201 of the image forming apparatus 1. An application management module 401 manages various applications operating on the image forming apparatus 1. Specifically, the application management module 401 has a life cycle management function such as installation, uninstallation, start, and stop of an application, and a framework function for cooperation between applications. An SDK library 402 is a library group for utilizing functions on the image forming apparatus 1 from an application. The authentication application 403 is an application for performing user authentication, and when the user is authenticated, notifies the other software module of an event using the framework function of the application management module 401. Each software module can determine whether the user is logging in by receiving this event from the authentication application 403. The plurality of applications 404 are applications for causing the user to use the functions of the image forming apparatus 1. The authentication application 403 and the plurality of applications 404 realize desired functions using the SDK library 402.

USB制御ライブラリ405は、アプリケーション413がUSBデバイス2又は3の制御を行うためのAPIを提供するライブラリである。USB制御ライブラリ405は、open/read/write/ioctl/closeなどの低レベルのAPIを提供している。アプリケーション413がUSBデバイス2又は3を制御したい場合は、通常のファイルI/OのAPIと同様に、所望のデバイスをオープンして制御のための識別子(図5の制御識別子505)を取得し、取得した識別子を指定して各種制御APIを呼び出す。   The USB control library 405 is a library that provides an API for the application 413 to control the USB device 2 or 3. The USB control library 405 provides low level APIs such as open / read / write / ioctl / close. When the application 413 wants to control the USB device 2 or 3, it opens the desired device and acquires an identifier for control (control identifier 505 in FIG. 5), as in the normal file I / O API. Call various control APIs by specifying the acquired identifier.

ジョブ制御ライブラリ406は、画像形成装置1が備えるコピー/スキャン/プリントなどの各種ジョブの実行制御を行うためのAPIを提供するライブラリである。入力ライブラリ407は、アプリケーション413が入力部212からの入力を受信するためのAPIを提供するライブラリである。描画ライブラリ408は、ディスプレイ210に画面を描画するためのAPIを提供するライブラリである。   The job control library 406 is a library that provides an API for controlling execution of various jobs such as copy / scan / print that the image forming apparatus 1 has. The input library 407 is a library that provides an API for the application 413 to receive an input from the input unit 212. The drawing library 408 is a library that provides an API for drawing a screen on the display 210.

USB制御モジュール409は、USB制御ライブラリ405からの要求に従って、USBホストコントローラ207の制御を行うためのソフトウェアモジュールである。USB制御モジュール409は、接続されたUSBデバイス2又は3がどのUSBホストI/F208又は220に接続されているかについて管理テーブル(図5)を用いて管理する。   The USB control module 409 is a software module for controlling the USB host controller 207 in accordance with a request from the USB control library 405. The USB control module 409 manages to which USB host I / F 208 or 220 the connected USB device 2 or 3 is connected using the management table (FIG. 5).

ジョブ制御モジュール410は、ジョブ制御ライブラリ406からの要求に従って、スキャナ制御部216やプリンタ制御部218を制御してジョブを実行したり、ジョブ状況の管理をしたりする。入力制御モジュール411は、入力ライブラリ407からの要求に従って、入力部コントローラ211からの入力を受けてデータを転送する。描画制御モジュール412は、描画ライブラリ408からの要求に従って、ディスプレイコントローラ209を制御してディスプレイ210に描画を行う。   The job control module 410 controls the scanner control unit 216 and the printer control unit 218 in accordance with a request from the job control library 406 to execute a job and manage job status. The input control module 411 receives an input from the input unit controller 211 and transfers data according to a request from the input library 407. The drawing control module 412 controls the display controller 209 to draw on the display 210 according to the request from the drawing library 408.

アプリケーション413及びSDKライブラリ402は、Java(登録商標)言語で記述されたソフトウェアモジュールである。各制御モジュール409〜412は、C言語で記述されたソフトウェアモジュールである。SDKライブラリ402及び各制御モジュール409〜412の間は、JNI(JavaNativeInterface)を使って呼び出しを行う。   The application 413 and the SDK library 402 are software modules written in Java (registered trademark) language. Each control module 409 to 412 is a software module written in C language. The SDK library 402 and each control module 409 to 412 make a call using JNI (Java Native Interface).

図5は、画像形成装置1に接続されているUSBデバイス2及び3等の情報を管理するために利用する管理テーブルの例である。この管理テーブルは、USB制御モジュール409により管理される。図5では、説明を簡単にするために、管理テーブルは、最低限の情報を示しているが、接続形態をより詳細に識別するために階層情報や親デバイス情報などを合わせて管理してもよい。   FIG. 5 is an example of a management table used to manage information of the USB devices 2 and 3 connected to the image forming apparatus 1. This management table is managed by the USB control module 409. Although FIG. 5 shows the minimum information in the management table for the sake of simplicity, even if hierarchical information, parent device information, etc. are managed together to identify the connection configuration in more detail. Good.

デバイス番号501は、接続されたUSBデバイスの番号を示すものであり、USBデバイスを接続するたびにIDをインクリメントして常に一意のIDが割り振られる。同種のUSBデバイスが接続された場合でも、異なるデバイス番号が割り振られるため、アプリケーション413から同種のUSBデバイスでも区別して制御可能である。USBホストI/Fの情報502は、USBデバイスがどのUSBホストI/Fに接続されているかを示す情報である。ハブ経由で接続されたUSBデバイスは、同一のUSBホストI/Fの情報を持つことになる。ベンダID503は、接続されたUSBデバイスのベンダ識別情報である。プロダクトID504は、接続されたUSBデバイスの製品識別情報である。制御識別子505は、アプリケーション413がUSBデバイスをオープンした際に割り振る識別子であり、オープンされていない状態(初期状態やクローズされた場合)では「−1」が設定される。USBデバイスのオープン要求を受けた場合、制御識別子505が「−1」であれば、新たな制御識別子を割り振って、要求元アプリケーション413に制御識別子505を返す。アプリケーション413は、オープン時に取得した制御識別子505を指定して、USB制御ライブラリ405の各種API(read/write/ioctl/close)を呼び出す。なお、USBデバイスの制御は、排他的になっているため、既に他のアプリケーション413がオープンしているUSBデバイスは他のアプリケーション413からオープンできないようになっている。   The device number 501 indicates the number of the connected USB device, and each time the USB device is connected, the ID is incremented and a unique ID is always assigned. Even when the same type of USB device is connected, different device numbers are assigned, so the application 413 can distinguish and control the same type of USB device. The information 502 of the USB host I / F is information indicating which USB host I / F the USB device is connected to. USB devices connected via a hub will have the same USB host I / F information. The vendor ID 503 is vendor identification information of the connected USB device. The product ID 504 is product identification information of the connected USB device. The control identifier 505 is an identifier assigned when the application 413 opens the USB device, and is set to “−1” in the unopened state (in the initial state or closed state). When receiving the open request of the USB device, if the control identifier 505 is “−1”, a new control identifier is allocated, and the control identifier 505 is returned to the request source application 413. The application 413 designates various control identifiers 505 acquired at the time of opening and calls various APIs (read / write / ioctl / close) of the USB control library 405. Since the control of the USB device is exclusive, the USB device already opened by the other application 413 can not be opened by the other application 413.

図6(a)及び(b)は、ディスプレイ210に表示されるアプリケーション413の画面の例である。図6(a)は、ICカード認証アプリ403の画面の例である。画像形成装置1の電源を入れると、最初に、図6(a)の認証アプリ403の画面が表示される。ユーザは、認証を行った後でないと、画像形成装置1の機能が利用できないようになっている。この例では、認証アプリ403は、USB制御ライブラリ405を利用してICカードリーダ2を制御し、カード情報を読み取り、認証処理を行う。認証が成功すると、画像形成装置1で利用可能なアプリケーション413の一覧画面が表示される。アプリケーション一覧画面の中から利用したいアプリケーションを選択すると、対応するアプリケーションの操作画面が表示され、ユーザは画像形成装置1の各種機能を利用できる。   6A and 6B are examples of screens of the application 413 displayed on the display 210. FIG. FIG. 6A is an example of a screen of the IC card authentication application 403. When the power of the image forming apparatus 1 is turned on, first, the screen of the authentication application 403 of FIG. 6A is displayed. The user can not use the functions of the image forming apparatus 1 until the authentication is performed. In this example, the authentication application 403 controls the IC card reader 2 using the USB control library 405, reads card information, and performs an authentication process. When the authentication is successful, a list screen of the applications 413 available in the image forming apparatus 1 is displayed. When an application to be used is selected from the application list screen, the operation screen of the corresponding application is displayed, and the user can use various functions of the image forming apparatus 1.

図6(b)は、メディアプリントアプリの画面例である。メディアプリントアプリは、USB制御ライブラリ405を利用して、USBメモリ3からデータを読み込んで、印刷を行うアプリケーションである。ファイルリスト601は、USBメモリ3に格納されている印刷可能なファイルの一覧を表示する領域である。このリストの中から、ユーザが印刷したい文書を選択し、プリントボタン602を押下すると、選択された文書が印刷される。ユーザは、所望の機能を利用し終わると、入力部212に存在する認証ボタンを押下することで、ログアウトできる。ログアウトすると、再び、図6(a)の画面が表示され、認証待ち(ログイン待ち)状態になり、本体機能を利用できない状態になる。   FIG. 6B is a screen example of the media print application. The media print application is an application that reads data from the USB memory 3 using the USB control library 405 and performs printing. The file list 601 is an area for displaying a list of printable files stored in the USB memory 3. From the list, when the user selects a document to be printed and presses the print button 602, the selected document is printed. When the user finishes using the desired function, the user can log out by pressing the authentication button present in the input unit 212. When the user logs out, the screen shown in FIG. 6A is displayed again, and the authentication waiting (login waiting) state is entered, and the main body function can not be used.

図7は、アプリケーション413からUSBデバイスへの要求を受けた時のUSB制御ライブラリ405の処理の流れを示すフローチャートである。このフローチャートの処理は、全て画像形成装置1のCPU201がUSB制御ライブラリ405を用いて実行する処理である。   FIG. 7 is a flowchart showing the process flow of the USB control library 405 when a request from the application 413 to the USB device is received. The processing of this flowchart is processing that is entirely executed by the CPU 201 of the image forming apparatus 1 using the USB control library 405.

ステップS701では、CPU201は、アプリケーション413からUSBデバイスへの要求を受けると、USB制御ライブラリ405を用いて、受信した要求をUSB制御モジュール409に送信する。要求の種類としては、open/read/write/ioctl/closeなどがある。CPU201は、USB制御ライブラリ405を用いて、USB制御モジュール409に要求を送信する際に、アプリケーション413から受け取った制御識別子505も一緒に送信する。CPU201は、USB制御モジュール409を用いて、USBホストI/Fを介してUSBデバイスに要求を送信する。   In step S 701, when the CPU 201 receives a request to the USB device from the application 413, the CPU 201 transmits the received request to the USB control module 409 using the USB control library 405. Types of requests include open / read / write / ioctl / close. When transmitting a request to the USB control module 409 using the USB control library 405, the CPU 201 also transmits the control identifier 505 received from the application 413 together. The CPU 201 transmits a request to the USB device via the USB host I / F using the USB control module 409.

次に、ステップS702では、CPU201は、USB制御ライブラリ405を用いて、USB制御モジュール409から要求に対する処理結果を受信する。なお、CPU201は、USB制御モジュール409を用いて、要求に対する処理結果をUSBホストI/Fを介してUSBデバイスから受信し、その処理結果をUSB制御ライブラリ405に送信する。   Next, in step S702, the CPU 201 receives the processing result for the request from the USB control module 409 using the USB control library 405. The CPU 201 uses the USB control module 409 to receive the processing result for the request from the USB device via the USB host I / F, and transmits the processing result to the USB control library 405.

次に、ステップS703では、CPU201は、USB制御ライブラリ405を用いて、ステップS702にて受信した処理結果が所定のエラーであったか否かを判定する。例えば、所定のエラーは、ESHUT(通信相手がシャットダウンされて送信できない)であるものとする。このエラーが返ってきた場合、画像形成装置1は、USBデバイスと正常に通信ができない状態になっていると考えられる。ステップS703において、CPU201は、所定のエラーであると判定した場合にはステップS704に処理を進め、所定のエラーでないと判定した場合にはステップS707に処理を進める。   Next, in step S703, the CPU 201 determines, using the USB control library 405, whether the processing result received in step S702 is a predetermined error. For example, it is assumed that the predetermined error is ESHUT (the communication partner is shut down and can not transmit). If this error is returned, it is considered that the image forming apparatus 1 is in a state where it can not communicate normally with the USB device. If it is determined in step S703 that the CPU 201 determines that the error is a predetermined error, the process proceeds to step S704, and if it is determined that the error is not the predetermined error, the process proceeds to step S707.

ステップS704では、CPU201は、USB制御ライブラリ405を用いて、所定のエラーの連続発生回数を記憶するためのカウンタをカウントアップする。次に、ステップS705では、CPU201は、USB制御ライブラリ405を用いて、所定のエラーの発生回数が所定回数(閾値)に達したか否かを判定する。USBデバイスは、障害がある場合、画像形成装置1からの要求に対してエラーを連続して返し続ける。CPU201は、所定回数に達したと判定した場合にはステップS706に処理を進め、所定回数に達していないと判定した場合にはステップS708に処理を進める。すなわち、CPU201は、エラー検出処理により、USBホストI/Fを介して接続されているUSBデバイスのエラーが連続して閾値以上の回数発生したことを検出した場合には、ステップS706に処理を進める。   In step S704, the CPU 201, using the USB control library 405, counts up a counter for storing the number of consecutive occurrences of a predetermined error. Next, in step S705, the CPU 201 determines, using the USB control library 405, whether the number of occurrences of a predetermined error has reached a predetermined number (threshold). The USB device continuously returns errors in response to a request from the image forming apparatus 1 when there is a failure. If the CPU 201 determines that the predetermined number of times has been reached, the process proceeds to step S706, and if it is determined that the predetermined number of times has not been reached, the process proceeds to step S708. That is, when the CPU 201 detects that the error of the USB device connected via the USB host I / F is continuously generated more than the threshold number of times by the error detection process, the process proceeds to step S706. .

ステップS706では、CPU201は、USB制御ライブラリ405を用いて、USB制御モジュール409に対してVBUSリセット要求を送信する。この際に、CPU201は、アプリケーション413から受信した制御識別子505も要求と一緒に送信する。ステップS706の処理の詳細は、図8を用いて後述する。次に、ステップS707では、CPU201は、USB制御ライブラリ405を用いて、所定のエラーの連続発生回数を記憶するためのカウンタをクリアする。次に、ステップS708では、CPU201は、USB制御ライブラリ405を用いて、ステップS702で受信した処理結果をアプリケーション413に返し、処理を終了する。   In step S706, the CPU 201 transmits a VBUS reset request to the USB control module 409 using the USB control library 405. At this time, the CPU 201 also transmits the control identifier 505 received from the application 413 together with the request. Details of the process of step S706 will be described later with reference to FIG. Next, in step S 707, the CPU 201 uses the USB control library 405 to clear a counter for storing the number of consecutive occurrences of a predetermined error. Next, in step S 708, the CPU 201 returns the processing result received in step S 702 to the application 413 using the USB control library 405, and ends the processing.

以上説明したように、CPU201は、所定のエラーが発生した場合に直ちにリセット要求を行わずに、エラーの連続発生を検知した時にのみリセット要求を行うことで、アプリケーション413やその他の復旧処理による復旧が行える余地を残している。   As described above, the CPU 201 does not immediately issue a reset request when a predetermined error occurs, but issues a reset request only when it detects a continuous occurrence of an error, thereby recovering the application 413 or other recovery processing. Leaving room for

図8は、USB制御ライブラリ405からVBUSリセット要求を受けた時のUSB制御モジュール409の処理の流れを示すフローチャートであり、図7のステップS706の処理の詳細を示す。図8の処理は、全て画像形成装置1のCPU201がUSB制御モジュール409を用いて実行する処理である。   FIG. 8 is a flowchart showing a process flow of the USB control module 409 when a VBUS reset request is received from the USB control library 405, and shows details of the process of step S706 in FIG. The processing shown in FIG. 8 is processing executed by the CPU 201 of the image forming apparatus 1 using the USB control module 409.

ステップS801では、CPU201は、USB制御モジュール409がUSB制御ライブラリ405からVBUSリセット要求を受けると、USB制御モジュール409を用いて、VBUSリセット要求の対象のUSBホストI/Fを特定する。具体的には、CPU201は、USB制御ライブラリ405から渡された制御識別子505を基に、図5で示した管理テーブルから対象となるUSBホストI/Fを特定する。管理テーブルは、図5に示すように、複数のUSBホストI/Fと複数のUSBホストI/Fにそれぞれ接続されているUSBデバイスとの対応関係を示す。   In step S801, when the USB control module 409 receives a VBUS reset request from the USB control library 405, the CPU 201 uses the USB control module 409 to specify the USB host I / F targeted for the VBUS reset request. Specifically, based on the control identifier 505 passed from the USB control library 405, the CPU 201 identifies the target USB host I / F from the management table shown in FIG. The management table, as shown in FIG. 5, indicates the correspondence between a plurality of USB host I / Fs and USB devices respectively connected to the plurality of USB host I / Fs.

次に、ステップS802では、CPU201は、USB制御モジュール409を用いて、GPIO215に対して、ステップS801で特定したUSBホストI/Fに対応するVBUSのオン/オフを制御するレジスタビットを「オフ」にするように設定する。すると、図3に示すAND回路306又は314は、GPIO215から入力する信号レベルが「ローレベル」になる。これにより、USBホストI/F208又は220からのVBUS出力が「ハイレベル」であった場合でも、USBデバイス2又は3に入力されるVBUS302又は309が「ローレベル」になる。   Next, in step S802, the CPU 201 uses the USB control module 409 to cause the GPIO 215 to “turn off” the register bit for controlling the on / off of the VBUS corresponding to the USB host I / F identified in step S801. Set to Then, in the AND circuit 306 or 314 shown in FIG. 3, the signal level input from the GPIO 215 becomes “low level”. As a result, even when the VBUS output from the USB host I / F 208 or 220 is “high level”, the VBUS 302 or 309 input to the USB device 2 or 3 becomes “low level”.

次に、ステップS803では、CPU201は、USB制御モジュール409を用いて、一定時間(例えば5秒間)待機し、一定時間経過後(ステップS803でYes)、ステップS804に処理を進める。このステップS803の処理により、一定時間VBUS302又は309が「ローレベル」に保持される。   Next, in step S803, the CPU 201 waits for a fixed time (for example, 5 seconds) using the USB control module 409, and advances the process to step S804 after the predetermined time has elapsed (Yes in step S803). By the process of step S803, VBUS 302 or 309 is held at "low level" for a predetermined time.

次に、ステップS804では、CPU201は、USB制御モジュール409を用いて、GPIO215に対して、ステップS801で特定したUSBホストI/Fに対応するVBUSのオン/オフを制御するレジスタビットを「オン」にするように設定する。このステップS804の処理により、図3で示したAND回路306又は314は、GPIO215から入力する信号レベルが「ハイレベル」になる。これにより、USBホストI/F208又は220からのVBUS出力が「ハイレベル」であった場合、USBデバイス2又は3に入力されるVBUS302又は309が「ハイレベル」になる。   Next, in step S804, the CPU 201 uses the USB control module 409 to turn on the register bit for controlling on / off of the VBUS corresponding to the USB host I / F specified in step S801 with respect to the GPIO 215. Set to As a result of the process of step S804, the signal level input from the GPIO 215 of the AND circuit 306 or 314 shown in FIG. 3 becomes "high level". Thereby, when the VBUS output from the USB host I / F 208 or 220 is "high level", the VBUS 302 or 309 input to the USB device 2 or 3 becomes "high level".

以上示したように、CPU201は、図8では、複数のUSBホストI/Fのうち、エラーが発生したUSBデバイスが接続されているUSBホストI/Fをリセットし、エラーが発生したUSBデバイスが接続されていないUSBホストI/Fをリセットしない。具体的には、CPU201は、図8では、エラーが発生したUSBデバイスが接続されているUSBホストI/FのVBUSの電力供給を一定時間停止した後に電力供給を再開することにより、リセットを行う。なお、CPU201は、図8では、エラーが発生したUSBデバイスが接続されていないUSBホストI/FのVBUSの電力供給を停止しない。USBデバイス2又は3は、VBUS302又は309の電力が一定時間供給されないことで、USBデバイス2又は3を抜き差ししたことと同様の効果を得ることができる。   As described above, in FIG. 8, the CPU 201 resets the USB host I / F to which the USB device in which the error has occurred is connected among the plurality of USB host I / Fs, and the USB device in which the error has occurred is Do not reset unconnected USB host I / F. Specifically, in FIG. 8, the CPU 201 performs the reset by stopping the power supply of the VBUS of the USB host I / F to which the USB device in which the error has occurred is connected for a certain period of time and then restarting the power supply. . In FIG. 8, the CPU 201 does not stop the power supply of the VBUS of the USB host I / F to which the USB device in which the error has occurred is not connected. The power of the VBUS 302 or 309 is not supplied for a certain period of time, so that the USB device 2 or 3 can obtain the same effect as the removal of the USB device 2 or 3.

図9(a)及び(b)は、USBデバイス2又は3の制御を行うアプリケーション413のUSB制御処理の流れを示すフローチャートである。図9(a)は、アプリケーション413がエラーリカバリ処理を実装していない場合のアプリケーション413の処理を示すフローチャートである。ステップS901では、CPU201は、アプリケーション413を用いて、USB制御処理を行う。次に、ステップS902では、CPU201は、アプリケーション413を用いて、アプリ管理部モジュール401からアプリケーション413の終了を指示されたか否かを判定する。CPU201は、アプリケーション413の終了を指示されていないと判定した場合にはステップS901に処理を戻し、アプリケーション413の終了が指示されたと判定した場合には処理を終了する。   FIGS. 9A and 9B are flowcharts showing the flow of the USB control process of the application 413 that controls the USB device 2 or 3. FIG. 9A is a flowchart showing the process of the application 413 when the application 413 does not have an error recovery process. In step S 901, the CPU 201 performs USB control processing using the application 413. Next, in step S 902, the CPU 201 determines, using the application 413, whether the application management unit module 401 has instructed the end of the application 413. If it is determined that the end of the application 413 is not instructed, the CPU 201 returns the process to step S901, and if it is determined that the end of the application 413 is instructed, the process ends.

以上示したように、図9(a)では、CPU201は、エラーが発生した場合にも、同じUSB制御処理を繰り返すことになるため、要求に対して同じエラーが返り続ける状態となる。よって、図7で説明した処理により、CPU201が、USB制御ライブラリ405を用いて、所定のエラーの連続発生を検知し、VBUSリセット要求を送信することで、自動復旧ができる。   As described above, in FIG. 9A, since the CPU 201 repeats the same USB control process even when an error occurs, the same error continues to be returned to the request. Therefore, by the processing described in FIG. 7, the CPU 201 detects the continuous occurrence of a predetermined error using the USB control library 405, and transmits the VBUS reset request, whereby automatic recovery can be performed.

図9(b)は、アプリケーション413がエラーリカバリ処理を実装している場合のUSB制御処理の概要を示すフローチャートである。ステップS910では、CPU201は、アプリケーション413を用いて、USB制御処理を行う。次に、ステップS911では、CPU201は、アプリケーション413を用いて、USB制御処理にてエラーが発生したか否かを判定する。CPU201は、エラーが発生したと判定した場合にはステップS912に処理を進め、エラーが発生していないと判定した場合にはステップS913に処理を進める。ステップS912では、CPU201は、アプリケーション413を用いて、リカバリ処理を実行し、ステップS913に処理を進める。ステップS913では、CPU201は、アプリケーション413を用いて、アプリ管理部モジュール401からアプリケーション413の終了を指示されたか否かを判定する。CPU201は、アプリケーション413の終了を指示されていないと判定した場合にはステップS910に処理を戻し、アプリケーション413の終了が指示されたと判定した場合には処理を終了する。   FIG. 9B is a flowchart showing an outline of the USB control process when the application 413 implements the error recovery process. In step S 910, the CPU 201 performs USB control processing using the application 413. Next, in step S 911, the CPU 201 uses the application 413 to determine whether an error has occurred in the USB control process. If the CPU 201 determines that an error has occurred, the process proceeds to step S912, and if it is determined that an error has not occurred, the process proceeds to step S913. In step S912, the CPU 201 executes recovery processing using the application 413, and advances the process to step S913. In step S 913, the CPU 201 determines, using the application 413, whether the application management unit module 401 has instructed the end of the application 413. If the CPU 201 determines that the end of the application 413 is not instructed, the process returns to step S 910, and if it is determined that the end of the application 413 is instructed, the process ends.

以上示したように、図9(b)では、CPU201は、エラーが発生した場合に、エラーのリカバリ処理が行える状況であれば、アプリケーション413のリカバリ処理によって自動復旧ができる。アプリケーション413の想定外のエラーが発生し、CPU201がエラー発生を検知できなかったり、リカバリ処理にてリカバリができなかったりした場合、エラーが発生し続けることになる。この場合、CPU201は、図7で説明したUSB制御ライブラリ405の処理により、エラーの連続発生を検知し、VBUSリセット要求を送信し、自動復旧される。   As described above, in FIG. 9B, the CPU 201 can perform automatic recovery by the recovery processing of the application 413 if the error recovery processing can be performed when an error occurs. If an unexpected error occurs in the application 413 and the CPU 201 can not detect the occurrence of an error or recovery can not be performed in the recovery process, the error continues to occur. In this case, the CPU 201 detects continuous occurrence of an error by the process of the USB control library 405 described with reference to FIG. 7, transmits a VBUS reset request, and is automatically restored.

以上説明したように、CPU201は、エラーが発生した場合、図9(b)のアプリケーション413の処理でリカバリできる場合には、アプリケーション413の処理により自動復旧できる。そして、CPU201は、アプリケーション413の処理でリカバリできない場合には、図7のUSB制御ライブラリ405の処理により、エラーの連続発生を検知し、VBUSリセット要求を送信し、自動復旧される。また、CPU201は、VBUSリセットを行う際、エラーが発生したUSBデバイスが接続されているUSBホストI/Fのみをリセットするため、他のUSBデバイスに影響を与えずに、自動復旧できる可能性が高くなる。   As described above, when an error occurs, if recovery can be performed by the processing of the application 413 in FIG. 9B, the CPU 201 can perform automatic recovery by the processing of the application 413. Then, if recovery is not possible by the processing of the application 413, the CPU 201 detects continuous occurrence of an error by the processing of the USB control library 405 of FIG. 7, transmits a VBUS reset request, and is automatically restored. In addition, since the CPU 201 resets only the USB host I / F to which the USB device in which the error has occurred is connected when performing the VBUS reset, there is a possibility that automatic recovery can be performed without affecting other USB devices. Get higher.

(第2の実施形態)
第1の実施形態では、CPU201は、図7のUSB制御ライブラリ405の処理により、所定のエラーの連続発生を検知すると、すぐにVBUSリセット要求を送信する場合の例を説明した。第1の実施形態では、上記の検知後、すぐにVBUSリセット要求を送信するため、同じUSBホストI/Fに接続された正常動作しているUSBデバイスに影響を与える可能性がある。そこで、第2の実施形態では、ユーザが利用中の正常動作しているUSBデバイスへ影響を与える可能性をより低く抑えることが可能な画像形成装置1を説明する。図1〜6及び図8〜9は、第1の実施形態と共通であるため、説明を省略する。
Second Embodiment
In the first embodiment, an example has been described in which the CPU 201 transmits the VBUS reset request immediately upon detecting the continuous occurrence of a predetermined error by the processing of the USB control library 405 of FIG. 7. In the first embodiment, since the VBUS reset request is transmitted immediately after the above detection, it may affect the normally operating USB device connected to the same USB host I / F. Therefore, in the second embodiment, an image forming apparatus 1 capable of suppressing the possibility of affecting the normally operating USB device being used by the user is described. 1 to 6 and 8 to 9 are the same as the first embodiment, and thus the description thereof is omitted.

図10は、アプリケーション413からUSBの制御要求を受けた時のUSB制御ライブラリ405の処理の流れを示すフローチャートである。このフローチャートの処理は、全てCPU201がUSB制御ライブラリ405を用いて実行する処理である。   FIG. 10 is a flowchart showing the flow of processing of the USB control library 405 when receiving a control request of USB from the application 413. The processing of this flowchart is all processing that the CPU 201 executes using the USB control library 405.

ステップS1001では、CPU201は、USB制御ライブラリ405がアプリケーション413からUSBデバイスへの制御要求を受信すると、USB制御ライブラリ405を用いて、受信した要求をUSB制御モジュール409に送信する。次に、ステップS1002では、CPU201は、USB制御ライブラリ405を用いて、USB制御モジュール409から要求の処理結果を受信する。   In step S1001, when the USB control library 405 receives a control request from the application 413 to the USB device, the CPU 201 transmits the received request to the USB control module 409 using the USB control library 405. Next, in step S 1002, the CPU 201 receives the processing result of the request from the USB control module 409 using the USB control library 405.

次に、ステップS1003では、CPU201は、USB制御ライブラリ405を用いて、ステップS1002にて受信した結果が所定のエラーであるか否かを判定する。CPU201は、所定のエラーであると判定した場合にはステップS1004に処理を進め、所定のエラーでないと判定した場合にはステップS1011に処理を進める。   Next, in step S1003, the CPU 201 determines, using the USB control library 405, whether the result received in step S1002 is a predetermined error. If the CPU 201 determines that the error is a predetermined error, the process proceeds to step S1004. If the CPU 201 determines that the error is not a predetermined error, the process proceeds to step S1011.

ステップS1004では、CPU201は、USB制御ライブラリ405を用いて、所定のエラーの連続発生回数を記憶するためのカウンタをカウントアップする。次に、ステップS1005では、CPU201は、USB制御ライブラリ405を用いて、所定のエラーの発生回数が所定回数に達したか否かを判定する。CPU201は、所定回数に達したと判定した場合にはステップS1006に処理を進め、所定回数に達していないと判定した場合にはステップS1012に処理を進める。   In step S1004, the CPU 201, using the USB control library 405, counts up a counter for storing the number of consecutive occurrences of a predetermined error. Next, in step S1005, the CPU 201 determines, using the USB control library 405, whether the number of occurrences of a predetermined error has reached a predetermined number. If the CPU 201 determines that the predetermined number of times has been reached, the process proceeds to step S1006, and if it is determined that the predetermined number of times has not been reached, the process proceeds to step S1012.

ステップS1006では、CPU201は、USB制御ライブラリ405を用いて、USB制御モジュール409から処理対象のUSBデバイスと同じUSBホストI/Fに接続されているUSBデバイス数を取得する。ここで、CPU201は、USB制御モジュール409を用いて、図5で示した管理テーブルから接続されているUSBデバイス数を判断してUSB制御ライブラリ405にそのUSBデバイス数の情報を返す。   In step S1006, the CPU 201 acquires the number of USB devices connected to the same USB host I / F as the USB device to be processed from the USB control module 409 using the USB control library 405. Here, the CPU 201 determines the number of connected USB devices from the management table shown in FIG. 5 using the USB control module 409, and returns information on the number of USB devices to the USB control library 405.

次に、ステップS1007では、CPU201は、USB制御ライブラリ405を用いて、接続されているUSBデバイス数が2以上か(他にUSBデバイスが接続されているか)否かを判定する。CPU201は、接続されているUSBデバイス数が2以上であると判定した場合にはステップS1008に処理を進め、接続されているUSBデバイス数が2以上でないと判定した場合はステップS1009に処理を進める。CPU201は、エラーが発生したUSBデバイスが接続されているUSBホストI/Fに複数のUSBデバイスが接続されていると判定した場合には、ステップS1008に処理を進める。   Next, in step S1007, the CPU 201 determines, using the USB control library 405, whether the number of connected USB devices is 2 or more (other USB devices are connected). If the CPU 201 determines that the number of USB devices connected is two or more, the process proceeds to step S1008. If the number of USB devices connected is determined not to be two or more, the process proceeds to step S1009. . If the CPU 201 determines that a plurality of USB devices are connected to the USB host I / F to which the USB device in which the error has occurred is connected, the process proceeds to step S1008.

ステップS1008では、CPU201は、USB制御ライブラリ405を用いて、ユーザがログイン中であるか否かの情報を認証アプリ401から取得し、ユーザがログイン中であるか否かを判定する。CPU201は、ユーザがログイン中でないと判定した場合にはステップS1009に処理を進め、ユーザがログイン中であると判定した場合にはステップS1010に処理を進める。   In step S1008, the CPU 201 acquires information on whether the user is logging in or not from the authentication application 401 using the USB control library 405, and determines whether the user is logging in or not. If the CPU 201 determines that the user is not logging in, the process proceeds to step S1009. If the CPU 201 determines that the user is logging in, the process proceeds to step S1010.

ステップS1009では、CPU201は、USB制御ライブラリ405を用いて、USB制御モジュール409に対してVBUSリセット要求を送信し、ステップS1011に処理を進める。このステップS1009の処理の詳細は、図8と同様である。   In step S1009, the CPU 201 transmits a VBUS reset request to the USB control module 409 using the USB control library 405, and advances the process to step S1011. The details of the process of step S1009 are the same as in FIG.

ステップS1010では、CPU201は、USB制御ライブラリ405を用いて、リセットフラグを「オン」に設定し、エラーが発生したUSBデバイスの情報(制御識別子505)を記憶し、ステップS1011に進む。ここで、CPU201は、USB制御ライブラリ405を用いて、RAM204上に静的に保存領域を確保し、その保存領域にリセットフラグ及びUSBデバイスの情報を記憶する。   In step S1010, the CPU 201 sets the reset flag to "on" using the USB control library 405, stores information (control identifier 505) of the USB device in which the error has occurred, and proceeds to step S1011. Here, the CPU 201 statically secures a storage area on the RAM 204 using the USB control library 405, and stores the reset flag and the information of the USB device in the storage area.

ステップS1011では、CPU201は、USB制御ライブラリ405を用いて、所定のエラーの連続発生回数を示すカウンタをクリアし、ステップS1012に処理を進める。ステップS1012では、CPU201は、USB制御ライブラリ405を用いて、ステップS1002で取得した処理結果をアプリケーション413に返し、処理を終了する。   In step S1011, using the USB control library 405, the CPU 201 clears a counter indicating the number of consecutive occurrences of a predetermined error, and advances the process to step S1012. In step S1012, the CPU 201 returns the processing result acquired in step S1002 to the application 413 using the USB control library 405, and ends the processing.

図11は、ユーザのログアウトを検出した際のUSB制御モジュール409の処理の流れを示すフローチャートである。このフローチャートの処理は、全てCPU201がUSB制御モジュール409を用いて実行する処理である。   FIG. 11 is a flowchart showing the flow of processing of the USB control module 409 when the logout of the user is detected. The processing of this flowchart is all processing that the CPU 201 executes using the USB control module 409.

ステップS1101では、CPU201は、USB制御モジュール409を用いて、認証アプリ403からログアウト通知を受けてログアウトを検出すると、リセットフラグが「オン」であるか否かを判定する。CPU201は、リセットフラグが「オン」でないと判定した場合には処理を終了し、リセットフラグが「オン」であると判定した場合にはステップS1102に処理を進める。   In step S1101, when the CPU 201 receives a logout notification from the authentication application 403 and detects logout using the USB control module 409, the CPU 201 determines whether the reset flag is "on". If the CPU 201 determines that the reset flag is not "on", the process ends. If the CPU 201 determines that the reset flag is "on", the process proceeds to step S1102.

ステップS1102では、CPU201は、USB制御モジュール409を用いて、ステップS1010で記憶していたエラー発生のUSBデバイスの情報を取得する。次に、ステップS1103では、CPU201は、USB制御モジュール409を用いて、リセットフラグを「オフ」にする。次に、ステップS1104では、CPU201は、USB制御モジュール409を用いて、ステップS1102で取得したUSBデバイス情報に基づいて、USB制御モジュール409にVBUSリセット要求を送信し、処理を終了する。このステップS1104の処理の詳細は、図8と同様である。   In step S1102, the CPU 201 uses the USB control module 409 to acquire the information of the USB device of the error occurrence stored in step S1010. Next, in step S1103, the CPU 201 sets the reset flag to “off” using the USB control module 409. Next, in step S1104, the CPU 201 transmits a VBUS reset request to the USB control module 409 based on the USB device information acquired in step S1102 using the USB control module 409, and ends the processing. The details of the process of step S1104 are the same as in FIG.

以上のように、CPU201は、エラーが発生したUSBデバイスが接続されているUSBホストI/Fに他のUSBデバイスが接続されており、かつユーザが画像形成装置1にログイン中である場合には、ユーザのログアウト後に、VBUSをリセットする。これにより、正常動作しているUSBデバイスをユーザが使用中にリセットされることを防ぐことができるため、ユーザの利便性低下を防ぐことができる。   As described above, when another USB device is connected to the USB host I / F to which the USB device in which the error has occurred is connected, and the user is logging in to the image forming apparatus 1 as described above, , Reset the VBUS after the user logs out. Thus, the user can be prevented from being reset while using the USB device that is operating normally, so that the user's convenience can be prevented from being lowered.

第1及び第2の実施形態では、説明を簡単にするため、ESHUT(通信相手がシャットダウンされて送信できない)が連続発生した場合のみVBUSのリセットを行うようにしていた。しかしながら、第1及び第2の実施形態は、これに限られるものではない。エラーの種類は、EPROTO(プロトコルエラー)やEPIPE(パイプが壊れている)など他のエラーを対象としてもよい。また、CPU201は、これらの複数のエラーが連続発生したことを検出してVBUSリセット要求を送信するようにしてもよいし、複数のエラーが所定の順番で発生したことを検出してVBUSリセット要求を送信するようにしてもよい。   In the first and second embodiments, in order to simplify the description, the VBUS is reset only when ESHUT (the communication partner is shut down and can not transmit) is continuously generated. However, the first and second embodiments are not limited to this. The type of error may be for other errors, such as EPROTO (protocol error) or EPIPE (pipe is broken). Further, the CPU 201 may detect that the plurality of errors occur successively and transmit a VBUS reset request, or detect that a plurality of errors occur in a predetermined order to request the VBUS reset. May be sent.

第1及び第2の実施形態によれば、USBデバイスのエラーが発生した場合でも、画像形成装置1に接続されている他のUSBデバイスの動作に与える影響を最小限に抑えつつ、エラーが発生したUSBデバイスを自動復旧させることができる。   According to the first and second embodiments, even when an error occurs in the USB device, the error occurs while minimizing the influence on the operation of the other USB devices connected to the image forming apparatus 1 Can automatically recover a USB device.

(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読み出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. Can also be realized. It can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.

なお、上記実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   In addition, the said embodiment only shows the example of embodiment in the case of implementing this invention, and the technical scope of this invention should not be limitedly interpreted by these. That is, the present invention can be implemented in various forms without departing from the technical concept or the main features thereof.

1 画像形成装置、207 USBホストコントローラ、208 USBホストI/F、403 認証アプリ、405 USB制御ライブラリ、409 USB制御モジュール 1 image forming apparatus, 207 USB host controller, 208 USB host I / F, 403 authentication application, 405 USB control library, 409 USB control module

Claims (9)

通信インタフェースを介して接続されているデバイスのエラーが連続して閾値以上の回数発生したか否かを検出するエラー検出手段と、
前記エラーが連続して閾値以上の回数発生した場合には、複数の通信インタフェースのうち、前記エラーが発生したデバイスが接続されている通信インタフェースをリセットするリセット手段と
を有することを特徴とする情報処理装置。
Error detection means for detecting whether an error of a device connected via the communication interface has continuously occurred more than a threshold number of times;
Information is characterized by having reset means for resetting a communication interface to which a device in which the error has occurred is connected among a plurality of communication interfaces when the error occurs continuously a number of times equal to or more than a threshold value. Processing unit.
前記リセット手段は、前記エラーが連続して閾値以上の回数発生した場合には、前記エラーが発生したデバイスが接続されていない通信インタフェースをリセットしないことを特徴とする請求項1に記載の情報処理装置。   The information processing according to claim 1, wherein the reset unit does not reset the communication interface to which the device in which the error has occurred is not connected when the error continuously occurs a number of times equal to or more than a threshold. apparatus. 前記リセット手段は、前記エラーが発生したデバイスが接続されている通信インタフェースの電力供給を一定時間停止した後に前記電力供給を再開することにより、前記リセットを行うことを特徴とする請求項1又は2に記載の情報処理装置。   3. The apparatus according to claim 1, wherein the reset unit performs the reset by resuming the power supply after stopping the power supply of the communication interface to which the device in which the error has occurred is connected for a certain period of time. The information processing apparatus according to claim 1. 前記通信インタフェースを介して前記デバイスに要求を送信し、前記要求に対する処理結果を前記通信インタフェースを介して前記デバイスから受信する要求手段をさらに有し、
前記エラー検出手段は、前記処理結果を基にエラーを検出することを特徴とする請求項1〜3のいずれか1項に記載の情報処理装置。
The apparatus further comprises request means for transmitting a request to the device via the communication interface, and receiving a processing result for the request from the device via the communication interface,
The information processing apparatus according to any one of claims 1 to 3, wherein the error detection unit detects an error based on the processing result.
前記リセット手段は、複数の通信インタフェースと前記複数の通信インタフェースにそれぞれ接続されているデバイスとの対応関係を示すテーブルを基に、前記エラーが発生したデバイスが接続されている通信インタフェースを特定することを特徴とする請求項1〜4のいずれか1項に記載の情報処理装置。   The reset means identifies the communication interface to which the device in which the error has occurred is connected, based on a table indicating correspondences between the plurality of communication interfaces and the devices respectively connected to the plurality of communication interfaces. The information processing apparatus according to any one of claims 1 to 4, characterized in that 前記リセット手段は、前記エラーが連続して閾値以上の回数発生し、かつ、前記エラーが発生したデバイスが接続されている通信インタフェースに複数のデバイスが接続されている場合には、ログアウト後に、複数の通信インタフェースのうち、前記エラーが発生したデバイスが接続されている通信インタフェースをリセットすることを特徴とする請求項1〜5のいずれか1項に記載の情報処理装置。   In the case where a plurality of devices are connected to the communication interface to which the device in which the error has occurred is connected, a plurality of the reset means are generated after the logout. The information processing apparatus according to any one of claims 1 to 5, wherein among the communication interfaces, the communication interface to which the device in which the error occurs is connected is reset. 前記通信インタフェースは、USBインタフェースであることを特徴とする請求項1〜6のいずれか1項に記載の情報処理装置。   The information processing apparatus according to any one of claims 1 to 6, wherein the communication interface is a USB interface. 通信インタフェースを介して接続されているデバイスのエラーが連続して閾値以上の回数発生したか否かを検出するエラー検出ステップと、
前記エラーが連続して閾値以上の回数発生した場合には、複数の通信インタフェースのうち、前記エラーが発生したデバイスが接続されている通信インタフェースをリセットするリセットステップと
を有することを特徴とする情報処理装置の制御方法。
An error detection step of detecting whether an error of a device connected via the communication interface has continuously occurred more than a threshold number of times;
Information including a reset step of resetting a communication interface to which a device in which the error has occurred is connected among a plurality of communication interfaces when the error occurs continuously a number of times equal to or more than a threshold value. Control method of processing apparatus.
コンピュータを、請求項1〜7のいずれか1項に記載された情報処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the information processing apparatus described in any one of Claims 1-7.
JP2017235241A 2017-12-07 2017-12-07 Information processing device, control method of information processing device and program Pending JP2019101972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017235241A JP2019101972A (en) 2017-12-07 2017-12-07 Information processing device, control method of information processing device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017235241A JP2019101972A (en) 2017-12-07 2017-12-07 Information processing device, control method of information processing device and program

Publications (1)

Publication Number Publication Date
JP2019101972A true JP2019101972A (en) 2019-06-24

Family

ID=66973879

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017235241A Pending JP2019101972A (en) 2017-12-07 2017-12-07 Information processing device, control method of information processing device and program

Country Status (1)

Country Link
JP (1) JP2019101972A (en)

Similar Documents

Publication Publication Date Title
US8310698B2 (en) Image forming apparatus and activating method thereof
US11204852B2 (en) Information processing apparatus, method of controlling the same, information processing system and storage medium
JP2018116648A (en) Information processor, control method thereof and program
JP6141240B2 (en) Printing apparatus, storage control apparatus connected to printing apparatus, printing apparatus control method and program
JP2012234483A (en) Information processing apparatus, control method therefor, and control program
US9749189B2 (en) Generating graphical diagram of physical layout of computer platforms
JP5542787B2 (en) Image forming apparatus
JP6597417B2 (en) Electronic device, recovery method and program
JP2019101972A (en) Information processing device, control method of information processing device and program
CN107066072B (en) Electronic device and control method thereof
US11095778B2 (en) Storing and outputting log for failure analysis in image forming apparatus equipped with SATA system, control method therefor, and storage medium
JP7374622B2 (en) information processing equipment
JP5775367B2 (en) Information processing apparatus and control method thereof, mirroring system and RAID control apparatus
JP2003337784A (en) Control system and usb device
JP6415633B2 (en) Information processing apparatus and control method thereof
TWI755068B (en) Data storage device with system operation capability
JP7346524B2 (en) Image forming apparatus, control method and program for image forming apparatus
US8988721B2 (en) Printing apparatus and method for controlling a timing at which print data and status information communication ports are opened
JP6915565B2 (en) Image processing device
EP3340010B1 (en) Printing apparatus and method for controlling the same
JP2020166752A (en) Information processing device, method for controlling information processing device, and program
JP2004302870A (en) Write-protect method for media reader/writer
JP2023068460A (en) Image processing device, control method of the same, and program
JP2021082003A (en) Information processing device
JP2023103764A (en) Information processing apparatus, method for controlling information processing apparatus, and program