JP2016035721A - Usb transfer device, usb transfer system, and usb transfer method - Google Patents

Usb transfer device, usb transfer system, and usb transfer method Download PDF

Info

Publication number
JP2016035721A
JP2016035721A JP2014159112A JP2014159112A JP2016035721A JP 2016035721 A JP2016035721 A JP 2016035721A JP 2014159112 A JP2014159112 A JP 2014159112A JP 2014159112 A JP2014159112 A JP 2014159112A JP 2016035721 A JP2016035721 A JP 2016035721A
Authority
JP
Japan
Prior art keywords
transfer
data
usb
buffer
packet
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.)
Granted
Application number
JP2014159112A
Other languages
Japanese (ja)
Other versions
JP6542513B2 (en
Inventor
真那人 上原
Manato Uehara
真那人 上原
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.)
NEC Engineering Ltd
Original Assignee
NEC Engineering Ltd
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 NEC Engineering Ltd filed Critical NEC Engineering Ltd
Priority to JP2014159112A priority Critical patent/JP6542513B2/en
Publication of JP2016035721A publication Critical patent/JP2016035721A/en
Application granted granted Critical
Publication of JP6542513B2 publication Critical patent/JP6542513B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a USB transfer device and the like capable of improving performance of data transfer between devices while suppressing the increase in cost.SOLUTION: A USB transfer device comprises a USB controller including a buffer set containing a data buffer that stores a data packet as a transferrable unit of data to be USB-transferred between a processor that controls an own device and a counter device connected via transmission means, and a status buffer that stores at least either one of the size of the data packet stored in the data buffer and information indicating the completion of transfer of data. When the information indicating the completion of transfer is stored in the status buffer, the USB controller supplies a transfer completion interruption signal to the processor.SELECTED DRAWING: Figure 1

Description

本発明は、複数の装置間において、USB(Universal Serial Bus)伝送手段を介して受信したデータをメモリに転送する技術に関する。   The present invention relates to a technique for transferring data received via a USB (Universal Serial Bus) transmission means to a memory between a plurality of devices.

USB規格は、USBホストとなるパーソナルコンピュータ(Personal Computer:PC)等と、USBデバイスとなる複数のPC周辺装置とを接続し、データ通信を行うために策定されたシリアルバスインタフェース規格である。   The USB standard is a serial bus interface standard formulated for data communication by connecting a personal computer (PC) serving as a USB host and a plurality of PC peripheral devices serving as USB devices.

USBホスト(以下、単に「ホスト」と称する)およびUSBデバイス(以下、単に「デバイス」と称する)は、それぞれUSB規格によりデータの送受信を行うUSBコントローラと、CPU(Central Processing Unit)がデータ処理を行う際に使用するメインメモリとを備える。   A USB host (hereinafter simply referred to as “host”) and a USB device (hereinafter simply referred to as “device”) are each subjected to data processing by a USB controller that transmits and receives data according to the USB standard and a CPU (Central Processing Unit). And a main memory used when performing the process.

ホストのUSBコントローラが、デバイスのUSBコントローラから受信したデータをメインメモリに転送する際、例えば、DMA(Direct Memory Access)が用いられる。このDMAの制御を司るコントローラ(以下、「DMAコントローラ」と称する)は、USBコントローラとメインメモリとの間のデータ転送において、CPUとは独立に、即ちCPUを介さずに直接データのやり取り(受け渡し)を行うことによってCPUの負荷の軽減を図っている。   When the host USB controller transfers the data received from the device USB controller to the main memory, for example, DMA (Direct Memory Access) is used. The controller that controls the DMA (hereinafter referred to as “DMA controller”) exchanges data (transfers) directly between the USB controller and the main memory independently of the CPU, that is, without going through the CPU. ) To reduce the load on the CPU.

このDMAによりデータ転送する場合、転送するデータ量が不明である場合がある。この場合、DMAコントローラが転送可能なデータ量が設定されて転送が開始されると共に、DMA転送が終了したときに、その旨をCPUに通知(転送終了割り込み)する必要がある。   When data is transferred by this DMA, the amount of data to be transferred may be unknown. In this case, it is necessary to set the amount of data that can be transferred by the DMA controller and start the transfer. When the DMA transfer ends, it is necessary to notify the CPU (transfer end interrupt).

この割り込みを受けると、CPUは、転送されたデータを用いて処理を行うと共に、必要に応じて再び転送を開始する指示を出す。   When this interrupt is received, the CPU performs processing using the transferred data and issues an instruction to start the transfer again if necessary.

例えば、特許文献1には、CPUの負荷を増大させることなく、USB受信部がデータの受信を終了したときにDMA制御部の転送を自動的に終了するDMA転送装置が開示される。   For example, Patent Document 1 discloses a DMA transfer device that automatically ends the transfer of the DMA control unit when the USB reception unit finishes receiving data without increasing the load on the CPU.

図9は、例えば特許文献1に記載のようなDMA転送の動作を示すフローチャートである。ここでは、ホストのUSBコントローラがデバイスのUSBコントローラから受信したデータを、DMAコントローラがメインメモリにDMA転送する動作について説明する。まず、ホストのCPUは、USBコントローラに、デバイスからの転送を開始する指示を出す(S1)。ホストのUSBコントローラは、デバイスからUSBデータパケットを受信する(S2)。   FIG. 9 is a flowchart showing the DMA transfer operation described in Patent Document 1, for example. Here, an operation in which the DMA controller DMA-transfers data received from the USB controller of the device by the host USB controller to the main memory will be described. First, the CPU of the host issues an instruction to start transfer from the device to the USB controller (S1). The host USB controller receives the USB data packet from the device (S2).

ホストのUSBコントローラは、受信したデータパケットがショートパケット(またはNULLパケット)か否かを解析する(S3)。ここで、設定されたサイズ(USBコントローラでは、一般にはマックスパケットサイズ)より小さいパケットを、「ショートパケット」と称する。USBコントローラは、受信したデータパケットがショートパケット(またはNULLパケット)でなければ、DMAコントローラを介してDMA転送を実施する(S4)。   The host USB controller analyzes whether the received data packet is a short packet (or a NULL packet) (S3). Here, a packet smaller than the set size (generally the maximum packet size in the USB controller) is referred to as a “short packet”. If the received data packet is not a short packet (or a NULL packet), the USB controller performs DMA transfer via the DMA controller (S4).

一方、受信したデータパケットがショートパケット(またはNULLパケット)である場合、USBコントローラは、DMAコントローラを介してDMA転送を実施する(S5)と共に、DMA転送が終了した旨をCPUに通知するために、割り込みハンドラをコールする(S6)。CPUは、その割り込みに応じて、メモリにDMA転送されたデータを用いて所定の処理を実行する(S7)。   On the other hand, if the received data packet is a short packet (or a NULL packet), the USB controller performs DMA transfer via the DMA controller (S5) and notifies the CPU that the DMA transfer is complete. The interrupt handler is called (S6). In response to the interrupt, the CPU executes a predetermined process using the data DMA-transferred to the memory (S7).

他の関連技術として、特許文献2には、プロセッサとネットワークインタフェイスデバイスとの間のパケット受信処理におけるボトルネックを解消し、高速パケット処理が可能なネットワーク装置が開示される。   As another related technique, Patent Document 2 discloses a network device capable of solving a bottleneck in packet reception processing between a processor and a network interface device and performing high-speed packet processing.

また、特許文献3には、複数のプロセッサを備えた情報処理装置において、それぞれのプロセッサにタスクを割り当ることにより、複数のタスクを並列処理したりパイプライン処理したりする技術が開示される。   Patent Document 3 discloses a technique for performing parallel processing or pipeline processing of a plurality of tasks by assigning a task to each processor in an information processing apparatus including a plurality of processors.

また、特許文献4には、破損したパケットに対する認識を正しくし、より一層エラー耐性を向上させることができる通信制御装置が開示される。   Patent Document 4 discloses a communication control device that can correctly recognize a damaged packet and further improve error tolerance.

また、特許文献5には、複数のバッファメモリに対する転送を並行に行えるUSBデバイスコントローラが開示される。   Patent Document 5 discloses a USB device controller capable of transferring data to a plurality of buffer memories in parallel.

また、特許文献6には、十分なデータ転送速度を保証できるとともに、システムバスの占有時間の削減を可能としたダイレクトメモリアクセス装置が開示される。   Patent Document 6 discloses a direct memory access device that can guarantee a sufficient data transfer speed and can reduce the occupation time of the system bus.

特開2009−251771号公報JP 2009-251771 A 特開2008−129767号公報JP 2008-129767 A 特開2008−123140号公報JP 2008-123140 A 特開2007−096737号公報JP 2007-096737 A 特開2004−199402号公報JP 2004-199402 A 特開2004−145593号公報JP 2004-145593 A

