CN114064077A - Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping - Google Patents

Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping Download PDF

Info

Publication number
CN114064077A
CN114064077A CN202111350669.XA CN202111350669A CN114064077A CN 114064077 A CN114064077 A CN 114064077A CN 202111350669 A CN202111350669 A CN 202111350669A CN 114064077 A CN114064077 A CN 114064077A
Authority
CN
China
Prior art keywords
group
app
address mapping
cloud software
upgrading
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
Application number
CN202111350669.XA
Other languages
Chinese (zh)
Inventor
王志伟
李红吉
田雨禾
曹包华
吴迪
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.)
Changchun Faw Fusheng Group Co ltd
Original Assignee
Changchun Faw Fusheng Group Co 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 Changchun Faw Fusheng Group Co ltd filed Critical Changchun Faw Fusheng Group Co ltd
Priority to CN202111350669.XA priority Critical patent/CN114064077A/en
Publication of CN114064077A publication Critical patent/CN114064077A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to the technical field of automobiles, and relates to an automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping; the specific method comprises the following steps: dividing two areas into an A group and a B group in TC397Flash, storing APPs, wherein only one group of APPs is valid at the same time, writing the APP into the A group in an initial state, writing a new APP into the B group when updating, erasing the APP of the A group, and simultaneously performing A, B group address mapping again to finish cloud software upgrading; when the traditional BootLoader is internally provided with a communication protocol stack, during updating, an instruction is sent to the MCU to enable the MCU to jump to the BootLoader, then the old APP is erased, and the new APP is received and written into an APP operation address of Flash directly at the same time, so that the defects that the BootLoader code is more complicated, and if data transmission is interrupted, the old APP cannot be recovered; the invention can prevent the APP from being unavailable due to the interruption of data transmission, and does not need to add extra storage except the MCU.

