A program download method based on CAN bus

A technology of CAN bus and program download, which is applied in the direction of program loading/starting, program control device, software deployment, etc. It can solve problems such as FLASH accidental operation, FLASH error rewriting, and affecting user experience, so as to protect safety and prevent The effect of overwriting

Active Publication Date: 2017-09-12
HUIZHOU BNET TECH CO LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, in the existing CAN bus-based program download method, when the target code is wrong during the program programming process or the flashing process is interrupted unexpectedly, it cannot enter the flashing mode and flash again
After the battery management system is powered on, it needs to judge whether the system enters the BootLoad mode or the application program mode. In the prior art, it takes a certain amount of time to determine the mode after the system is powered on, resulting in a certain delay when the system is powered on and entering the application program, which affects the user's use. experience effect
In addition, the existing program download based on CAN bus is prone to accidental operation of FLASH, resulting in wrong rewriting of FLASH

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A program download method based on CAN bus
  • A program download method based on CAN bus
  • A program download method based on CAN bus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0035] Such as figure 1 As shown, a program download method based on CAN bus, the specific process is as follows:

[0036] Step1 judges in the application layer whether the program update flag variable Up_Flg is valid (Up_Flg==1?) and whether the target code program flag variable Code_ok is valid (that is, Code_ok==1?), if the program update flag variable Up_Flg is invalid (Up_Flg==0 ) and the object code program flag variable Code_ok is valid (Code_ok==1), then jump to the application program and enter the application mode, otherwise enter the BootLoad mode. By reading the flag bits to judge whether to enter the BootLoad mode or the application program mode, there is no delay when the system is powered on and enters the application program, and the zero-start effect is achieved.

[0037] Among them, the specific process of BootLoad mode is as follows:

[0038] Step2 judges whether the FLASH driver code is received within the first predetermined time, if so, execute step Ste...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a program download method based on a CAN bus. The program download method comprises that S1, when a system is powered on, whether a program update flag variable Up_Flg is effective or not and whether an object code program flag variable Code_ok is effective or not are judged, if the program update flag variable Up_Flg is ineffective and the object code program flag variable Code_ok is effective, the system enters an application mode, otherwise the system enters a BootLoad mode; S2, whether a FLASH driving code is received in a first predetermined time or not is judged, if the FLASH driving code is received in the first predetermined time, a step S3 is executed, otherwise the system returns to the step S1; S3, the object code program flag variable Code_ok is set to be zero; S4, an application program object code is erased; S5, a new program code is received; and S6, a new application program is executed. According to the invention, the program is downloaded based on the CAN bus and can be flashed at random, even if the programmed object code is wrong or the flashing process is interrupted accidentally, the flashing process can be executed again, whether the system enters the BootLoad mode or the application mode is judged through reading the flags, the system is powered on and enters an application program without time delay, and a zero speed starting effect is achieved.

Description

technical field [0001] The invention relates to the technical field of battery management systems for electric vehicles, in particular to a method for downloading programs based on a CAN bus. Background technique [0002] At present, in the field of electric vehicles, it is a common way to download programs to the battery management system through the CAN bus. However, in the existing CAN bus-based program downloading method, when the target code is wrong in the program programming process or the flashing process is accidentally interrupted, it cannot enter the flashing mode to flash again. After the battery management system is powered on, it needs to judge whether the system enters the BootLoad mode or the application program mode. In the prior art, it takes a certain amount of time to determine the mode after the system is powered on, resulting in a certain delay when the system is powered on and enters the application program, which affects the user's use. experience ef...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/445
CPCG06F8/65
Inventor 徐文赋任素云
Owner HUIZHOU BNET TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products