Summary of the invention
To the objective of the invention is in order solving because can't direct contact, to write with a brush dipped in Chinese ink the shortcoming of unusual difficulty again and a kind of CAN of utilization line of proposing, the method hybrid power automobile controller FLASH write with a brush dipped in Chinese ink by means of ZLG USB CAN when controller.
The technical solution used in the present invention is as follows:
The invention provides a kind of controller FLASH programming method based on hybrid electric vehicle CAN bus communication.Need be in the bottom software of controller integrated bootloader function, in the bootloader functional software, finish setting up corresponding the connection according to the Message that receives on the CAN bus, finish the verification of writing with a brush dipped in Chinese ink authority, check the storage space of RAM, FLASH and Eeprom, accept the Frame received on the CAN bus, be combined into complete controller software at last and write with a brush dipped in Chinese ink, feedback is write with a brush dipped in Chinese ink the result.
When needs are write with a brush dipped in Chinese ink director demon, can directly be connected with controller, thereby reach the purpose of writing with a brush dipped in Chinese ink director demon by the CAN bus on the controller.This method is that computing machine is linked to each other with automobile CAN-bus by a Zhou Ligong CAN bus check implement, send connection request by the CAN bus then and be connected to controller, at last preprepared new procedures is uploaded in the controller, so just finished once and write with a brush dipped in Chinese ink, refreshed controller in-to-in program.
When writing with a brush dipped in Chinese ink director demon by the CAN bus, computer terminal need move bootloader and write with a brush dipped in Chinese ink program.After moving this program, at first confirm computer terminal and the employed CANID of controller end, and the baud rate parameter of employed Zhou Ligong CAN bus monitoring equipment, clicking " next step " afterwards, choose " update controller program ", and click " browsing " and select the required S19 file of writing with a brush dipped in Chinese ink.Confirm errorless after, click " beginning to download ".At this moment in Information related feedback information can appear, to show the current situation of writing with a brush dipped in Chinese ink of carrying out.Concrete steps are as follows:
1. open the CAN port.
2. request command.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends the Can message that contains request command, and waits for the controller feedback.If this step failure then can't be finished download.
3. the order of shaking hands.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends the Can message that contains the order of shaking hands, and waits for the controller feedback.If this step failure then can't be finished download.
4. accreditation.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends the Can message contain authentication message, the controller end contrast this message whether with controller end bootloader function program in authentication message whether corresponding.If this step failure then can't be finished download.
5. open the director demon file.
6. wipe old director demon.
7. update controller program.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends several Can message that contain complete director demon, and the controller termination is received the back and write with a brush dipped in Chinese ink.If this step failure then can't be finished download.
8. download successfully.After finishing, download shows this message.
9. controller is restarted.Restart controller with the operation new procedures.
10. close the Can port.
After writing with a brush dipped in Chinese ink failure, can trouble-shooting after, click " beginning to download " again and write with a brush dipped in Chinese ink program, need not to carry out reset operation.
Advantage of the present invention is:
1. owing to CAN bus on the modern vehicle is used very extensive, on hardware, need not to add new interface and can realize this function, on the controller hardware of moderate hybrid vehicle, can save the BDM interface like this, saved the controller occupation space, the difficulty that makes controller hardware design difficulty and each space of components arrange all obviously reduces.
2. because the characteristic of CAN bus, make that any one port all can be write with a brush dipped in Chinese ink controller on the CAN bus, increased the alerting ability when writing with a brush dipped in Chinese ink FLASH.
3. controller end program contains the authority setting.The insufficient permission that comprises when a controller end program is so that it when refreshing entire controller, can make this time write with a brush dipped in Chinese ink failure.The safety of the program of writing with a brush dipped in Chinese ink that such design increases has avoided controller end program by unsuitable modification or wipe.
The specific embodiment
Referring to Fig. 1, the performing step of this method is as follows:
According to the Can2.0A/B agreement to the CAN module initialization, write out relevant .C and .H file.
2. distribute according to controller RAM and FLASH, write MAKE and LINK file.
3. by CosmicC compiling S19 file, write with a brush dipped in Chinese ink the controller end.
4. computer terminal is connected on the CAN bus by a ZLG USB CAN.
5. write with a brush dipped in Chinese ink program (computer terminal) at computer terminal operation bootloader, operate according to prompting, concrete steps are as follows:
1. open the CAN port.
2. request command.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends the Can message that contains request command, and waits for the controller feedback.If this step failure then can't be finished download.
3. the order of shaking hands.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends the Can message that contains the order of shaking hands, and waits for the controller feedback.If this step failure then can't be finished download.
4. accreditation.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends the Can message contain authentication message, the controller end contrast this message whether with controller end bootloader function program in authentication message whether corresponding.If this step failure then can't be finished download.
5. open the director demon file.
6. wipe old director demon.
7. update controller program.Computer terminal bootloader writes with a brush dipped in Chinese ink program and sends several Can message that contain complete director demon, and the controller termination is received the back and write with a brush dipped in Chinese ink.If this step failure then can't be finished download.
8. download successfully.After finishing, download shows this message.
9. controller is restarted.Restart controller with the operation new procedures.
10. close the Can port.