上述のように、USBコントローラは、対向装置から受信したデータパケットがショートパケット(またはNULLパケット)か否かに基づいて、転送が終了したことを判断している。しかしながら、この場合、ホストと対向装置とのデータパケットの送受信に、ショートパケットが頻発するプロトコルを採用したシステムでは、CPUへの転送終了割り込みが頻発する。この結果、CPUが処理すべき割り込みハンドラが多くなるので、CPU処理が増大し、それにより転送性能が低下するという課題がある。   As described above, the USB controller determines that the transfer has been completed based on whether the data packet received from the opposite device is a short packet (or a NULL packet). However, in this case, in a system adopting a protocol in which short packets are frequently transmitted and received between the host and the opposite device, a transfer end interrupt to the CPU is frequently generated. As a result, since the number of interrupt handlers to be processed by the CPU increases, there is a problem in that the CPU processing increases, thereby reducing the transfer performance.

特許文献2に開示されるネットワーク装置では、プロセッサとネットワークインタフェイスデバイスとの間のパケット受信処理におけるボトルネックを解消している。しかしながら、このボトルネックを解消するマルチコアプロセッサの実装のためのハードウエアのコストが大幅に増加すると共に、制御の複雑化に伴いソフトウエアのコストも大幅に増加するという課題がある。   In the network device disclosed in Patent Document 2, a bottleneck in packet reception processing between the processor and the network interface device is eliminated. However, there is a problem that the cost of hardware for implementing a multi-core processor that eliminates this bottleneck is greatly increased, and the cost of software is greatly increased as control is complicated.

上記特許文献3乃至6には、コストの増加を抑えながら、装置間におけるデータ転送の性能を向上させる技術は開示されていない。   Patent Documents 3 to 6 do not disclose a technique for improving the performance of data transfer between devices while suppressing an increase in cost.

本願発明は、上記課題を鑑みてなされたものであり、コストの増加を抑えながら、装置間におけるデータ転送の性能を向上させることが可能なUSB転送装置等を提供することを主要な目的とする。   The present invention has been made in view of the above problems, and has as its main object to provide a USB transfer device and the like that can improve the performance of data transfer between devices while suppressing an increase in cost. .

本発明の第1のUSB転送装置は、自装置を制御するプロセッサと、伝送手段を介して接続される対向装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくとも前記データバッファに格納したデータパケットのサイズおよび前記データの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有するUSBコントローラとを備え、前記USBコントローラは、前記ステータスバッファに前記転送終了を示す情報が格納される場合、前記プロセッサに転送終了割り込み信号を供給する。   The first USB transfer device of the present invention stores data packets that are data transferable units of data transferred by USB between a processor that controls the device and a counter device connected via a transmission means. A USB controller having a buffer set including a buffer and a status buffer that stores at least one of a size of a data packet stored in the data buffer and information indicating the end of transfer of the data, and the USB controller includes: When information indicating the end of transfer is stored in the status buffer, a transfer end interrupt signal is supplied to the processor.

本発明の第1のUSB転送システムは、自装置を制御するプロセッサと、伝送手段を介して接続されるデバイス装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくとも前記データバッファに格納したデータパケットのサイズおよび前記データの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有するUSBコントローラとを備え、前記USBコントローラは、前記ステータスバッファに前記転送終了を示す情報が格納される場合、前記プロセッサに転送終了割り込み信号を供給するホスト装置と、自装置を制御するプロセッサと、伝送手段を介して接続されるホスト装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくとも前記データバッファに格納したデータパケットのサイズおよび前記データの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有するUSBコントローラとを備え、前記USBコントローラは、前記ステータスバッファに前記転送終了を示す情報が格納される場合、前記プロセッサに転送終了割り込み信号を供給するデバイス装置とを備える。   The first USB transfer system of the present invention stores data packets that are data transferable units of data transferred by USB between a processor that controls the device and a device connected via a transmission means. A USB controller having a buffer set including a buffer and a status buffer that stores at least one of a size of a data packet stored in the data buffer and information indicating the end of transfer of the data, and the USB controller includes: When information indicating the end of transfer is stored in a status buffer, a host device that supplies a transfer end interrupt signal to the processor, a processor that controls the host device, and a host device connected via transmission means The data packet, which is the unit that can transfer data transferred via USB A USB controller having a buffer set including a data buffer storing at least one of a size of a data packet stored in the data buffer and a status buffer storing information indicating the end of data transfer, and the USB controller The controller includes a device device that supplies a transfer end interrupt signal to the processor when information indicating the transfer end is stored in the status buffer.

本発明の第1のUSB転送方法は、伝送手段を介して接続される対向装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくとも前記データバッファに格納したデータパケットのサイズおよび前記データの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有するUSBコントローラが、前記ステータスバッファに前記転送終了を示す情報が格納される場合、自装置を制御するプロセッサに転送終了割り込み信号を供給する。   The first USB transfer method of the present invention includes a data buffer for storing a data packet, which is a unit capable of transferring data to be USB-transferred with an opposite apparatus connected via a transmission means, and at least the data buffer. When a USB controller having a buffer set including a status buffer that stores either the size of the stored data packet and information indicating the end of transfer of the data stores information indicating the end of the transfer in the status buffer, A transfer end interrupt signal is supplied to the processor that controls the device itself.

本願発明によれば、コストの増加を抑えながら、装置間におけるデータ転送の性能を向上させることができるという効果が得られる。   According to the present invention, it is possible to improve the data transfer performance between devices while suppressing an increase in cost.

本発明の第1の実施形態に係るUSB転送システムの構成を示すブロック図である。1 is a block diagram showing a configuration of a USB transfer system according to a first embodiment of the present invention. 本発明の第1の実施形態に係るUSB転送システムにおけるホスト装置がデバイス装置からデータを受信するIN転送を実施する際の動作について説明するフローチャートである。4 is a flowchart for explaining an operation when the host apparatus performs IN transfer in which data is received from the device apparatus in the USB transfer system according to the first embodiment of the present invention. ショートパケットを受信したことを転送終了のトリガとする場合に転送終了割り込み信号が発生するタイミングを模式的に説明する図である。It is a figure which illustrates typically the timing which a transfer end interruption signal generate | occur | produces, when receiving the short packet is made into the trigger of a transfer end. 本発明の第1の実施形態に係るUSB転送システムにおいて転送終了割り込み信号が発生するタイミングを模式的に説明する図である。It is a figure which illustrates typically the timing which the transfer end interruption signal generate | occur | produces in the USB transfer system which concerns on the 1st Embodiment of this invention. 本発明の第2の実施形態に係るUSB転送システムにおいてショートパケットモードからIRQモードに移行する動作を示す図である。It is a figure which shows the operation | movement which transfers to IRQ mode from the short packet mode in the USB transfer system which concerns on the 2nd Embodiment of this invention. 本発明の第2の実施形態に係るUSB転送システムにおいてショートパケットモードからIRQモードに移行しない動作の一例を示す図である。It is a figure which shows an example of the operation | movement which does not transfer to the IRQ mode from the short packet mode in the USB transfer system which concerns on the 2nd Embodiment of this invention. 本発明の第2の実施形態に係るUSB転送システムにおいてショートパケットモードからIRQモードに移行しない動作の他の例を示す図である。It is a figure which shows the other example of the operation | movement which does not transfer to IRQ mode from the short packet mode in the USB transfer system which concerns on the 2nd Embodiment of this invention. 本発明の第3の実施形態に係るUSB転送システムの構成を示すブロック図である。It is a block diagram which shows the structure of the USB transfer system which concerns on the 3rd Embodiment of this invention. 関連技術の転送システムの動作について説明するフローチャートである。It is a flowchart explaining operation | movement of the transfer system of related technology.

以下、本発明の実施形態について図面を参照して詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

第1の実施形態
図1は、本発明の第1の実施形態に係るUSB転送システム100の構成を示すブロック図である。USB転送システム100は、ホスト装置200とデバイス装置300とを備える。ホスト装置200とデバイス装置300は、互いにUSB伝送部(USBバス)260を介して接続され、データを送受信する。
First Embodiment FIG. 1 is a block diagram showing a configuration of a USB transfer system 100 according to a first embodiment of the present invention. The USB transfer system 100 includes a host device 200 and a device device 300. The host device 200 and the device device 300 are connected to each other via a USB transmission unit (USB bus) 260 and transmit / receive data.

ホスト装置200は、USBコントローラ210、DMAコントローラ(転送コントローラ)220、メインメモリ230、CPU240、記憶媒体250を備える。USBコントローラ210、DMAコントローラ220、メインメモリ230およびCPU240は、互いに内部バスによって接続される。   The host device 200 includes a USB controller 210, a DMA controller (transfer controller) 220, a main memory 230, a CPU 240, and a storage medium 250. The USB controller 210, the DMA controller 220, the main memory 230, and the CPU 240 are connected to each other via an internal bus.

