Methods, storage media, and devices for configuring the ECU CAN bus baud rate

By setting a baud rate matching table within the ECU and configuring the CAN bus baud rate using an encryption protocol, the problem of needing to update the APP software for baud rate adjustment in traditional methods is solved. This enables baud rate replacement without updating the software, reducing costs and improving the versatility of the ECU module.

CN117221040BActive Publication Date: 2026-07-24JIANGSU ZHAONENG ELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU ZHAONENG ELECTRONICS
Filing Date
2023-10-10
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In traditional methods, adjusting the ECU CAN bus baud rate requires updating the APP software, which increases production, testing, and software maintenance costs and makes it difficult to flexibly adapt to different customer needs.

Method used

By setting a baud rate matching table in the ECU and using an encryption protocol to configure the baud rate, the CAN bus baud rate can be changed without refreshing the APP software. After successful configuration, it takes effect upon power-on reset.

Benefits of technology

This allows for changing the CAN bus baud rate without updating the APP software, meeting the needs of different customers, reducing production and software maintenance costs, and improving the versatility of ECU modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117221040B_ABST
    Figure CN117221040B_ABST
Patent Text Reader

Abstract

The application discloses a method for configuring ECU CAN bus baud rate, a storage medium and equipment, a baud rate matching table in the ECU stores a commonly used baud rate list and its mark, and a host computer GUI initiates a baud rate configuration request according to an encrypted protocol agreed in advance, using the current CAN bus baud rate BaudRate_Cur of the APP; the ECU compares the received to-be-configured baud rate BaudRate_New with the baud rates in the matching table one by one, if equal, sets the mark of the baud rate in the matching table as valid and sets the marks of other baud rates as invalid, after power-on reset, the ECU can use the to-be-configured baud rate BaudRate_New; if not equal to the baud rates in the matching table, the to-be-configured baud rate BaudRate_New is discarded, and the ECU continues to use the current baud rate BaudRate_Cur. The application can change the CAN bus baud rate of the ECU without refreshing the ECU APP software, meets the needs of different customers, has strong universality, and greatly saves production cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, storage medium, and apparatus for configuring the ECU CAN bus baud rate. Background Technology

[0002] CAN bus communication is a highly efficient and reliable bus communication method widely used in automobiles and other fields. Due to different application scenarios or different customers, the required CAN bus baud rate may vary. Traditionally, this is addressed by updating the application software, especially for standard modules. Often, simply changing the baud rate necessitates a complete software update, increasing costs in production, testing, and software version maintenance. Summary of the Invention

[0003] To address the aforementioned issues, this invention provides a method, storage medium, and device for configuring the ECU CAN bus baud rate, ensuring that the CAN bus baud rate can be changed without updating the APP software to adapt to different customer needs.

[0004] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution: Method for configuring the ECU CAN bus baud rate: The ECU's baud rate matching table stores a list of commonly used baud rates and their flags. Following an agreed-upon encryption protocol, the host computer GUI initiates a baud rate configuration request using the APP's current CAN bus baud rate, BaudRate_Cur. The ECU compares the received baud rate to be configured, BaudRate_New, with the baud rates in the matching table sequentially. If they match, the baud rate flag in the matching table is set to valid, and other baud rate flags are set to invalid. After a power-on reset, the ECU can use the baud rate to be configured, BaudRate_New. If the baud rate does not match any of the baud rates in the matching table, the baud rate to be configured, BaudRate_New, is discarded, and the ECU continues to use the current baud rate, BaudRate_Cur.

[0005] Preferably, a dedicated storage space is allocated within the MCU's Flash memory to store a baud rate matching table. This table stores four preset common baud rates (500kbps, 250kbps, 125kbps, and 1000kbps) and their corresponding flags, arranged in descending order of priority. The flag for 500kbps is enabled by default in the matching table, ensuring that the ECU uses the default baud rate of 500kbps for communication when no baud rate is configured.

[0006] Preferably, the MCU's protocol module monitors the CAN bus in real time. Once it receives a configuration request for the encryption protocol, it parses out the baud rate to be configured, BaudRate_New, and compares it sequentially with the four preset baud rates. If they are equal, the flag corresponding to BaudRate_New in the matching table is set to valid, and the flags for the other baud rates are set to invalid. The APP software sets the configuration status to valid and reports it to the host computer GUI through the application protocol. If they are not equal to any of the preset baud rates, the protocol module discards the parsed baud rate BaudRate_New and keeps the original contents of the baud rate matching table unchanged. At the same time, the APP software sets the configuration status to invalid and reports it to the host computer GUI through the application protocol.