Description

Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping
Technical Field
The invention belongs to the technical field of automobiles, and relates to an automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping.
Background
Cloud software upgrading can repair some systematic defects of the automobile, and under general conditions, traditional automobile manufacturers can call back the automobile in a unified mode when finding that a certain product under a flag has a system BUG, so that the whole process is very complicated and time-consuming and labor-consuming. After the cloud software is upgraded, the upgrading can be directly carried out on the automobile through an updating package pushed by a manufacturer.
The traditional cloud software upgrading method of the automobile ECU is characterized in that a communication protocol stack is built in a BootLoader (boot loader), during updating, an instruction is sent to the MCU firstly to enable the MCU to jump to the BootLoader, then an old APP is erased firstly, and the new APP is received and written into an APP operation address of Flash directly at the same time.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the problem that the OTA upgrading of the TC397 microcontroller is too complicated in the prior art, and provide an automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping.
In order to solve the technical problems, the invention is realized by adopting the following technical scheme, which is described by combining the accompanying drawings as follows:
it is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The utility model provides a car ECU cloud software upgrading method based on TC397 microcontroller address mapping, divides into two blocks of regions in TC397Flash, divide into A group and B group, all are used for depositing APP, but only the APP of a group is effectual under the same time, write into A group with APP earlier under the initial condition, when updating, write into B group with new APP, again erase the APP of A group, carry out A, B group address mapping again simultaneously, accomplish cloud software upgrading.
A method for upgrading automobile ECU cloud software based on TC397 microcontroller address mapping specifically comprises the following steps:
step one, an automobile ECU receives a cloud software upgrading request command through a T-Box;
step two, the ECU detects that the electric quantity of the automobile battery is more than 60%, the automobile state is in a parking state, and the cloud software upgrading command is received, so that the fact that the cloud software upgrading can be carried out is judged;
step three, the TC397 is matched through an MD5 secret key, whether the information safety is met or not is confirmed, and after the information safety is confirmed, the upgrade package is transmitted to a core TC397 processor of the ECU from the T-Box through CAN communication;
and step four, the TC397 switches address mapping, the firmware in the upgrade package is operated after reset and restart, and the cloud software upgrade is completed.
Further, the method steps of the TC397 switching address mapping are as follows.
1) Loading the initial mirror image into the group A library;
2) confirming whether the hardware safety module equipment is used, if so, executing the next step;
3) loading hardware security module program codes into hardware security module code sectors of the group A and the group B;
4) programming a start address to a UCB-BMHD register;
5) selecting a standard address mapping by programming;
6) setting FLASH protection in a user configuration block;
7) setting a required hardware security module into a UCB HSMOTP register and a UCB HSM register;
8) configuring a SWAPEN flag bit to be enabled in a UCB OTPO register;
9) TC397 resets.
Further, the group A banks are active banks in a standard address mapping.
Compared with the prior art, the invention has the beneficial effects that:
traditional BootLoader embeds communication protocol stack, and during the update, send the instruction to MCU earlier and make it jump to BootLoader, later erase old APP earlier, directly write into Flash's APP operation address department with it when receiving new APP, the shortcoming is that BootLoader code is more complicated, and if data transmission takes place to interrupt, old APP will not be resumeed. The invention can prevent the APP from being unavailable due to the interruption of data transmission, and does not need to add extra storage except the MCU.
Drawings
The invention is further described with reference to the accompanying drawings in which:
fig. 1 is a flowchart illustrating the steps of the method for mapping the TC397 switching address according to the present invention.
Detailed Description
In order to make the implementation objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be described in more detail below with reference to the accompanying drawings in the embodiments of the present invention. In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are only some, but not all embodiments of the invention. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience in describing the present invention and for simplifying the description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore, should not be taken as limiting the scope of the present invention.
The invention is described in detail below with reference to the attached drawing figures:
the cloud Software upgrading is called cloud Software upgrading (Software updates Over The Air), namely, under The condition that a writer is not connected, The updating of an application program is realized through a CAN (controller area network), a UART (universal asynchronous receiver/transmitter) or other communication modes.
When the cloud software is upgraded, the old application program needs to be erased, and the new application program needs to be written in. A conventional implementation mode needs to respectively develop a BootLoader program and an APP program, the BootLoader is firstly operated on the MCU, and the BootLoader selects whether to jump to the APP and whether to update the programs according to conditions.
The utility model provides a car ECU cloud software upgrading (cloud software upgrading) method based on TC397 microcontroller address mapping, divide into two blocks of regions in TC397Flash, divide into A group and B group, all be used for depositing APP, but only the APP in a district is effectual under the same time, write into A group with APP earlier under the initial condition, when updating, write into B group with new APP, again erase the APP of A group, AB group address mapping is carried out again simultaneously, accomplish the cloud software upgrading.
A method for upgrading cloud software (cloud software upgrading) of an automobile ECU (electronic control unit) based on TC397 microcontroller address mapping specifically comprises the following steps:
1. the automobile ECU receives a cloud end request cloud end software upgrading command through the T-Box
2. The ECU detects that the electric quantity of the automobile battery is more than 60%, the automobile state is in a parking state, and the ECU judges that the cloud software upgrading can be performed after receiving a TOA command
3. The TC397 is matched with the MD5 secret key to confirm whether the information is safe or not, and after confirmation, the upgrade package is transmitted to a core TC397 processor of the ECU from the T-Box through CAN communication
4. And the TC397 carries out integrity detection and security detection on the upgrade package.
5. The TC397 switches address mapping, the firmware in the upgrade package is operated after reset and restart, and cloud software upgrade is completed
The method steps of the TC397 switching address mapping are as follows.
10) Loading the initial image into the group a library (active library in standard address mapping);
11) confirming whether the equipment is Hardware Security Module (HSM) equipment, and if so, executing the next step;
12) loading HSM program codes into HSM code sectors of the group A and the group B;
13) programming a start address to a UCB-BMHD register; the starting address not being fixed
14) Selecting a standard address mapping by programming;
15) setting FLASH protection in a user configuration block;
16) placing the required HSM setting into a UCB HSMOTP register and a UCB HSM register;
17) configuring SWAPEN to be enabled in UCB OTPO register;
SWAPEN denotes a cloud software upgrade enable flag bit.
18) And resetting the system.
Flash of TC397 is used for storing the standard address mapping mode of PFlash (program storage area) of the program code, the specific mapping is as the following table 1, PF0-PF5 in the table 1 represents 5 Flash (PF 0-PF 5) in the physical sense.
TABLE 1
Figure BDA0003355718020000061
The address mapping is referred to as alternate address mapping, and as shown in Table 2 below, the address range of PF0-1 in standard mode is now mapped to PF2-3, and the address range of PF4 is mapped to PF 5.
TABLE 2
Figure BDA0003355718020000062
When the cloud software upgrade function is activated, the PFLash is divided into two parts, one part is used for storing executable code (active bank), and the other part is used for reading and writing (inactive bank). After the APP is updated, the two parts are interchanged, namely the two address mapping modes are switched. The upper OTA can be realized by using PF0-1 and PF4 as active bank called A group in standard mode and PF2-3 and PF5 as active bank called B group in Alternate mode, and identical APP programs can be written and run with the same address.
A method for upgrading automobile ECU cloud software based on TC397 microcontroller address mapping comprises the following steps:
1. the automobile ECU receives a cloud end request cloud end software upgrading command through the T-Box
2. The ECU detects that the electric quantity of the automobile battery is more than 60%, the automobile state is in a parking state, and the ECU judges that the cloud software upgrading can be performed after receiving a TOA command
3. The TC397 is matched with the MD5 secret key to confirm whether the information is safe or not, and after confirmation, the upgrade package is transmitted to the core TC397 of the ECU from the T-Box through CAN communication
4. After the TC397 BootLoader detects the upgrade package, the new APP is written into the Inactive part of the pflast, i.e. the aforementioned Inactive Bank, and the accuracy is checked.
5. If the new APP is written into the B group, writing 0x000000AA to MARKERLx. SWAP register, enabling Alternate address mapping mode; if a new APP is written to group A, then 0x00000055 is written to MARKERLx. SWAP register, enabling standard address mapping mode.
6. Resetting and running the firmware in the upgrade package after restarting to complete the cloud software upgrade
The above description is only for the purpose of illustrating the present invention and the appended claims are not to be construed as limiting the scope of the invention, which is intended to cover all modifications, equivalents and improvements that are within the spirit and scope of the invention as defined by the appended claims. And those not described in detail in this specification are well within the skill of those in the art.