CPU240は、記録媒体250に格納されるコンピュータプログラムを読み出してメインメモリ230に書き込むと共に、そのコンピュータプログラムを実行することにより、ホスト装置200全体の動作を司る。記録媒体250は、ホスト装置200の内部に含まれてもよいし、ホスト装置200の外部に設けられてホスト装置200と接続されてもよい。   The CPU 240 reads out a computer program stored in the recording medium 250 and writes it in the main memory 230 and executes the computer program to control the operation of the entire host device 200. The recording medium 250 may be included in the host device 200 or may be provided outside the host device 200 and connected to the host device 200.

DMAコントローラ220は、USBコントローラ210がUSB伝送部を介して受信したデータを、CPU240を介さずにメインメモリ230に転送(DMA転送)する制御を行う。   The DMA controller 220 performs control to transfer (DMA transfer) data received by the USB controller 210 via the USB transmission unit to the main memory 230 without passing through the CPU 240.

USBコントローラ210は、対向装置(ここではデバイス装置300)のUSBコントローラ310との間でデータを送受信する制御を行う。USBコントローラ210は、所定サイズのパケット単位でデータを送受信する。以降、USBコントローラ210と対向装置との間で送受信されるパケット単位のデータを「データパケット」と称する。   The USB controller 210 performs control to transmit / receive data to / from the USB controller 310 of the opposite apparatus (here, the device apparatus 300). The USB controller 210 transmits and receives data in units of packets of a predetermined size. Hereinafter, data in packet units transmitted / received between the USB controller 210 and the opposite device is referred to as a “data packet”.

USBコントローラ210は、データバッファとステータスバッファとを含むバッファセットを1または複数備える。図1には、USBコントローラ210は、データバッファとステータスバッファを2セット(2組)(すなわち、データバッファ211aとステータスバッファ211b、データバッファ212aとステータスバッファ212b)備えることを示すが、これに限らない。   The USB controller 210 includes one or more buffer sets including a data buffer and a status buffer. FIG. 1 shows that the USB controller 210 includes two sets (two sets) of data buffers and status buffers (that is, the data buffer 211a and the status buffer 211b, and the data buffer 212a and the status buffer 212b). Absent.

データバッファ211a、212aは、対向装置から受信したデータを格納する。ステータスバッファ211b、212bは、それぞれデータバッファ211a、212aに格納されたデータのサイズ、または割り込みに関する情報を格納する。データバッファ211a、212aは、例えば512バイトのサイズであってよく、それらの組となるステータスバッファ211b、212bは、それぞれデータバッファ211a、212aのサイズより小さくてもよい。   The data buffers 211a and 212a store data received from the opposite device. The status buffers 211b and 212b store the size of data stored in the data buffers 211a and 212a, or information on interrupts, respectively. The data buffers 211a and 212a may have a size of, for example, 512 bytes, and the status buffers 211b and 212b that form a set thereof may be smaller than the sizes of the data buffers 211a and 212a, respectively.

デバイス装置300も、ホスト装置200と同様の構成を有する。すなわち、デバイス装置300は、USBコントローラ310、DMAコントローラ320、メインメモリ330、CPU340および記録媒体350を備える。USBコントローラ310、DMAコントローラ320、メインメモリ330およびCPU340は、互いに内部バスによって接続される。   The device device 300 also has the same configuration as the host device 200. That is, the device apparatus 300 includes a USB controller 310, a DMA controller 320, a main memory 330, a CPU 340, and a recording medium 350. The USB controller 310, the DMA controller 320, the main memory 330, and the CPU 340 are connected to each other via an internal bus.

CPU340は、記録媒体350に格納されるコンピュータプログラムを読み出してメインメモリ330に書き込むと共に、そのコンピュータプログラムを実行することにより、デバイス装置300全体の動作を司る。記録媒体350は、デバイス装置300の内部に含まれてもよいし、デバイス装置300の外部に設けられてデバイス装置300と接続されてもよい。   The CPU 340 reads the computer program stored in the recording medium 350 and writes it in the main memory 330 and executes the computer program to control the operation of the device device 300 as a whole. The recording medium 350 may be included in the device apparatus 300 or may be provided outside the device apparatus 300 and connected to the device apparatus 300.

DMAコントローラ320は、USBコントローラ310がUSB伝送部260を介して受信したデータを、CPU340を介さずにメインメモリ330に転送(DMA転送)する制御を行う。   The DMA controller 320 performs control to transfer (DMA transfer) data received by the USB controller 310 via the USB transmission unit 260 to the main memory 330 without using the CPU 340.

USBコントローラ310は、対向装置(ここではホスト装置200)のUSBコントローラ210との間でデータを送受信する制御を行う。   The USB controller 310 performs control to transmit / receive data to / from the USB controller 210 of the opposite device (here, the host device 200).

USBコントローラ310は、データバッファとステータスバッファとを含むバッファセットを1または複数備える。図1には、USBコントローラ310は、データバッファとステータスバッファを2セット(2組)(すなわち、データバッファ311aとステータスバッファ311b、データバッファ312aとステータスバッファ312b)備えることを示すが、これに限らない。   The USB controller 310 includes one or more buffer sets including a data buffer and a status buffer. FIG. 1 shows that the USB controller 310 includes two sets (two sets) of data buffers and status buffers (that is, the data buffer 311a and the status buffer 311b, the data buffer 312a and the status buffer 312b), but the present invention is not limited to this. Absent.

データバッファ311a、312aは、対向装置から受信したデータパケットを格納する。ステータスバッファ311b、312bは、それぞれデータバッファ311a、312aに格納されたデータのサイズ等を格納する。データバッファ311a、312aは、例えば512バイトのサイズであってよく、それらの組となるステータスバッファ311b、312bは、それぞれデータバッファ311a、312aのサイズより小さくてもよい。   The data buffers 311a and 312a store data packets received from the opposite device. The status buffers 311b and 312b store the size of data stored in the data buffers 311a and 312a, respectively. The data buffers 311a and 312a may have a size of, for example, 512 bytes, and the status buffers 311b and 312b that form a set thereof may be smaller than the sizes of the data buffers 311a and 312a, respectively.

USBコントローラ210、310に含まれるバッファは、FIFO(First In First Out)でデータを入出力する。以降の説明では、使用されるバッファセット(データバッファとステータスバッファ)は、USBコントローラ210、310にそれぞれ含まれる複数組のうちいずれでもよいが、例えばデータバッファ211aとステータスバッファ211b、およびデータバッファ311aとステータスバッファ311bについて説明する。   The buffers included in the USB controllers 210 and 310 input and output data using a FIFO (First In First Out). In the following description, the buffer set (data buffer and status buffer) to be used may be any of a plurality of sets included in the USB controllers 210 and 310. For example, the data buffer 211a, the status buffer 211b, and the data buffer 311a are used. The status buffer 311b will be described.

ここで、ステータスバッファ211b、311bについて説明する。ステータスバッファ211b、311bには、上述したように、それぞれの組となるデータバッファ211a、311aに格納されるデータのサイズ、または割り込みに関する情報が格納される。   Here, the status buffers 211b and 311b will be described. As described above, the status buffers 211b and 311b store information on the size of data stored in the data buffers 211a and 311a of the respective groups, or interrupts.

割り込みに関する情報とは、対向装置にIRQ(Interrupt ReQuest)ハンドシェイクパケットを送信するとき、または対向装置からIRQハンドシェイクパケットを受信したときにセットされるフラグである。IRQハンドシェイクパケットは、ホスト装置200またはデバイス装置300が、対向装置(すなわちデバイス装置300またはホスト装置200)に対して、転送終了割り込み信号を供給するために送信するパケットである。   The information on the interrupt is a flag that is set when an IRQ (Interrupt ReQuest) handshake packet is transmitted to the opposite device or when an IRQ handshake packet is received from the opposite device. The IRQ handshake packet is a packet that the host device 200 or the device device 300 transmits to supply a transfer end interrupt signal to the opposite device (that is, the device device 300 or the host device 200).

ホスト装置200またはデバイス装置300は、このIRQハンドシェイクパケットを受信すると、それぞれステータスバッファ211bまたは311bに、IRQハンドシェイクパケット送受信フラグ「オン」をセットする。ステータスバッファ211b、311bにフラグ「オン」がセットされている場合、USBコントローラ210およびUSBコントローラ310は、自装置が備えるCPU240およびCPU340に対して転送終了割り込み信号を供給する。   When receiving the IRQ handshake packet, the host device 200 or the device device 300 sets the IRQ handshake packet transmission / reception flag “ON” in the status buffer 211b or 311b, respectively. When the flag “ON” is set in the status buffers 211b and 311b, the USB controller 210 and the USB controller 310 supply a transfer end interrupt signal to the CPU 240 and the CPU 340 included in the own apparatus.

