Recent Changes - Search:

Products

General resources

   Android
      DataEdit
   WinCE

edit SideBar

EM3070 / HowTo :
By - February 01, 2018, at 02:47 AM

1.  How to upgrade firmware by programming

1.1  Package definition

Except detection and handshake commands, the other commands and firmware data have to be sent from host to scanning engine in package.

The firmware has to be sent per package including 512 bytes. If last package of firmware has not 512 bytes then has to fill in 0x00 to 512 bytes.

The structure of one command package:

StartCommand startCommand LengthCommandCRC 32
0x020x052 bytes for the length of command stringThe string of command4 bytes for CRC 32 checksum

While the command is applied successfully, the host will get response:

02 05 00 01 30 B4 FE 55 A2

The structure of one firmware package:

StartDataCRC 32
0x02512 bytes for the firmware data4 bytes for CRC 32 checksum

Now we can start the steps to upgrade firmware.

1.2  SETP 1: Reset scanning engine

To send following command to reset scanning engine. Please note this command is not upgrading command so would not be sent as package mentioned above.

7E 00 00 08 7E 75 70 44 61 74 65 7E C6

note: if to CPU-based products, the command should be

7E 00 00 09 7E 75 70 47 72 61 64 65 7E A6

The following response will be got if command sent successfully

06

1.3  STEP 2: Enable detection mode

To change host baud rate to 9600 and keep sending 0x3F until you get response 0x3C.

This step has to be done within 2s after reset. then wait for 30ms.

1.4  STEP 3: To change baud rate to 115200 when the detection mode enabled

To send this command which is already filled into the package format:

02 05 00 12 23 43 4F 4D 4D 3A 31 31 35 32 30 30 2C 38 2C 30 2C 31 0A 30 1C B6

1.5  STEP 4: Handshake after the baud rate setting

To send 0x2A and should get 0x2A as response.

1.6  STEP 5: Set total length of firmware data

To tell scanning engine how many bytes will be sent as firmware, the command is:

02 05 00 10 21 44 61 74 61 4C 65 6E 73 3A xx CRC32

in which

00 10

the length of command string in HEX, should be based on the real length of command, same as below.

The xx is length of firmware file size. For example if the length is 932174 bytes then the full command string is

02 05 00 10 21 44 61 74 61 4C 65 6E 73 3A 39 33 32 31 37 34 97 45 58 64

1.7  STEP 6: Set total firmware packages' amount

To tell scanning engine how many packages will be sent. The command is

02 05 00 0B 21 46 72 61 6D 65 73 3A xx CRC32

Like said before the firmware content is 512 bytes per package, last package has to be filled 0x00 until 512 bytes.

For example, if the total length is 932174 bytes then the package amount is 932174/512 = 1820.6523, so should be 1821 packages. The command string will be like this:

02 05 00 0C 21 46 72 61 6D 65 73 3A 31 38 32 31 EC ED 9B F8

1.8  STEP 7: Set package size as 512

The command is

02 05 00 0E 21 46 72 61 6D 65 53 69 7A 65 3A 35 31 32 D0 87 D8 52

1.9  STEP 8: Set the upgraded file as kernel

The command is

02 05 00 0E 21 46 69 6C 65 54 79 70 65 3A 6B 65 72 6E 38 B3 40 7B

1.10  STEP 9: Start upgrading

The command is

02 05 00 06 3E 53 74 61 72 74 68 D2 23 75

1.11  STEP 10: Send firmware data

The host read all data from firmware file and send to scanning engine. The package format mentioned in section 1.

Every package sent will get response:

! means failed

* means success, could send next package

example send

02 512bytes data 4bytes CRC32

response

2A

1.12  STEP 11: Finish

after receiving the last package, device will send one more 0x2A(ASCII:*) and start flashing new firmware. host should receive 0x5E(ASCII:^) from device after flashing finished.

send command to exit firmware upgrading:

02 05 00 05 40 45 78 69 74 9D 5E 0F 9A

The engine will reset.

2.  How to inquiry firmware version?

To use following command (in hex):

7e 00 00 02 33 47 89
Edit - History - Print - Recent Changes - Search