[0007] Preferably, after configuration, based on the reported configuration status, if it is valid, it indicates successful configuration. After power-on reset, the ECU module will use the newly configured baud rate BaudRate_New for CAN bus communication. If it is invalid, it indicates unsuccessful configuration. After power-on reset, the ECU module will use the original baud rate BaudRate_Cur for CAN bus communication.

[0008] Preferably, after each power-on reset, the APP software will sequentially query the flags in the baud rate matching table in descending order of priority. Once a valid flag is found, the APP software will configure the CAN bus baud rate to the baud rate corresponding to that flag through the baud rate configuration module. If all flags in the baud rate matching table are invalid, the APP software will configure the CAN bus baud rate to the default baud rate of 500kbps through the baud rate configuration module and set the 500kbps flag to be valid, ensuring that the ECU module can still communicate via the CAN bus at the default baud rate in abnormal situations.

[0009] Preferably, the CAN bus baud rate of the ECU module can be repeatedly configured. After configuration, a power-on reset is required for the successfully configured CAN bus baud rate BaudRate_New to take effect.

[0010] Correspondingly, a storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method for configuring the ECU CAN bus baud rate as described in any of the preceding claims.

[0011] Correspondingly, a computer device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement the method for configuring the ECU CAN bus baud rate as described in any of the preceding claims.

[0012] The beneficial effects of this invention are: The method for configuring the ECU CAN bus baud rate provided by this invention can change the CAN bus baud rate without updating the APP software, meeting different customer needs, and is highly versatile. It also saves production, testing and software version maintenance costs, contributing to the market promotion of standard ECU products. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of the overall block structure of the present invention.

[0014] Figure 2 This is a flowchart of the method for configuring the ECU CAN bus baud rate according to the present invention. Implementation

[0015] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention.

[0016] like Figure 1 As shown, a dedicated space is allocated within the MCU's Flash memory to store the baud rate matching table. This table stores four preset common baud rates (500kbps, 250kbps, 125kbps, and 1000kbps) and their corresponding valid flags, arranged in descending order of priority. The flag for 500kbps is set to valid by default in the matching table, ensuring that the ECU module's CAN bus baud rate is the default 500kbps when no baud rate is configured.

[0017] The protocol module within the MCU monitors the CAN bus in real time. Once it receives a CAN message with an encrypted protocol, it parses out the baud rate to be configured, BaudRate_New, and compares it sequentially with the four preset baud rates. If they are equal, the flag corresponding to BaudRate_New in the matching table is set to valid, and the flags for the other baud rates are set to invalid. At the same time, the APP software sets the configuration status to valid and reports it to the host computer GUI through the application protocol. If they are not equal to any of the preset baud rates, the protocol module discards the parsed baud rate BaudRate_New, keeps the original contents of the baud rate matching table unchanged, and the APP software sets the configuration status to invalid and reports it to the host computer GUI through the application protocol.

[0018] After configuration, based on the reported configuration status, if the configuration is valid, the ECU module will use the newly configured baud rate BaudRate_New for CAN bus communication after power-on reset; if the configuration is invalid, the newly configured baud rate BaudRate_New will be discarded, and the ECU module will use the original baud rate BaudRate_Cur for CAN bus communication after power-on reset.

[0019] The following is combined Figure 2 A detailed process description is provided, including the following steps: Step 1: After power-on reset, initialize the system clock, peripherals, etc., clear the configuration status, and jump to step 2; Step 2: Read the flags in the baud rate matching table in descending order of priority, and then proceed to Step 3; Step 3: Determine if the flag is valid. If yes, it means the baud rate corresponding to the flag is valid, and proceed to step 5. If no, it means the baud rate corresponding to the flag is invalid, and proceed to step 4. Step 4: Determine if all flags are invalid. If yes, proceed to step 6; otherwise, continue reading the flags for the next baud rate and proceed to step 2. Step 5: Configure the CAN baud rate of the ECU module using the baud rate corresponding to the valid flag, and set the flags for other baud rates to invalid. Then proceed to step 7. Step 6: If all preset baud rates are invalid, configure the CAN baud rate of the ECU module using the default baud rate of 500kbps, and set the corresponding flag to be valid. Then proceed to step 7. Step 7: Monitor in real time whether a baud rate configuration request is received on the CAN bus. If yes, proceed to step 8; otherwise, continue monitoring and proceed to step 7. Step 8: The protocol module parses out the baud rate BaudRate_New to be configured according to the agreed encryption protocol, and then jumps to step 9; Step 9: Compare the values ​​with the four preset baud rates one by one, then proceed to step 10; Step 10: Determine whether the preset baud rate is equal to the baud rate to be configured, BaudRate_New. If yes, it means that the baud rate to be configured, BaudRate_New, is available, and proceed to step 12; otherwise, proceed to step 11. Step 11: Determine if none of the four preset baud rates are equal to the baud rate to be configured, BaudRate_New. If so, it means that the baud rate to be configured, BaudRate_New, is unavailable, and proceed to step 13. If not, continue to compare the next preset baud rate and proceed to step 9. Step 12: Set the flag corresponding to the baud rate BaudRate_New in the matching table to be valid, set the flags of other baud rates in the matching table to invalid, set the configuration status to valid, and report it to the host computer GUI through the application protocol. Step 13: Keep the original contents of the baud rate matching table unchanged, set the configuration status to invalid and report it to the host computer GUI through the application protocol.

[0020] Correspondingly, a storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method for configuring the ECU CAN bus baud rate as described in any of the preceding claims.

[0021] Correspondingly, a computer device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement the method for configuring the ECU CAN bus baud rate as described in any of the preceding claims.

[0022] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for configuring the ECU CAN bus baud rate, characterized in that: The ECU's baud rate matching table stores a list of commonly used baud rates and their flags. The host computer GUI, following a pre-agreed encryption protocol, uses the APP's current CAN bus baud rate, BaudRate_Cur, to initiate a baud rate configuration request. The ECU compares the received baud rate to be configured, BaudRate_New, with the baud rates in the matching table sequentially. If they are equal, the baud rate flag in the matching table is set to valid, and other baud rate flags are set to invalid. After a power-on reset, the ECU can use the baud rate to be configured, BaudRate_New. If they are not equal to any of the baud rates in the matching table, the baud rate to be configured, BaudRate_New, is discarded, and the ECU continues to use the current baud rate, BaudRate_Cur. A separate storage space is allocated in the MCU's Flash memory to store the baud rate matching table. This table stores four preset common baud rates—500kbps, 250kbps, 125kbps, and 1000kbps—in descending order of priority. And the corresponding flags; the flag corresponding to 500kbps in the matching table is valid by default, ensuring that the ECU uses the default baud rate of 500kbps for communication when the baud rate is not configured; After each power-on reset, the APP software queries the flags in the baud rate matching table in descending order of priority. Once a valid flag is found, the APP software configures the CAN bus baud rate to the baud rate corresponding to that flag via the baud rate configuration module. If all flags in the baud rate matching table are invalid, the APP software configures the CAN bus baud rate to the default baud rate of 500kbps via the baud rate configuration module and sets the 500kbps flag to be valid, ensuring that the ECU module can still communicate via the CAN bus at the default baud rate under abnormal conditions. This method allows the ECU's CAN bus baud rate to be changed without refreshing the ECU APP software.

2. The method for configuring the ECU CAN bus baud rate as described in claim 1, characterized in that, The MCU's protocol module monitors the CAN bus in real time. Once it receives a configuration request for the encryption protocol, it parses out the baud rate to be configured, BaudRate_New, and compares it sequentially with the four preset baud rates. If they are equal, the flag corresponding to BaudRate_New in the matching table is set to valid, and the flags for the other baud rates are set to invalid. The APP software sets the configuration status to valid and reports it to the host computer GUI through the application protocol. If they are not equal to any of the preset baud rates, the protocol module discards the parsed baud rate BaudRate_New, keeps the original contents of the baud rate matching table unchanged, and the APP software sets the configuration status to invalid and reports it to the host computer GUI through the application protocol.

3. The method for configuring the ECU CAN bus baud rate as described in claim 2, characterized in that, After configuration, based on the reported configuration status, if it is valid, it indicates successful configuration. After power-on reset, the ECU module will use the newly configured baud rate BaudRate_New for CAN bus communication. If it is invalid, it indicates unsuccessful configuration. After power-on reset, the ECU module will use the original baud rate BaudRate_Cur for CAN bus communication.

4. The method for configuring the ECU CAN bus baud rate as described in claim 1, characterized in that, The CAN bus baud rate of the ECU module can be repeatedly configured. After configuration, a power-on reset is required for the successfully configured CAN bus baud rate BaudRate_New to take effect.

5. A storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method for configuring the ECU CAN bus baud rate as described in any one of claims 1-4.

6. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one instruction that is loaded and executed by the processor to implement the method for configuring the ECU CAN bus baud rate as described in any one of claims 1-4.

Citation Information

Patent Citations

  • BT module Baud rate configuration method and system and BT module

    CN115567379A

  • Baud rate setting method and device, equipment and storage medium

    CN116455694A