次に、ホスト装置200およびデバイス装置300の動作について説明する。ホスト装置200およびデバイス装置300は、それぞれ以下のように、対向装置との間で送受信したデータパケットを処理する。まず、デバイス装置300がホスト装置200からデータパケットを受信する動作について説明する。   Next, operations of the host device 200 and the device device 300 will be described. The host device 200 and the device device 300 each process a data packet transmitted / received to / from the opposite device as follows. First, an operation in which the device apparatus 300 receives a data packet from the host apparatus 200 will be described.

デバイス装置300のUSBコントローラ310は、ホスト装置200からUSB伝送部260を介してデータパケットを受信した場合、そのデータパケットをデータバッファ311aに格納すると共に、データパケットのサイズをステータスバッファ311bに格納する。   When receiving a data packet from the host device 200 via the USB transmission unit 260, the USB controller 310 of the device device 300 stores the data packet in the data buffer 311a and stores the size of the data packet in the status buffer 311b. .

USBコントローラ310は、IRQハンドシェイクパケットを受信した場合、ステータスバッファ311bに、IRQハンドシェイクパケット送受信フラグ「オン」を格納する。このとき、USBコントローラ310は、ステータスバッファ311bと組となるデータバッファ311aには何も格納しない。USBコントローラ310は、このように、受信したデータパケットまたはIRQハンドシェイクパケットに応じて、1または複数組備えるバッファセットのデータバッファおよびステータスバッファに、データパケットおよびデータサイズ(またはフラグ)を格納する。   When receiving the IRQ handshake packet, the USB controller 310 stores the IRQ handshake packet transmission / reception flag “ON” in the status buffer 311b. At this time, the USB controller 310 stores nothing in the data buffer 311a paired with the status buffer 311b. As described above, the USB controller 310 stores the data packet and the data size (or flag) in the data buffer and the status buffer of the buffer set including one or a plurality of sets according to the received data packet or the IRQ handshake packet.

USBコントローラ310は、複数組備えるバッファセットをシーケンシャルに解析する。そして、ステータスバッファ311bに「0」より大きいサイズが格納される場合、そのステータスバッファ311bの組となるデータバッファ311aに格納されるデータパケットを、メインメモリ330にDMA転送する指示を、DMAコントローラ320に供給する。DMAコントローラ320は、上記指示に応じて、データパケットをメインメモリ330にDMA転送する。   The USB controller 310 sequentially analyzes a plurality of buffer sets. When a size larger than “0” is stored in the status buffer 311b, an instruction to DMA transfer the data packet stored in the data buffer 311a that is a set of the status buffer 311b to the main memory 330 is sent to the DMA controller 320. To supply. The DMA controller 320 DMA-transfers the data packet to the main memory 330 in response to the instruction.

一方、USBコントローラ310は、バッファセットをシーケンシャルに解析した結果、ステータスバッファ311bにIRQハンドシェイクパケット送受信フラグ「オン」が格納される場合、CPU340に対して転送終了割り込み信号を供給する。CPU340は、転送終了割り込み信号を受けると、割り込みハンドラをコールすると共に、転送されたデータを用いてメインメモリ330にて処理を行う。   On the other hand, if the IRQ handshake packet transmission / reception flag “ON” is stored in the status buffer 311b as a result of the sequential analysis of the buffer set, the USB controller 310 supplies a transfer end interrupt signal to the CPU 340. Upon receiving the transfer end interrupt signal, the CPU 340 calls an interrupt handler and performs processing in the main memory 330 using the transferred data.

次に、デバイス装置300がホスト装置200にデータパケットを送信する動作について説明する。デバイス装置300のCPU340は、実行中のコンピュータプログラムからのデータの転送設定開始を示すトリガに応じて、USBコントローラ310にデータの転送設定を指示すると共に、DMAコントローラ320にDMA転送を指示する。DMAコントローラ320は、DMA転送の指示に応じて、メインメモリ330に格納されるデータを、転送可能なサイズのパケット単位でデータバッファ311aにDMA転送する。このとき、DMAコントローラ320は、データバッファ311aに格納したデータのサイズを、データバッファ311bに格納する。また、CPU340は、実行中のコンピュータプログラムから割り込みを発生させるトリガを読み出すと、ステータスバッファ311bにIRQハンドシェイクパケット送受信フラグ「オン」を格納する。   Next, an operation in which the device apparatus 300 transmits a data packet to the host apparatus 200 will be described. The CPU 340 of the device apparatus 300 instructs the USB controller 310 to set data transfer and instructs the DMA controller 320 to perform DMA transfer in response to a trigger indicating the start of data transfer setting from the computer program being executed. In response to the DMA transfer instruction, the DMA controller 320 DMA-transfers the data stored in the main memory 330 to the data buffer 311a in units of packets having a transferable size. At this time, the DMA controller 320 stores the size of the data stored in the data buffer 311a in the data buffer 311b. When the CPU 340 reads a trigger for generating an interrupt from the computer program being executed, the CPU 340 stores the IRQ handshake packet transmission / reception flag “ON” in the status buffer 311b.

USBコントローラ310は、ホスト装置200のUSBコントローラ210からINACKパケットを受信すると、複数組備えるバッファセットをシーケンシャルに解析する。INACKパケットは、データの転送要求を示す情報である。そして、USBコントローラ310は、ステータスバッファ311bに「0」より大きいサイズが格納される場合は、そのステータスバッファ311bに対応するデータバッファ311aに格納されるデータパケットをホスト装置200に送信する。一方、USBコントローラ310は、ステータスバッファ311bにIRQハンドシェイクパケット送受信フラグ「オン」が格納される場合、IRQハンドシェイクパケットをホスト装置200に送信する。   When receiving the INACK packet from the USB controller 210 of the host device 200, the USB controller 310 sequentially analyzes a plurality of buffer sets. The INACK packet is information indicating a data transfer request. If the size larger than “0” is stored in the status buffer 311b, the USB controller 310 transmits a data packet stored in the data buffer 311a corresponding to the status buffer 311b to the host device 200. On the other hand, when the IRQ handshake packet transmission / reception flag “ON” is stored in the status buffer 311 b, the USB controller 310 transmits an IRQ handshake packet to the host device 200.

なお、USBコントローラ310は、ホスト装置200のUSBコントローラ210からINACKパケットを受信した際に、データの転送設定を完了していない場合、USBの仕様に従ってNAKパケットをホスト装置200に送信する。ホスト装置200は、NAKパケットを受信すると、再びINACKパケットをデバイス装置300に送信する。この手順を繰り返すことにより、ホスト装置200は、デバイス装置300における転送設定が完了するのを待機する。   When the USB controller 310 does not complete the data transfer setting when receiving the INACK packet from the USB controller 210 of the host device 200, the USB controller 310 transmits a NAK packet to the host device 200 according to the USB specification. When receiving the NAK packet, the host device 200 transmits an INACK packet to the device device 300 again. By repeating this procedure, the host device 200 waits for completion of transfer setting in the device device 300.

次に、ホスト装置200がデバイス装置300からデータを受信する動作について説明する。ホスト装置200は、まず、USBコントローラ210からINACKパケットを送信する。INACKパケットは、データの転送要求を示す情報である。INACKパケットに応じて、USBコントローラ210は、デバイス装置300からデータパケットを受信すると、受信したデータパケットをデータバッファ211aに格納すると共に、そのデータパケットのサイズをステータスバッファ211bに格納する。   Next, an operation in which the host apparatus 200 receives data from the device apparatus 300 will be described. First, the host device 200 transmits an INACK packet from the USB controller 210. The INACK packet is information indicating a data transfer request. In response to the INACK packet, when the USB controller 210 receives a data packet from the device apparatus 300, the USB controller 210 stores the received data packet in the data buffer 211a and stores the size of the data packet in the status buffer 211b.

一方、USBコントローラ210は、デバイス装置300からIRQハンドシェイクパケットを受信した場合、ステータスバッファ211bに、IRQハンドシェイクパケット送受信フラグ「オン」を格納する。このとき、USBコントローラ210は、ステータスバッファ211bの組となるデータバッファ211aには何も格納しない。USBコントローラ210は、このように、受信したデータパケットまたはIRQハンドシェイクパケットに応じて、データバッファおよびステータスバッファに、データおよびデータサイズ(またはフラグ)を格納する。   On the other hand, when the USB controller 210 receives the IRQ handshake packet from the device device 300, the USB controller 210 stores the IRQ handshake packet transmission / reception flag “ON” in the status buffer 211b. At this time, the USB controller 210 stores nothing in the data buffer 211a which is a set of the status buffer 211b. As described above, the USB controller 210 stores the data and the data size (or flag) in the data buffer and the status buffer according to the received data packet or the IRQ handshake packet.