Claims (4)

1. A method for upgrading automobile ECU cloud software based on TC397 microcontroller address mapping is characterized in that:
two areas are divided into an A group and a B group in TC397Flash, the two areas are used for storing APP, but only the APP of one group is effective at the same time, the APP is written into the A group in the initial state, the new APP is written into the B group in the updating process, the APP of the A group is erased, A, B groups of address mapping is carried out again, and cloud software upgrading is completed.
2. The method for upgrading the cloud software of the automobile ECU based on the TC397 microcontroller address mapping according to claim 1, comprising the following steps:
step one, an automobile ECU receives a cloud software upgrading request command through a T-Box;
step two, the ECU detects that the electric quantity of the automobile battery is more than 60%, the automobile state is in a parking state, and the cloud software upgrading command is received, so that the fact that the cloud software upgrading can be carried out is judged;
step three, the TC397 is matched through an MD5 secret key, whether the information safety is met or not is confirmed, and after the information safety is confirmed, the upgrade package is transmitted to a core TC397 processor of the ECU from the T-Box through CAN communication;
and step four, the TC397 switches address mapping, the firmware in the upgrade package is operated after reset and restart, and the cloud software upgrade is completed.
3. The method for upgrading the cloud software of the automobile ECU based on the TC397 microcontroller address mapping according to claim 2, wherein the method comprises the following steps:
the method steps of the TC397 switching address mapping are as follows.
1) Loading the initial mirror image into the group A library;
2) confirming whether the hardware safety module equipment is used, if so, executing the next step;
3) loading hardware security module program codes into hardware security module code sectors of the group A and the group B;
4) programming a start address to a UCB-BMHD register;
5) selecting a standard address mapping by programming;
6) setting FLASH protection in a user configuration block;
7) setting a required hardware security module into a UCB HSMOTP register and a UCB HSM register;
8) configuring a SWAPEN flag bit to be enabled in a UCB OTPO register;
9) TC397 resets.
4. The method for upgrading the cloud software of the automobile ECU based on the TC397 microcontroller address mapping according to claim 3, wherein the method comprises the following steps:
the group A library is an active library in standard address mapping.
CN202111350669.XA 2021-11-15 2021-11-15 Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping Pending CN114064077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111350669.XA CN114064077A (en) 2021-11-15 2021-11-15 Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111350669.XA CN114064077A (en) 2021-11-15 2021-11-15 Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping

Publications (1)

Publication Number Publication Date
CN114064077A true CN114064077A (en) 2022-02-18

Family

ID=80272403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111350669.XA Pending CN114064077A (en) 2021-11-15 2021-11-15 Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping

Country Status (1)

Country Link
CN (1) CN114064077A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643772A (en) * 2023-05-30 2023-08-25 深圳市乐祺微电子科技有限公司 Low-cost chip OTA upgrading method
CN116702233A (en) * 2023-05-31 2023-09-05 无锡摩芯半导体有限公司 UCB-based FLASH space security access control method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643772A (en) * 2023-05-30 2023-08-25 深圳市乐祺微电子科技有限公司 Low-cost chip OTA upgrading method
CN116702233A (en) * 2023-05-31 2023-09-05 无锡摩芯半导体有限公司 UCB-based FLASH space security access control method

Similar Documents

Publication Publication Date Title
CN110231952B (en) ECU program backup and cyclic upgrade control method and device
US8539471B2 (en) Updating firmware of an electronic device
CN114064077A (en) Automobile ECU cloud software upgrading method based on TC397 microcontroller address mapping
CN101923473B (en) Embedded electronic device and method for updating firmware thereof
CN105808292A (en) Firmware upgrade method of embedded terminal device
US20120260244A1 (en) Failsafe firmware updates
CN101183337A (en) Space management techniques based on NAND FLASH mobile terminal storage medium
CN101211265A (en) Terminal embedded type system software update method and apparatus
CN101344854A (en) Method for upgrading embedded type Linux equipment through SD card
JP2002099441A (en) Communication terminal apparatus and its operating method
WO2016078263A1 (en) Upgrading control device and terminal, terminal upgrading method and system, and storage medium
CN110874237A (en) Software upgrading method, device, terminal and readable storage medium
CN108664256A (en) Firmware updating method and device of system and battery management system
CN112000358B (en) Upgrading method of charging pile and intelligent charging pile
CN115061713A (en) Method and device for upgrading electronic equipment
CN111782246A (en) Embedded program upgrading method of multi-node equipment based on bus
CN103533534B (en) Firmware wireless upgrading method for DECT (Digital Enhanced Cordless Telecommunications) mobile phone
CN115220758A (en) Method for upgrading firmware of single chip microcomputer on line
CN112181455B (en) Online upgrading method of microcontroller, microcontroller and storage medium
CN113360161A (en) Resource upgrading method and related product
CN107332589A (en) A kind of device for upgrading firmware based on bluetooth
CN110688135A (en) Program flashing method, device and medium for controller
CN101727333A (en) Method for updating firmware in microprocessor and firmware updating system
CN114780114A (en) Firmware upgrading method, system, vehicle and storage medium
KR20220111648A (en) Ota master, update control method, non-transitory storage medium, and vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination