JP2007219915A - Sum value communication system for motorola s data - Google Patents
Sum value communication system for motorola s data Download PDFInfo
- Publication number
- JP2007219915A JP2007219915A JP2006040720A JP2006040720A JP2007219915A JP 2007219915 A JP2007219915 A JP 2007219915A JP 2006040720 A JP2006040720 A JP 2006040720A JP 2006040720 A JP2006040720 A JP 2006040720A JP 2007219915 A JP2007219915 A JP 2007219915A
- Authority
- JP
- Japan
- Prior art keywords
- motorola
- data
- sum value
- record
- order
- 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
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Storage Device Security (AREA)
Abstract
Description
本発明は、PCから周辺機器へのモトローラSデータのサム値の通信方式に関する。 The present invention relates to a communication method for the sum value of Motorola S data from a PC to a peripheral device.
はじめに、図5を参照してモトローラSデータについて説明する。 First, the Motorola S data will be described with reference to FIG.
モトローラSデータは、複数のレコードから構成されている。各レコードは、ASCIIコードとCR、LFコードで構成されている。レコードタイプS0レコードは、モトローラSデータの始まりを示すヘッダレコードである。レコードタイプS1〜S3のレコードは、データを格納するデータレコードである。レコードタイプS7〜S9のレコードは、モトローラSデータの終端を示すエンドレコードである。スタートマークは、Sであり、レコードの開始を表す。レコードタイプは、0、1、2、3、7、8、9の何れかであり、レコードの種類を表す。バイトカウントはアドレスからチェックサムまでのバイト数を表す。データは書込みデータである。チェックサムは、バイトカウントからチェックサムの前までのデータ値を16進で加算した結果の1の補数である。 Motorola S data is composed of a plurality of records. Each record is composed of an ASCII code, CR, and LF code. The record type S0 record is a header record indicating the start of Motorola S data. Records of record types S1 to S3 are data records for storing data. Records of record types S7 to S9 are end records indicating the end of Motorola S data. The start mark is S, indicating the start of the record. The record type is one of 0, 1, 2, 3, 7, 8, and 9 and represents the type of record. The byte count represents the number of bytes from the address to the checksum. The data is write data. The checksum is a one's complement of the result of adding the data values from the byte count to the previous checksum in hexadecimal.
前記のように、モトローラSデータは、ヘッダレコードをデータの始めとし、エンドレコードをデータの終わりとすることが規定されている。また、一般的には、各データレコードは、そのアドレス順に整列して、使用されることが多い。しかしながら、各データレコード間の順序関係について特に規定は設けられていない。 As described above, the Motorola S data is specified to have a header record as the start of data and an end record as the end of data. In general, the data records are often used in the order of their addresses. However, there is no specific provision regarding the order relationship between the data records.
次に、周辺機器におけるファームウェアの更新について説明する。 Next, firmware update in the peripheral device will be described.
図8に示すように、周辺機器におけるファームウェアの更新では、PCから周辺機器に対して、モトローラSデータ(書き換え用データ)を送信し、周辺機器が受信したモトローラSデータを、フラッシュROMに書込む方法が一般的に行なわれている。しかしながら、モトローラSデータの送信には、次のような問題が存在する。これを図9により説明する。
(1)データレコードの欠落
周辺機器側では、モトローラSデータの各レコードに存在するチェックサムを使用して、レコード毎のチェックを行うことができる。しかしながら、モトローラSデータ全体についてチェックを行うようになっていないため、通信時に、一部のデータレコードが欠落してしまった場合、これを検出できない。
(2)改竄
送信時に、レコード単位で改竄が行われ、チェックサムもこれに矛盾しないように改竄が行われてしまった場合、レコード毎のチェックサムが正しければ、周辺機器側では、この改竄を検出できない。
As shown in FIG. 8, when updating the firmware in the peripheral device, Motorola S data (data for rewriting) is transmitted from the PC to the peripheral device, and the Motorola S data received by the peripheral device is written in the flash ROM. The method is generally practiced. However, the following problems exist in the transmission of Motorola S data. This will be described with reference to FIG.
(1) Missing data record On the peripheral device side, a check for each record can be performed using a checksum existing in each record of Motorola S data. However, since the entire Motorola S data is not checked, if some data records are lost during communication, this cannot be detected.
(2) When falsification is sent in a record unit and the checksum has been falsified so that it does not contradict this, if the checksum for each record is correct, the peripheral device will perform this falsification. It cannot be detected.
前記問題に対応する一つの方法として、図10に示すように、モトローラSデータと共に専用のコマンド(SVERUPコマンド)を用いて、サム値を送信する方法である(例えば、特許文献1参照。)。周辺機器側では、受信したモトローラSデータをRAM上で展開してROMのイメージを作成し、展開したROMのイメージからサム値を算出する。専用のコマンド(SVERUPコマンド)により受信したサム値と、算出したサム値を比較し、問題がなかった場合にはROMを書き換えるというものである。 As one method for dealing with the above problem, as shown in FIG. 10, a sum value is transmitted by using a dedicated command (SVERUP command) together with Motorola S data (see, for example, Patent Document 1). On the peripheral device side, the received Motorola S data is expanded on the RAM to create a ROM image, and a sum value is calculated from the expanded ROM image. The sum value received by a dedicated command (SVERUP command) is compared with the calculated sum value, and if there is no problem, the ROM is rewritten.
しかしながら、上記の方法では、SVERUPコマンドのように、サム値を送信するための専用コマンドを用意する必要がある。また、専用コマンドでサム値を送信しているので、サム値の所在が、明示的でわかり易くなっている。このため、サム値を改竄することは比較的容易であるという問題がある。 However, in the above method, it is necessary to prepare a dedicated command for transmitting the sum value, such as the SVERUP command. Also, since the sum value is transmitted by a dedicated command, the location of the sum value is clear and easy to understand. For this reason, there is a problem that it is relatively easy to falsify the thumb value.
PCから周辺機器への、モトローラSデータの通信時において、新たに専用コマンドを新設すること無く、比較的発見し難いモトローラSデータのサム値の通信方法を提供することにある。 It is an object of the present invention to provide a method for communicating the sum value of Motorola S data, which is relatively difficult to find, without newly establishing a dedicated command when communicating Motorola S data from a PC to a peripheral device.
PCから周辺機器へのモトローラSデータの送信時において、送信する前記モトローラSデータを所定のブロックに分割し、該ブロック内におけるモトローラSレコードのアドレス順と該モトローラSレコードの送信順の対応関係を符号化する符号化手段と、前記PCから周辺機器への前記モトローラSデータの受信時において、受信した前記モトローラSデータを所定のブロックに分割し、該ブロック内における前記モトローラSレコードの到着順と前記モトローラSレコードのアドレス順の対応関係を復号化する復号化手段とを用いてモトローラSデータのサム値を通信することを特徴とする。 When transmitting the Motorola S data from the PC to the peripheral device, the Motorola S data to be transmitted is divided into predetermined blocks, and the correspondence relationship between the Motorola S record address order and the Motorola S record transmission order in the block is determined. Encoding means for encoding, and upon receiving the Motorola S data from the PC to the peripheral device, the received Motorola S data is divided into predetermined blocks, and the arrival order of the Motorola S records in the block; The sum value of the Motorola S data is communicated using decoding means for decoding the correspondence relationship of the address order of the Motorola S record.
本発明によれば、PCから周辺機器への、モトローラSデータの通信時において、新たに専用コマンドを新設すること無く、比較的発見し難いモトローラSデータのサム値の通信が可能となる。 According to the present invention, when the Motorola S data is communicated from the PC to the peripheral device, it is possible to communicate the Motorola S data, which is relatively difficult to find, without newly creating a dedicated command.
以下に、本発明の実施の形態を図1〜図7にもとづいて説明する。 Hereinafter, embodiments of the present invention will be described with reference to FIGS.
モトローラSデータのサム値の送信処理を、図2を参照して説明する。図2は、PCから周辺機器へのモトローラSデータの送信時における流れを模式的に説明する模式図である。0201はPC、0202は通信ケーブル、0203は周辺機器である。PC0201は、通信ケーブル0202を通して、周辺機器0203と接続している。PC0201では、モトローラSデータにサム値を加えて符号化する。PC0201は、符号化したモトローラSデータを、通信ケーブル0202を通して、周辺機器0203に送信する。周辺機器0203は、通信ケーブル0202を通して符号化したモトローラSデータを受信する。周辺機器0203では、受信した符号化したモトローラSデータを、復号化してサム値を取出す。 A process of transmitting the sum value of the Motorola S data will be described with reference to FIG. FIG. 2 is a schematic diagram for schematically explaining the flow during transmission of Motorola S data from the PC to the peripheral device. Reference numeral 0201 denotes a PC, 0202 denotes a communication cable, and 0203 denotes a peripheral device. The PC 0201 is connected to the peripheral device 0203 through the communication cable 0202. In the PC 0201, the sum value is added to the Motorola S data for encoding. The PC 0201 transmits the encoded Motorola S data to the peripheral device 0203 through the communication cable 0202. The peripheral device 0203 receives the Motorola S data encoded through the communication cable 0202. The peripheral device 0203 decodes the received encoded Motorola S data and extracts the sum value.
次に、サム値を付加して符号化したモトローラSデータの構成について説明する。図3は、サム値を付加して符号化したモトローラSデータの構成を説明するための模式図である。0301はモトローラSデータ、0302はデータレコードの先頭部分、0303はサム値を付加した状態のデータレコードの先頭部分、0304は符号化したモトローラSデータである。モトローラSデータ0301は、ヘッダレコード、データレコード、エンドレコードより構成されている。符号化したモトローラSデータ0304は、通常のモトローラデータと同様に、ヘッダレコード、データレコード、エンドレコードより構成されている。更に、データレコードの先頭部分は、サム値を付加し、符号化された状態(データレコードの先頭部分が並び替えられた状態)となっている。符号化したモトローラSデータ0304は、以下の手順で作成される。
(1)モトローラSデータ0301より、データレコードの先頭部分0302を取出す。
(2)サム値を付加する為、データレコードの先頭部分0302を、
所定のブロックに分け、各ブロック内において、データレコードを並び替え、
サム値を付加した状態のデータレコードの先頭部分0303を得る。
(3)サム値を付加した状態のデータレコードの先頭部分0303を戻し、
符号化したモトローラSデータ0304を得る。
Next, the configuration of Motorola S data encoded by adding a sum value will be described. FIG. 3 is a schematic diagram for explaining the configuration of Motorola S data encoded by adding a sum value.
(1) The head portion 0302 of the data record is extracted from the Motorola S
(2) In order to add the sum value, the head part 0302 of the data record is
Dividing into predetermined blocks, rearrange the data records within each block,
A
(3) Return the leading
Encoded Motorola S data 0304 is obtained.
次に、図1、図4を参照して、モトローラSデータのサム値の符号化/復号化について説明する。図1は、モトローラSデータのサム値の符号化/復号化を説明するための模式図である。0101はモトローラSデータ、0102は符号化したモトローラSデータである。2バイトのサム値AC8AHをモトローラSデータに付加して、符号化する場合について説明する。
Next, encoding / decoding of the sum value of the Motorola S data will be described with reference to FIGS. FIG. 1 is a schematic diagram for explaining the encoding / decoding of the sum value of Motorola S data.
モトローラSデータ0101は、ヘッダレコード、データレコード、エンドレコードから構成される。データレコード部分は、複数のデータレコードより構成されており、各データレコードはそのアドレス順に並んでいる。データレコード部分の先頭に、4つのブロックを作成する。更に、1つのブロックは、4つのレコードで構成する。4つのブロックは、それぞれ、サム値AC8AHの1桁目から4桁目に対応する。
The Motorola S
図4は、16進コードと置換行列の変換のテーブルである。本例では、置換行列を、データレコードの並び替えを表すために使用している。例えば、(1234/2314)は、1番目のレコードを2番目に、2番目のレコードを3番目に、3番目のレコードを1番目に、4番目のレコードを4番目に並び替えることを表す。図4の16進コード→置換行列変換テーブルによると、16進コード‘A’、‘C’、‘8’、‘A’はそれぞれ(1234/2314)、(1234/3124)、(1234/3412)、(1234/2314)に対応する。 FIG. 4 is a table of conversion between hexadecimal codes and permutation matrices. In this example, a permutation matrix is used to represent the reordering of data records. For example, (1234/2314) represents rearranging the first record to the second, the second record to the third, the third record to the first, and the fourth record to the fourth. According to the hexadecimal code → replacement matrix conversion table of FIG. 4, the hexadecimal codes 'A', 'C', '8', and 'A' are (1234/2314), (1234/3124), and (1234/3412), respectively. ), (1234/2314).
これらの置換行列に従い、ブロック1〜ブロック4の中のデータレコードを並べ替え、符号化したモトローラSデータ0102を作成する。
According to these permutation matrices, the data records in
次に、モトローラSデータの復号化について説明する。符号化したモトローラSデータ0102のデータレコード部分から、4つのブロックを取出す。4つのブロックは、それぞれ、サム値の1桁目から4桁目に対応している。ブロック1〜ブロック4において、データレコードをアドレス順に並び替える。この並び変え前後の順序関係から、ブロック1〜ブロック4に対して(1234/3124)、(1234/2314)、(1234/3412)、(1234/3124)の置換行列を得る。更に図4の置換行列→16進変換テーブルを用いて16進コードに変換し、サム値AC8AHを得る。
Next, decoding of Motorola S data will be described. Four blocks are extracted from the data record portion of the encoded
次に、モトローラSデータのサム値符号化処理の動作について説明する。図6は、モトローラSデータのサム値符号化処理のフローチャートである。図6のフローチャートにおいて、iは変数とする。また、変数sum[]には、サム値が16進コードで記録されているものとする。 Next, the operation of the motor value S data sum value encoding process will be described. FIG. 6 is a flowchart of the sum value encoding process of Motorola S data. In the flowchart of FIG. 6, i is a variable. Also, it is assumed that the sum value is recorded in hexadecimal code in the variable sum [].
処理0601において、iを0とし、判断0602に進む。判断0602では、iが4未満であるかどうかを判断する。iが4未満である場合には、処理0603に進み、iが4未満でなかった場合、モトローラSデータのサム値符号化処理を終了する。処理0603において、サム値のi桁目に該当する16進コードsum[i]を取得し、処理0604に進む。処理0604において、図4に記載の16進コード→置換行列変換テーブルを用いて、16進コードを置換行列に変換し、処理0605に進む。処理0605において、i番目のブロックに該当する4つのデータレコードを取得し、処理0606に進む。処理0606において、処理0604において取得した置換行列に従い、4つのデータレコードを並び替え処理0607に進む。処理0607において、i=i+1とし、判断0602に進む。
In
次に、モトローラSデータのサム値復号化処理の動作について説明する。図7はモトローラSデータのサム値復号化処理のフローチャートである。図7のフローチャートにおいて、iは変数とする。また、sum[]は、サム値を16進コードで記録するための変数である。 Next, the operation of the sum value decoding process of the Motorola S data will be described. FIG. 7 is a flowchart of the process for decoding the sum value of Motorola S data. In the flowchart of FIG. 7, i is a variable. Sum [] is a variable for recording the sum value in hexadecimal code.
処理0701において、iを0とし、判断0702に進む。判断0702では、iが4未満であるかどうかを判断する。iが4未満である場合には、処理0703に進み、iが4未満でなかった場合、モトローラSデータのサム値復号化処理を終了する。処理0703において、4つのデータレコードを取得し、処理0704に進む。処理0704において、処理0703において取得した4つのモトローラSデータレコードの到着順と、モトローラSレコードのアドレス順の対応関係より置換行列を生成し、処理0705に進む。処理0705において、図4に記載の置換行列→16進コード変換テーブルを用いて、置換行列を16進コードに変換し、処理0706に進む。処理0706において、処理0705で変換した16進コードを、sum[i](サム値のi桁目に該当)に記録し、処理0707に進む。処理0707において、i=i+1とし、判断0702に進む。
In
本例では、1ブロックを4レコードで構成し、4ブロックを使用して、サム値が2バイト(16進コードで4桁)の時の方式について説明したが、サム値が4バイト、または8バイトの場合にも、同様の方式でモトローラSデータのサム値の通信が可能である。 In this example, one block is composed of 4 records, and 4 blocks are used and the sum value is 2 bytes (4 digits in hexadecimal code). However, the sum value is 4 bytes or 8 Even in the case of bytes, communication of the sum value of Motorola S data is possible in the same manner.
0101…モトローラSデータ、0102…符号化したモトローラSデータ、0201…PC、0202…通信ケーブル、0203…周辺機器、0301…モトローラSデータ、0302…データレコードの先頭部分、0303…サム値を付加した状態のデータレコードの先頭部分、0304…符号化したモトローラSデータ。
0101 ... Motorola S data, 0102 ... Encoded Motorola S data, 0201 ... PC, 0202 ... Communication cable, 0203 ... Peripheral device, 0301 ... Motorola S data, 0302 ... First part of data record, 0303 ... Sum value added The top part of the state data record, 0304... Encoded Motorola S data.
Claims (2)
Encoding that encodes a hexadecimal code corresponding to each digit of the sum value into a correspondence relationship between the order of addresses of the Motorola S record in the block and the order of transmission of the Motorola S record when transmitting the Motorola S data Means for decoding the correspondence relationship between the arrival order of the Motorola S record in the block and the address order of the Motorola S record into a hexadecimal code corresponding to each digit of the sum value when receiving the Motorola S data 2. The motorola S data sum value communication method according to claim 1, wherein the motorola S data sum value is communicated using a means.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006040720A JP2007219915A (en) | 2006-02-17 | 2006-02-17 | Sum value communication system for motorola s data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006040720A JP2007219915A (en) | 2006-02-17 | 2006-02-17 | Sum value communication system for motorola s data |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007219915A true JP2007219915A (en) | 2007-08-30 |
Family
ID=38497137
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006040720A Pending JP2007219915A (en) | 2006-02-17 | 2006-02-17 | Sum value communication system for motorola s data |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007219915A (en) |
-
2006
- 2006-02-17 JP JP2006040720A patent/JP2007219915A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11799648B2 (en) | Method and apparatus to facilitate transmission of an encrypted rolling code | |
EP0244002A1 (en) | Method of transmitting update information for a stationary video picture | |
JP2018513647A5 (en) | ||
CN104580977B (en) | A kind of data mapped mode transmission and recognition methods and device | |
CN101588370B (en) | Analytic method of multirate communication data stream format | |
CN104598950A (en) | Information write-in method and device | |
EA200201010A1 (en) | ELECTION DATA COMPRESSION FOR DIGITAL MESSAGE INFORMATION | |
JP2007219915A (en) | Sum value communication system for motorola s data | |
CN113744744B (en) | Audio coding method, device, electronic equipment and storage medium | |
CN112486885B (en) | Data frame generation method, storage medium and computer equipment | |
TWI637274B (en) | System and method for transcoding data | |
USRE48433E1 (en) | Method and apparatus to facilitate transmission of an encrypted rolling code | |
CN103929478A (en) | Video and audio file storing and downloading method and system | |
EP3582447A1 (en) | Obfuscation of frames in a control area network of a vehicle | |
JP2008124998A (en) | Packet emulation apparatus | |
CN116456290B (en) | Beidou position information message compression coding method and system | |
JP4672501B2 (en) | Electronic musical instruments | |
US20230336341A1 (en) | Method and apparatus to facilitate transmission of an encrypted rolling code | |
CN113489698B (en) | Internet of things data secret reading method and system based on block chain | |
JP6398241B2 (en) | Packet generating apparatus and program | |
CN112290952B (en) | Parallel data coding device and method | |
CN112099108B (en) | Connecting device of PLT instrument | |
CN116360835A (en) | Firmware updating method and device and firmware updating packet construction method and device | |
Postel | Rapicom 450 facsimile file format | |
CN115293105A (en) | Character compiling method and device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20081016 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A821 Effective date: 20081016 |