USBコントローラ210は、複数組備えるバッファセットをシーケンシャルに解析する。そして、ステータスバッファ211bに「0」より大きいサイズが格納される場合は、そのステータスバッファ211bの組となるデータバッファ211aに格納されるデータをメインメモリ230にDMA転送する指示を、DMAコントローラ220に送出する。DMAコントローラ220は、上記指示に応じて、データバッファ211aに格納されるデータをメインメモリ230にDMA転送する。   The USB controller 210 sequentially analyzes a plurality of buffer sets. If a size larger than “0” is stored in the status buffer 211b, the DMA controller 220 is instructed to DMA transfer the data stored in the data buffer 211a, which is a set of the status buffer 211b, to the main memory 230. Send it out. The DMA controller 220 DMA-transfers the data stored in the data buffer 211a to the main memory 230 in response to the instruction.

一方、USBコントローラ210は、バッファセットをシーケンシャルに解析した結果、ステータスバッファ2にIRQハンドシェイクパケット送受信フラグ「オン」が格納される場合、CPU240に対して転送終了割り込み信号を供給する。CPU240は、転送終了割り込み信号を受けると、割り込みハンドラをコールすると共に、転送されたデータを用いてメインメモリ230にて処理を行う。   On the other hand, if the IRQ handshake packet transmission / reception flag “ON” is stored in the status buffer 2 as a result of the sequential analysis of the buffer set, the USB controller 210 supplies a transfer end interrupt signal to the CPU 240. Upon receiving the transfer end interrupt signal, the CPU 240 calls an interrupt handler and performs processing in the main memory 230 using the transferred data.

次に、ホスト装置200がデバイス装置300にデータを送信する動作について説明する。CPU240は、実行中のコンピュータプログラムからデータの送信指示に応じて、USBコントローラ210にデータ送信を指示すると共に、DMAコントローラ220にDMA転送を指示する。DMAコントローラ220は、DMA転送指示に応じて、メインメモリ230に格納されるデータを、転送可能なサイズのパケット単位でデータバッファ211aにDMA転送する。このとき、DMAコントローラ220は、データバッファ211aに格納したデータのサイズを、組となるステータスバッファ211bに格納する。また、CPU240は、実行中のコンピュータプログラムからの割り込みを発生させるトリガを読み出すと、ステータスバッファ211bにIRQハンドシェイクパケット送受信フラグ「オン」を格納する。   Next, an operation in which the host apparatus 200 transmits data to the device apparatus 300 will be described. The CPU 240 instructs the USB controller 210 to transmit data and instructs the DMA controller 220 to perform DMA transfer in response to a data transmission instruction from the computer program being executed. In response to the DMA transfer instruction, the DMA controller 220 DMA-transfers the data stored in the main memory 230 to the data buffer 211a in units of packets having a transferable size. At this time, the DMA controller 220 stores the size of the data stored in the data buffer 211a in the status buffer 211b as a pair. Further, when the CPU 240 reads a trigger that generates an interrupt from the computer program being executed, the CPU 240 stores the IRQ handshake packet transmission / reception flag “ON” in the status buffer 211b.

USBコントローラ210は、複数組備えるバッファセットをシーケンシャルに解析する。そして、ステータスバッファ211bに「0」より大きいサイズが格納される場合は、そのステータスバッファ211bの組となるデータバッファ211aに格納されるデータをデバイス装置300に送信する。一方、USBコントローラ210は、ステータスバッファ211aにIRQハンドシェイクパケット送受信フラグ「オン」が格納される場合、IRQハンドシェイクパケットをデバイス装置300に送信する。   The USB controller 210 sequentially analyzes a plurality of buffer sets. When a size larger than “0” is stored in the status buffer 211b, the data stored in the data buffer 211a that is a set of the status buffer 211b is transmitted to the device device 300. On the other hand, when the IRQ handshake packet transmission / reception flag “ON” is stored in the status buffer 211 a, the USB controller 210 transmits an IRQ handshake packet to the device device 300.

以上のように、ホスト装置200とデバイス装置300は、それぞれ送受信したデータパケットまたはIRQハンドシェイクパケットに応じた動作を行う。   As described above, the host device 200 and the device device 300 perform operations according to the transmitted / received data packets or IRQ handshake packets, respectively.

次に、ホスト装置200およびデバイス装置300との間のデータ送受信の動作について、図2に示すフローチャートを参照して説明する。図2は、ホスト装置200がデバイス装置300からデータを受信するIN転送を実施する際の動作について説明するフローチャートである。   Next, the data transmission / reception operation between the host apparatus 200 and the device apparatus 300 will be described with reference to the flowchart shown in FIG. FIG. 2 is a flowchart illustrating an operation when the host apparatus 200 performs IN transfer in which data is received from the device apparatus 300.

図2に示すように、ホスト装置200のCPU240は、実行中のコンピュータプログラムからのデータの転送開始を示すトリガに応じて、USBコントローラ210に対して、デバイス装置300に対する転送開始指示を送る(S401)。すなわち、USBコントローラ210は、デバイス装置300にINACKパケットを送信することを指示する。USBコントローラ210は、上記指示に応じて、INACKパケットをデバイス装置300に送信する。   As shown in FIG. 2, the CPU 240 of the host device 200 sends a transfer start instruction to the device device 300 to the USB controller 210 in response to a trigger indicating the start of data transfer from the computer program being executed (S401). ). That is, the USB controller 210 instructs the device device 300 to transmit an INACK packet. The USB controller 210 transmits an INACK packet to the device device 300 in response to the instruction.

デバイス装置300は、受信したINACKパケットに応じて、USBコントローラ310のデータバッファ311aまたはステータスバッファ311bに格納されるデータパケットまたはIRQハンドシェイクパケットをUSBコントローラ210に送信する。   In response to the received INACK packet, the device device 300 transmits a data packet or an IRQ handshake packet stored in the data buffer 311a or the status buffer 311b of the USB controller 310 to the USB controller 210.

USBコントローラ210は、デバイス装置300から送信されたパケットを受信する(S402)。USBコントローラ210は、上述したように、受信したデータパケットをデータバッファ211aに格納すると共に、格納したデータパケットのサイズをステータスバッファ211bに格納する。USBコントローラ210は、デバイス装置300からIRQハンドシェイクパケットを受信した場合、ステータスバッファ211bにIRQハンドシェイクパケット送受信フラグ「オン」を格納する。   The USB controller 210 receives the packet transmitted from the device device 300 (S402). As described above, the USB controller 210 stores the received data packet in the data buffer 211a and stores the size of the stored data packet in the status buffer 211b. When the USB controller 210 receives an IRQ handshake packet from the device device 300, the USB controller 210 stores an IRQ handshake packet transmission / reception flag “ON” in the status buffer 211 b.

USBコントローラ210は、複数組備えたバッファセットを解析する(S403)。ステータスバッファ211bに「0」より大きいサイズが格納される場合、USBコントローラ210は、そのステータスバッファ211bの組となるデータバッファ211aにデータパケットが格納されると判断する。DMAコントローラ220は、上記データバッファ211aに格納されるデータパケットを、メインメモリ330にDMA転送する(S404)。   The USB controller 210 analyzes a plurality of buffer sets (S403). When a size larger than “0” is stored in the status buffer 211b, the USB controller 210 determines that a data packet is stored in the data buffer 211a that is a set of the status buffer 211b. The DMA controller 220 DMA-transfers the data packet stored in the data buffer 211a to the main memory 330 (S404).

一方、ステータスバッファ211bにIRQハンドシェイクパケット送受信フラグ「オン」が格納される場合、USBコントローラ210は、CPU240に対して転送終了割り込み信号を供給する。CPU240は、転送終了割り込み信号を受けると、割り込みハンドラをコールする(S405)と共に、転送されたデータを用いてメインメモリ230にて処理を行う(S406)。続いて、CPU240は、実行中のコンピュータプログラムからのデータの転送開始を示すトリガに応じて、再びデバイス装置300に転送開始指示を送ってもよい。   On the other hand, when the IRQ handshake packet transmission / reception flag “ON” is stored in the status buffer 211 b, the USB controller 210 supplies a transfer end interrupt signal to the CPU 240. Upon receiving the transfer end interrupt signal, the CPU 240 calls an interrupt handler (S405) and performs processing in the main memory 230 using the transferred data (S406). Subsequently, the CPU 240 may send a transfer start instruction to the device device 300 again in response to a trigger indicating the start of data transfer from the computer program being executed.

以上のように、ホスト装置200は、デバイス装置300から転送されたデータをメインメモリ230に転送すると共に、転送終了に応じてCPU240に転送終了割り込み信号を供給する。   As described above, the host device 200 transfers the data transferred from the device device 300 to the main memory 230 and supplies a transfer end interrupt signal to the CPU 240 when the transfer ends.

なお、図2は、ホスト装置200がデバイス装置300からデータを受信するIN転送の動作を示したが、ホスト装置200がデバイス装置300にデータを送信するOUT転送の際も、同様である。すなわち、デバイス装置300のUSBコントローラ310は、IRQハンドシェイクパケットを受信すると、CPU340に転送割り込み終了信号を供給する。   2 illustrates the IN transfer operation in which the host device 200 receives data from the device device 300, but the same applies to the OUT transfer in which the host device 200 transmits data to the device device 300. That is, when receiving the IRQ handshake packet, the USB controller 310 of the device apparatus 300 supplies a transfer interrupt end signal to the CPU 340.

図3および図4は、転送終了割り込み信号が発生するタイミングを模式的に説明する図である。図3は、上記特許文献1に記載されるようなショートパケットを受信したことを転送終了のトリガとする場合の転送終了割り込みのタイミングを示す図である。図4は、本第1の実施形態に係るUSB転送システム100における転送終了割り込みのタイミングを示す図である。   3 and 4 are diagrams schematically illustrating the timing at which the transfer end interrupt signal is generated. FIG. 3 is a diagram showing the timing of a transfer end interrupt when receiving a short packet as described in Patent Document 1 is used as a transfer end trigger. FIG. 4 is a diagram showing a transfer end interrupt timing in the USB transfer system 100 according to the first embodiment.

図4に示すように、本第1の実施形態に係るUSB転送システム100では、IRQハンドシェイクパケットを受信したことに応じてUSBコントローラ210がCPU240に転送終了割り込み信号を供給する。したがって、本第1の実施形態に係るUSB転送システム100では、図3に示すようなショートパケットを受信したことを転送終了のトリガとする場合よりも、割り込みの発生回数が削減される。   As shown in FIG. 4, in the USB transfer system 100 according to the first embodiment, the USB controller 210 supplies a transfer end interrupt signal to the CPU 240 in response to receiving the IRQ handshake packet. Therefore, in the USB transfer system 100 according to the first embodiment, the number of occurrences of interrupts is reduced as compared to the case where the reception of a short packet as shown in FIG.

以上のように、本第1の実施形態によれば、ホスト装置200およびデバイス装置300のUSBコントローラ210、310は、1または複数組のバッファセットを備え、対向装置からIRQハンドシェイクパケットを受信すると、ステータスバッファ211b、311bにIRQハンドシェイクパケット送受信フラグ「オン」を格納する。USBコントローラ210、310は、このフラグ「オン」に応じて、CPU240、340に転送終了割り込み信号を供給する。   As described above, according to the first embodiment, when the USB controllers 210 and 310 of the host device 200 and the device device 300 include one or a plurality of buffer sets and receive an IRQ handshake packet from the opposite device. The IRQ handshake packet transmission / reception flag “ON” is stored in the status buffers 211b and 311b. The USB controllers 210 and 310 supply a transfer end interrupt signal to the CPUs 240 and 340 in response to the flag “on”.

上記構成を採用することにより、本第1の実施形態によれば、CPU240、340に対する転送終了割り込みの発生回数を削減することができるので、CPU処理を削減できると共に、装置間におけるデータ転送の性能を向上させることができるという効果が得られる。また、マルチコアプロセッサ等のハードウエアの実装は不要であるので、コストの増加を抑えながら、装置間におけるデータ転送の性能を向上させることができるという効果が得られる。   By adopting the above configuration, according to the first embodiment, the number of occurrences of transfer end interrupts to the CPUs 240 and 340 can be reduced, so that the CPU processing can be reduced and the performance of data transfer between devices can be reduced. The effect that can be improved is obtained. In addition, since it is not necessary to mount hardware such as a multi-core processor, it is possible to improve the performance of data transfer between devices while suppressing an increase in cost.

第2の実施形態
次に、上述した第1の実施形態を基礎とする第2の実施形態について説明する。以下の説明では、第1の実施形態と同様の構成については同じ参照番号を付与することにより、重複する説明は省略する。
Second Embodiment Next, a second embodiment based on the above-described first embodiment will be described. In the following description, the same reference numerals are assigned to the same configurations as those in the first embodiment, and duplicate descriptions are omitted.

第2の実施形態では、上記第1の実施形態において説明したホスト装置200およびデバイス装置300が備えるUSBコントローラ210、310が、2つの割り込みモードを有する構成について説明する。すなわち、USBコントローラ210、310は、ショートパケットの受信に応じてCPU240、340に転送終了割り込み信号を供給するショートパケットモードと、第1の実施形態において説明したIRQハンドシェイクパケットの受信に応じてCPU240、340に転送終了割り込み信号を供給するIRQモードとを有する。   In the second embodiment, a configuration in which the USB controllers 210 and 310 included in the host device 200 and the device device 300 described in the first embodiment have two interrupt modes will be described. That is, the USB controllers 210 and 310 receive the short packet mode in which a transfer end interrupt signal is supplied to the CPUs 240 and 340 in response to reception of the short packet, and the CPU 240 in response to reception of the IRQ handshake packet described in the first embodiment. 340 has an IRQ mode for supplying a transfer end interrupt signal.

USBコントローラ210、310は、USB転送システム100の起動の際にはショートパケットモードであり、互いに以下のようにネゴシエーションに成功すると、IRQモードに移行する。   The USB controllers 210 and 310 are in the short packet mode when the USB transfer system 100 is activated, and shift to the IRQ mode when the negotiation is successful as follows.

図5は、USBコントローラ210、310が、互いにネゴシエーションに成功すると共に、ショートパケットモードからIRQモードに移行する動作について説明する図である。図5に示すように、USB転送システム100が起動すると、ホスト装置200のUSBコントローラ210は、IRQ_ENABLEハンドシェイクパケットをデバイス装置300に送信する。IRQ_ENABLEハンドシェイクパケットは、IRQハンドシェイクパケットに対応する機能の有無を問い合わせる情報である。IRQハンドシェイクパケットに対応する機能とは、対向装置に、転送終了割り込みを発生するためにIRQハンドシェイクパケットを送信する機能、およびIRQハンドシェイクパケットを受信するとCPUに転送終了割り込み信号を供給する機能である。   FIG. 5 is a diagram illustrating an operation in which the USB controllers 210 and 310 succeed in negotiation with each other and shift from the short packet mode to the IRQ mode. As illustrated in FIG. 5, when the USB transfer system 100 is activated, the USB controller 210 of the host device 200 transmits an IRQ_ENABLE handshake packet to the device device 300. The IRQ_ENABLE handshake packet is information for inquiring whether there is a function corresponding to the IRQ handshake packet. The function corresponding to the IRQ handshake packet is a function of transmitting an IRQ handshake packet to the opposite device to generate a transfer end interrupt, and a function of supplying a transfer end interrupt signal to the CPU when the IRQ handshake packet is received. It is.

デバイス装置300のUSBコントローラ310は、IRQ_ENABLEハンドシェイクパケットを受信すると、それをステータスバッファ311bに格納する。USBコントローラ310は、ステータスバッファ311bを解析し、IRQ_ENABLEハンドシェイクパケットが格納される場合は、その応答としてIRQ_ACKハンドシェイクパケットをホスト装置200に送信する。ホスト装置200のUSBコントローラ210は、初期化処理のためのSetAddressリクエストをUSBコントローラ310に送信する。   Upon receiving the IRQ_ENABLE handshake packet, the USB controller 310 of the device apparatus 300 stores it in the status buffer 311b. The USB controller 310 analyzes the status buffer 311b, and when an IRQ_ENABLE handshake packet is stored, transmits an IRQ_ACK handshake packet to the host device 200 as a response. The USB controller 210 of the host device 200 transmits a SetAddress request for initialization processing to the USB controller 310.

デバイス装置300のUSBコントローラ310は、IRQ_ENABLEハンドシェイクパケットの受信に応じてIRQモードに移行する。ホスト装置200のUSBコントローラ210は、IRQ_ACKハンドシェイクパケットの受信に応じてIRQモードに移行する。以上のように、ホスト装置200とデバイス装置300は、共にIRQハンドシェイクパケットに対応する機能を有する場合、ショートパケットモードからIRQモードに移行することができる。   The USB controller 310 of the device apparatus 300 shifts to the IRQ mode in response to reception of the IRQ_ENABLE handshake packet. The USB controller 210 of the host device 200 shifts to the IRQ mode in response to receiving the IRQ_ACK handshake packet. As described above, when both the host apparatus 200 and the device apparatus 300 have a function corresponding to the IRQ handshake packet, the host apparatus 200 and the device apparatus 300 can shift from the short packet mode to the IRQ mode.

図6は、USBコントローラ210、310との間でネゴシエーションが成立せず、IRQモードに移行しない動作の例について説明する図である。図6に示す例では、ホスト装置200のUSBコントローラ210は、IRQハンドシェイクパケットに対応する機能を有するが、デバイス装置300のUSBコントローラ310は当該機能を有しない場合について説明する。   FIG. 6 is a diagram for explaining an example of an operation in which the negotiation with the USB controllers 210 and 310 is not established and the mode is not shifted to the IRQ mode. In the example shown in FIG. 6, the USB controller 210 of the host device 200 has a function corresponding to the IRQ handshake packet, but the USB controller 310 of the device device 300 will not be described.

ホスト装置200のUSBコントローラ210は、IRQ_ENABLEハンドシェイクパケットをデバイス装置300のUSBコントローラ310に送信する。USBコントローラ310は、IRQハンドシェイクパケットに対応する機能を有していないので、IRQ_ENABLEハンドシェイクパケットに応答しない。   The USB controller 210 of the host device 200 transmits an IRQ_ENABLE handshake packet to the USB controller 310 of the device device 300. The USB controller 310 does not respond to the IRQ_ENABLE handshake packet because it does not have a function corresponding to the IRQ handshake packet.

ホスト装置200のUSBコントローラ210は、一定時間IRQ_ACKハンドシェイクパケットを受信できない場合、USBコントローラ310はIRQハンドシェイクパケットに対応する機能を有しないと判断する。そして、USBコントローラ210は、ショートパケットモードにて、初期化処理のためのSetAddressリクエストをUSBコントローラ310に送信する。   If the USB controller 210 of the host device 200 cannot receive the IRQ_ACK handshake packet for a certain period of time, it determines that the USB controller 310 does not have a function corresponding to the IRQ handshake packet. Then, the USB controller 210 transmits a SetAddress request for initialization processing to the USB controller 310 in the short packet mode.

このように、USBコントローラ310がIRQハンドシェイクパケットに対応する機能を有しない場合でも、USB転送システム100は、ショートパケットに応じてCPUへの転送終了割り込み信号を供給することができる。   Thus, even when the USB controller 310 does not have a function corresponding to the IRQ handshake packet, the USB transfer system 100 can supply a transfer end interrupt signal to the CPU in response to the short packet.

図7は、USBコントローラ210、310との間でネゴシエーションが成立せず、IRQモードに移行しない動作の他の例について説明する図である。図7に示す例では、デバイス装置300のUSBコントローラ310は、IRQハンドシェイクパケットに対応する機能を有するが、ホスト装置200のUSBコントローラ210は当該機能を有しない場合について説明する。   FIG. 7 is a diagram for explaining another example of the operation that does not establish negotiation with the USB controllers 210 and 310 and does not shift to the IRQ mode. In the example illustrated in FIG. 7, the USB controller 310 of the device apparatus 300 has a function corresponding to the IRQ handshake packet, but the USB controller 210 of the host apparatus 200 does not have the function.

ホスト装置200のUSBコントローラ210は、IRQハンドシェイクパケットに対応する機能を有しないので、IRQ_ENABLEハンドシェイクパケットを送信せず、初期化処理のためのSetAddressリクエストをUSBコントローラ310に送信する。USBコントローラ210とUSBコントローラ310は、互いにショートパケットモードで動作する。   Since the USB controller 210 of the host device 200 does not have a function corresponding to the IRQ handshake packet, the USB controller 210 does not transmit the IRQ_ENABLE handshake packet, but transmits a SetAddress request for initialization processing to the USB controller 310. The USB controller 210 and the USB controller 310 operate in the short packet mode.

このように、USBコントローラ210がIRQハンドシェイクパケットに対応する機能を有しない場合でも、USB転送システム100は、ショートパケットに応じてCPUへの転送終了割り込み信号を供給することができる。   Thus, even when the USB controller 210 does not have a function corresponding to the IRQ handshake packet, the USB transfer system 100 can supply a transfer end interrupt signal to the CPU in response to the short packet.

以上のように、本第2の実施形態によれば、USBコントローラ210とUSBコントローラ310は、CPU240、340への転送終了割り込みに関し、ショートパケットモードとIRQモードとを有する。USBコントローラ210とUSBコントローラ310は、互いにIRQ_ENABLEハンドシェイクパケットおよびIRQ_ACKハンドシェイクパケットを介してネゴシエーションが成立すると、ショートパケットモードからIRQモードに移行する。また、上記ネゴシエーションが成立しない場合、USBコントローラ210とUSBコントローラ310は、ショートパケットの受信に応じてCPUへの転送終了割り込み信号を供給する。   As described above, according to the second embodiment, the USB controller 210 and the USB controller 310 have a short packet mode and an IRQ mode with respect to a transfer end interrupt to the CPUs 240 and 340. When negotiation is established through the IRQ_ENABLE handshake packet and the IRQ_ACK handshake packet, the USB controller 210 and the USB controller 310 shift from the short packet mode to the IRQ mode. When the negotiation is not established, the USB controller 210 and the USB controller 310 supply a transfer end interrupt signal to the CPU in response to reception of the short packet.

上記構成を採用することにより、本第2の実施形態によれば、USB転送システム100において、ホスト装置200およびデバイス装置300のいずれかがIRQハンドシェイクパケットに対応する機能を有さない場合でも、ショートパケットの受信に基づいて転送終了割り込みをすることで互いにUSB転送を実施できるので、高い汎用性を有するという効果が得られる。   By adopting the above configuration, according to the second embodiment, in the USB transfer system 100, even when either the host device 200 or the device device 300 does not have a function corresponding to the IRQ handshake packet, Since USB transfer can be performed mutually by performing a transfer end interrupt based on reception of a short packet, an effect of having high versatility can be obtained.

第3の実施形態
上記実施形態を包含する本発明の第3の実施形態について説明する。図8は、本発明の第3の実施形態に係るUSB転送装置500の構成を示すブロック図である。USB転送装置500は、プロセッサ510とUSBコントローラ520とを備える。
Third Embodiment A third embodiment of the present invention including the above embodiment will be described. FIG. 8 is a block diagram showing a configuration of a USB transfer device 500 according to the third embodiment of the present invention. The USB transfer device 500 includes a processor 510 and a USB controller 520.

プロセッサ510は、自装置を制御する。USBコントローラ520は、伝送手段を介して接続される対向装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくともデータバッファに格納したデータパケットのサイズおよびデータの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有する。   The processor 510 controls its own device. The USB controller 520 includes a data buffer that stores a data packet, which is a unit capable of transferring data to be transferred by USB to an opposite device connected via a transmission unit, and at least the size of the data packet stored in the data buffer and And a buffer set including a status buffer for storing any information indicating the end of data transfer.

USBコントローラ520は、ステータスバッファに転送終了を示す情報が格納される場合、プロセッサに転送終了割り込み信号を供給する。   When information indicating the end of transfer is stored in the status buffer, the USB controller 520 supplies a transfer end interrupt signal to the processor.

上記構成を採用することにより、本第3の実施形態によれば、転送終了を示す情報に基づいてプロセッサに転送終了割り込み信号を供給するので、コストの増加を抑えながら、装置間におけるデータ転送の性能を向上させることができるという効果が得られる。   By adopting the above configuration, according to the third embodiment, since the transfer end interrupt signal is supplied to the processor based on the information indicating the transfer end, the data transfer between the devices can be suppressed while suppressing the increase in cost. The effect that performance can be improved is acquired.

100 USB転送システム
200 ホスト装置
210、310、520 USBコントローラ
211a、212a、311a、312a データバッファ
211b、212b、311b、312b ステータスバッファ
220、320 DMAコントローラ
230、330 メインメモリ
240、340 CPU
250、350 記録媒体
260 USB伝送部
300 デバイス装置
500 USB転送装置
510 プロセッサ
100 USB transfer system 200 Host device 210, 310, 520 USB controller 211a, 212a, 311a, 312a Data buffer 211b, 212b, 311b, 312b Status buffer 220, 320 DMA controller 230, 330 Main memory 240, 340 CPU
250, 350 Recording medium 260 USB transmission unit 300 Device device 500 USB transfer device 510 Processor

Claims (7)

自装置を制御するプロセッサと、
伝送手段を介して接続される対向装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくとも前記データバッファに格納したデータパケットのサイズおよび前記データの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有するUSBコントローラとを備え、
前記USBコントローラは、
前記ステータスバッファに前記転送終了を示す情報が格納される場合、前記プロセッサに転送終了割り込み信号を供給する
USB転送装置。
A processor that controls the device;
A data buffer for storing a data packet, which is a unit capable of transferring data to be transferred by USB to an opposite device connected via a transmission means, and at least the size of the data packet stored in the data buffer and the transfer of the data A USB controller having a buffer set including a status buffer for storing any of information indicating termination,
The USB controller
A USB transfer device that supplies a transfer end interrupt signal to the processor when information indicating the transfer end is stored in the status buffer.
前記USBコントローラは、
前記対向装置から前記データパケットを受信した場合、当該データパケットを前記バッファセットに含まれる前記データバッファに格納すると共に、当該データパケットのサイズを前記ステータスバッファに格納し、前記データの転送終了を示す情報を受信した場合、前記データバッファに前記データパケットを格納せず、前記ステータスバッファに当該データの転送終了を示す情報を格納する
請求項1記載のUSB転送装置。
The USB controller
When the data packet is received from the opposite device, the data packet is stored in the data buffer included in the buffer set, and the size of the data packet is stored in the status buffer, indicating the end of the data transfer 2. The USB transfer device according to claim 1, wherein when the information is received, the data packet is not stored in the data buffer, but information indicating the end of transfer of the data is stored in the status buffer.
前記プロセッサが前記データを用いた処理に使用するメインメモリと、
前記データバッファから前記メインメモリへの前記データの転送を制御する転送コントローラとをさらに備え、
前記USBコントローラは、
前記ステータスバッファに前記データパケットのサイズが格納される場合、前記データバッファに格納される前記データパケットを、前記メインメモリに転送することを、前記転送コントローラに指示し、
前記転送コントローラは、前記指示に応じて、前記データパケットを前記メインメモリに転送する
請求項1または請求項2記載のUSB転送装置。
A main memory used by the processor for processing using the data;
A transfer controller for controlling transfer of the data from the data buffer to the main memory;
The USB controller
When the size of the data packet is stored in the status buffer, the transfer controller is instructed to transfer the data packet stored in the data buffer to the main memory;
The USB transfer device according to claim 1, wherein the transfer controller transfers the data packet to the main memory according to the instruction.
前記USBコントローラは、
前記対向装置から送信される前記転送終了を示す情報、または所定のサイズより小さいサイズを有するショートパケットに応じて、前記プロセッサに転送終了割り込み信号を供給する
請求項1ないし請求項3のいずれか1項記載のUSB転送装置。
The USB controller
4. The transfer end interrupt signal is supplied to the processor in response to information indicating the end of transfer transmitted from the opposite apparatus or a short packet having a size smaller than a predetermined size. 5. The USB transfer device according to the item.
前記USBコントローラは、
前記対向装置に、前記転送終了を示す情報に応じて前記プロセッサに転送終了割り込み信号を供給する機能の有無を問い合わせ、有を示す応答を受けた場合に、前記転送終了を示す情報に応じて前記プロセッサに転送終了割り込み信号を供給し、有を示す応答を受けない場合に、前記ショートパケットに応じて、前記プロセッサに転送終了割り込み信号を供給する
請求項4記載のUSB転送装置。
The USB controller
The counter device is inquired about the presence or absence of a function for supplying a transfer end interrupt signal to the processor according to information indicating the end of transfer, and when a response indicating presence is received, according to the information indicating the end of transfer The USB transfer device according to claim 4, wherein a transfer end interrupt signal is supplied to the processor in response to the short packet when a transfer end interrupt signal is supplied to the processor and no response indicating yes is received.
請求項1ないし請求項5のいずれか1項記載のUSB転送装置であるホスト装置と、
前記ホスト装置と伝送手段を介して接続され、請求項1ないし請求項5のいずれか1項記載のUSB転送装置であるデバイス装置と
を備えたUSB転送システム。
A host device which is a USB transfer device according to any one of claims 1 to 5,
A USB transfer system comprising: a device device that is connected to the host device via a transmission unit and is a USB transfer device according to any one of claims 1 to 5.
伝送手段を介して接続される対向装置との間でUSB転送するデータの転送可能な単位であるデータパケットを格納するデータバッファと、少なくとも前記データバッファに格納したデータパケットのサイズおよび前記データの転送終了を示す情報のいずれかを格納するステータスバッファとを含むバッファセットを有するUSBコントローラは、
前記ステータスバッファに前記転送終了を示す情報が格納される場合、自装置を制御するプロセッサに転送終了割り込み信号を供給する
USB転送方法。
A data buffer for storing a data packet, which is a unit capable of transferring data to be transferred by USB to an opposite device connected via a transmission means, and at least the size of the data packet stored in the data buffer and the transfer of the data A USB controller having a buffer set including a status buffer for storing any of the information indicating termination,
A USB transfer method for supplying a transfer end interrupt signal to a processor that controls the device when information indicating the end of transfer is stored in the status buffer.
JP2014159112A 2014-08-05 2014-08-05 USB transfer device, USB transfer system and USB transfer method Active JP6542513B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014159112A JP6542513B2 (en) 2014-08-05 2014-08-05 USB transfer device, USB transfer system and USB transfer method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014159112A JP6542513B2 (en) 2014-08-05 2014-08-05 USB transfer device, USB transfer system and USB transfer method

Publications (2)

Publication Number Publication Date
JP2016035721A true JP2016035721A (en) 2016-03-17
JP6542513B2 JP6542513B2 (en) 2019-07-10

Family

ID=55523523

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014159112A Active JP6542513B2 (en) 2014-08-05 2014-08-05 USB transfer device, USB transfer system and USB transfer method

Country Status (1)

Country Link
JP (1) JP6542513B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003308290A (en) * 2002-04-12 2003-10-31 Kawasaki Microelectronics Kk Data receiver
JP2004133537A (en) * 2002-10-08 2004-04-30 Canon Inc Data transfer method, data transfer device, printing method, printer, control program for data transfer device, and storage medium
JP2005182505A (en) * 2003-12-19 2005-07-07 Kyocera Mita Corp Data transfer controller and image forming apparatus
JP2008158572A (en) * 2006-12-20 2008-07-10 Canon Inc Data storage device
JP2010072888A (en) * 2008-09-18 2010-04-02 Nec Engineering Ltd Dma transfer control system
JP2011138284A (en) * 2009-12-28 2011-07-14 Brother Industries Ltd Display device and program for the same
JP2014052981A (en) * 2012-09-10 2014-03-20 Renesas Electronics Corp Usb peripheral device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003308290A (en) * 2002-04-12 2003-10-31 Kawasaki Microelectronics Kk Data receiver
JP2004133537A (en) * 2002-10-08 2004-04-30 Canon Inc Data transfer method, data transfer device, printing method, printer, control program for data transfer device, and storage medium
JP2005182505A (en) * 2003-12-19 2005-07-07 Kyocera Mita Corp Data transfer controller and image forming apparatus
JP2008158572A (en) * 2006-12-20 2008-07-10 Canon Inc Data storage device
JP2010072888A (en) * 2008-09-18 2010-04-02 Nec Engineering Ltd Dma transfer control system
JP2011138284A (en) * 2009-12-28 2011-07-14 Brother Industries Ltd Display device and program for the same
JP2014052981A (en) * 2012-09-10 2014-03-20 Renesas Electronics Corp Usb peripheral device

Also Published As

Publication number Publication date
JP6542513B2 (en) 2019-07-10

Similar Documents

Publication Publication Date Title
US10248610B2 (en) Enforcing transaction order in peer-to-peer interactions
WO2016127552A1 (en) Direct memory access (dma) controller and data transmission method
US10990549B2 (en) Methods and devices for extending USB 3.0—compliant communication over an extension medium
JP2012064021A (en) Communication system, master device and slave device, and communication method
US8402180B2 (en) Autonomous multi-packet transfer for universal serial bus
CN110688333A (en) PCIE (peripheral component interface express) -based DMA (direct memory Access) data transmission system and method
US20160077986A1 (en) Electronic apparatus providing real-time switching and sharing of usb electronic devices among hosts
JP6542513B2 (en) USB transfer device, USB transfer system and USB transfer method
JP2008502977A (en) Interrupt method for bus controller
JP4104939B2 (en) Multiprocessor system
US20040230717A1 (en) Processing device
US11709791B2 (en) Techniques for deconflicting USB traffic in an extension environment
CN109992560B (en) Communication method and communication system
US20120246263A1 (en) Data transfer apparatus, data transfer method, and information processing apparatus
TWM494348U (en) Electronic device providing real-time switching and sharing of USB electronic apparatuses among hosts
KR20210006127A (en) Multiprocessor interrupt signal processing device
US10452579B2 (en) Managing input/output core processing via two different bus protocols using remote direct memory access (RDMA) off-loading processing system
WO2022124083A1 (en) Communication device, communication method, and program
TW202029001A (en) Interface adapter circuit
TWI411922B (en) Universal serial bus host controller and method utilizing the same
WO2020182135A1 (en) Communication method and communication system
CN1703686B (en) Direct memory access (DMA) detection
JPH11252150A (en) Network connection device and network connection control method
JP2002288115A (en) Usb controller
KR100290092B1 (en) Device for interfacing input/output bus for processing defer reply signal

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20170710

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170718

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180726

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180821

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181018

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190319

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190510

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190521

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190613

R150 Certificate of patent or registration of utility model

Ref document number: 6542513

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150