An on-line programmable upgrading system and method for a single-chip microcomputer without a boot pin
By reusing reset and communication pins to achieve BOOT mode switching, and combining IAP to complete the online programming upgrade of microcontrollers without BOOT pins, the problems of long system startup time and logic processing risks are solved, and a fast and stable upgrade effect is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI CHANGYUAN WAYON MICROELECTRONICS
- Filing Date
- 2023-02-20
- Publication Date
- 2026-04-28
AI Technical Summary
Existing upgrade methods for microcontrollers without BOOT pins suffer from problems such as long system startup time, high logic processing risk, strict user operation requirements, and limited resources, lacking a unified, fast, and accurate upgrade solution.
By reusing the reset pin, communication transmit pin, and communication receive pin as the criteria for entering BOOT mode, the BOOT mode switching is completed using the detection upgrade module and download box. Combined with IAP, online programming upgrades are realized, reducing BOOT pin occupation and improving stability and efficiency.
It enables rapid, stable, and effective online programming upgrades for microcontrollers without a BOOT pin, reducing user development costs and hardware resource requirements, and improving system startup time and upgrade stability.
Smart Images

Figure CN116185451B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microcontroller firmware upgrade technology, and in particular to an online programmable upgrade system and method for a microcontroller without a BOOT pin. Background Technology
[0002] In existing MCU or SOC designs, the non-volatile memory ROM is divided into two storage areas: APROM and LDROM. APROM is used to store user code and is provided to the user, while LDROM is used as the boot upgrade code storage area to store the BOOTROM firmware. This BOOT firmware is generally provided by the manufacturer and supports user customization.
[0003] Existing ISP (In-System Programmable) upgrade methods are mostly tightly bound to a specific chip series. Often, a particular chip series has fixed upgrade methods. For example, for 32-bit MCUs, the BOOT mode is typically entered by pulling down a hardware pin. However, for 8-bit CPUs, due to limited I / O pins, there are currently two ways to enter BOOT mode:
[0004] The first method involves power-on booting from the BOOTROM program by default, connected to the MCU via a communication port, typically UART or CAN. The host computer sends a fixed sequence within a specified time as the basis for entering BOOT mode. This method reduces hardware I / O usage and is simple to implement, but it also presents several problems: First, booting from the BOOTROM by default before entering the application increases system startup time, potentially hindering faster startup for some applications. Second, during communication connection or power-on, serial port interference can enter the system, leading to misinterpretations and posing a logical processing risk. Third, it places strict requirements on user timing and operation, making it less feasible to implement.
[0005] The second method is to boot from the application by default upon power-up. This is achieved through hardware methods, such as using the DB9's flow control interface DTR and RTS as reset pins and switch controls to enter BOOT mode. This method avoids the drawbacks of booting from BOOTROM, but it also introduces new problems: First, it may cause logical errors due to level changes at the moment of power-up; second, it is limited for some USB-to-serial PCs or devices that do not have flow control pins exposed; and third, it occupies more pins, which is not suitable for users with strict requirements.
[0006] Currently, for processors that provide a BOOT pin for switching BOOT mode, the implementation is relatively fixed and simple. However, for microcontrollers with limited resources that cannot provide a BOOT pin, there is no unified solution for entering BOOT mode stably, quickly, and efficiently. Each manufacturer uses its own customized system download and upgrade methods, and the code is not shared. This part falls under the proprietary intellectual property protection of chip manufacturers, making it difficult for others to learn from. Therefore, developing a fast and accurate upgrade and download system tailored to the specific needs of the microcontroller is crucial. Summary of the Invention
[0007] To address the problems existing in the prior art, this invention provides an in-circuit programmable upgrade system for a microcontroller without a BOOT pin, comprising:
[0008] A microcontroller target board, wherein a non-volatile memory of the microcontroller target board includes a user code storage area and a boot code storage area, wherein the boot code storage area stores BOOTROM firmware;
[0009] The upgrade control terminal is connected to the microcontroller target board via a download box. When a firmware upgrade is required, the upgrade control terminal controls the download box to send a fixed sequence to the microcontroller target board.
[0010] The microcontroller target board also includes a detection and upgrade module connected to the non-volatile memory. This module controls the microcontroller target board to reset and enter BOOT mode according to the fixed sequence, and then controls the startup of the BOOTROM firmware to perform an online programmable upgrade of the user code storage area according to the upgrade firmware data sent by the upgrade control terminal.
[0011] Preferably, the detection and upgrade module includes a first configuration unit, which is used to configure the microcontroller target board to start from the boot code storage area to enter the BOOT mode after the microcontroller target board is reset according to the fixed sequence, so that the microcontroller target board starts to execute the BOOTROM firmware after the reset is completed.
[0012] Preferably, the fixed sequence includes at least one upgrade request signal and one upgrade confirmation signal;
[0013] The download box includes an upgrade trigger module, which is used to send the upgrade request signal to the microcontroller target board, and when it receives a confirmation response signal from the microcontroller target board, it sends the upgrade confirmation signal to the microcontroller target board to trigger the microcontroller target board to reset and enter the BOOT mode.
[0014] Preferably, the connection interface between the download box and the microcontroller target board has a power supply pin, a reset pin, a communication transmit pin, a communication receive pin, and a ground pin;
[0015] The download box supplies power to the microcontroller target board through the power pin, and sends the upgrade request signal and the upgrade confirmation signal by multiplexing the reset pin, the communication transmit pin and the communication receive pin.
[0016] Preferably, the microcontroller target board further includes an online upgrade module, the online upgrade module comprising:
[0017] The handshake unit is used to perform a handshake process with the upgrade control terminal after the BOOTROM firmware is started, and to send a positive response to the upgrade control terminal when the handshake is successful, so that the upgrade control terminal sends a firmware data packet according to the positive response.
[0018] The upgrade unit is used to perform verification and version confirmation on the firmware data packet when it receives the firmware data packet, and when the verification and version confirmation is successful, to perform an erase-and-program operation on the user code storage area according to the firmware version size of the firmware data packet.
[0019] Preferably, the handshake unit includes:
[0020] The first handshake subunit is used to start the BOOTROM firmware and, upon receiving a connection establishment request sent by the upgrade control terminal, to send a confirmation response to the upgrade control terminal, so that the upgrade control terminal issues a read version information instruction based on the confirmation response.
[0021] The second handshake subunit is used to feed back the current version information of the user program stored in the user code storage area to the upgrade control terminal when the read version information instruction is received, so that the upgrade control terminal can issue a firmware update request when it determines that the user program needs to be upgraded based on the current version information.
[0022] The third handshake subunit is used to send a positive response indicating a successful handshake to the upgrade control terminal when it determines that the current running state is suitable for online programmable upgrades upon receiving the firmware update request.
[0023] Preferably, the detection and upgrade module includes a second configuration unit, used to configure the microcontroller target board to start from the user code storage area after the programming operation is completed, and then control the microcontroller target board to perform a software reset and restart to complete online programming.
[0024] Preferably, the upgrade unit includes:
[0025] The download subunit is used to parse the firmware data packet when it is received, and to verify and confirm the version of the firmware data packet after parsing. Then, it sends a download result back to the upgrade control terminal.
[0026] The upgrade subunit is used to perform an erase-then-program operation on the user code storage area according to the firmware version size of the firmware data packet when the verification and version confirmation are passed, and to feed back an upgrade burning result to the upgrade control terminal after the programming operation is completed.
[0027] Preferably, the upgrade subunit calls IAP instructions to erase the user code storage area, and after the erasure is completed, calls IAP write instructions to program the user code storage area.
[0028] This invention also provides an in-circuit programmable method for a microcontroller without a BOOT pin, applied to the in-circuit programmable system described above. The in-circuit programmable method includes:
[0029] Step S1: When a firmware upgrade is required, the upgrade control terminal controls the download box to send a fixed sequence to the microcontroller target board.
[0030] Step S2: The microcontroller target board is controlled to reset and enter BOOT mode according to the fixed sequence, and then the BOOTROM firmware is started.
[0031] Step S3: Send upgrade firmware data to the microcontroller target board through the upgrade control terminal;
[0032] Step S4: The microcontroller target board performs an online programmable upgrade of the user code storage area based on the upgraded firmware data.
[0033] The above technical solution has the following advantages or beneficial effects: By reusing the reset pin, communication transmit pin, and communication receive pin as the conditions for entering BOOT mode, the detection and upgrade module configured in the microcontroller target board, in conjunction with the download box, completes the BOOT mode switching, then restores the communication mode of the communication transmit pin and communication receive pin to complete the upgrade download, and calls IAP to complete the erasure and writing, ultimately achieving online programmable upgrade. This effectively solves the problem of entering BOOT mode for microcontrollers without a BOOT pin and thus performing ISP upgrades, improving the efficiency and reducing the cost for users to repeatedly purchase emulators and ISP upgrade tools. At the same time, it effectively reduces the BOOT pin occupation requirements, improves the stability of switching BOOT mode, greatly improves the user upgrade process, and reduces user development costs. Attached Figure Description
[0034] Figure 1A schematic diagram of an online programmable upgrade system for a single-chip microcontroller without a BOOT pin, as a preferred embodiment of the present invention;
[0035] Figure 2 This is a flowchart illustrating an online programmable upgrade method for a microcontroller without a BOOT pin, as a preferred embodiment of the present invention. Detailed Implementation
[0036] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The present invention is not limited to this embodiment; other embodiments that conform to the spirit of the present invention may also fall within the scope of the present invention.
[0037] In a preferred embodiment of the present invention, based on the above-mentioned problems existing in the prior art, an in-circuit programmable upgrade system for a microcontroller without a BOOT pin is provided, such as... Figure 1 As shown, it includes:
[0038] The microcontroller target board 1 has a non-volatile memory 11 including a user code storage area 111 and a boot code storage area 112. The boot code storage area 112 stores the BOOTROM firmware.
[0039] Upgrade control terminal 2 is connected to microcontroller target board 1 through a download box 3. When firmware upgrade is required, upgrade control terminal 2 controls download box 3 to send a fixed sequence to microcontroller target board 1.
[0040] The microcontroller target board 1 also includes a detection and upgrade module 12, which is connected to the non-volatile memory 11. It is used to control the microcontroller target board 1 to reset and enter the BOOT mode according to a fixed sequence, and then control the startup of the BOOTROM firmware to perform online programmable upgrades to the user code storage area 112 according to the upgrade firmware data sent by the upgrade control terminal 2.
[0041] Specifically, in this embodiment, the upgrade control terminal 2 can be a PC loaded with application software, which can be understood as the driver for the download box. The connection interface between the upgrade control terminal 2 and the download box 3 is USB, supporting the USB 2.0 protocol. The BOOTROM firmware preferably includes two parts: a system boot interrupt vector table and BOOTROM upgrade code. The upgrade code includes UART initialization and the communication protocol with the application software, as well as IAP erase, read, and write operations on the Flash memory. It is understood that the system boot interrupt vector table is a standard configuration executed by conventional software, and its specific application is existing technology and not the inventive point of this technical solution; therefore, it will not be elaborated further here.
[0042] Preferably, the download box 3 is equipped with multiple indicator lights to indicate the status during the upgrade process. When the microcontroller target board 1 needs to undergo an ISP firmware upgrade, the download box 3 and the upgrade control terminal 2 are first connected. The application software of the upgrade control terminal 2 is started, and the corresponding port is opened for configuration. Specific configuration parameters can be configured as follows: baud rate to 9600, parity check to odd parity, data bits to 8, and stop bits to 1. Subsequently, through pre-upgrade communication between the upgrade control terminal 2, the download box 3, and the microcontroller target board 1, it can be confirmed whether there are any abnormal logic or wiring errors between the upgrade control terminal 2 and the download box 3, and between the download box 3 and the microcontroller target board 1. These are indicated by corresponding indicator lights. A flashing red light indicates the presence of abnormal logic or wiring errors, while a solid green light indicates normal operation. The aforementioned abnormal logic includes, but is not limited to, abnormal application installation on the upgrade control terminal 2, system incompatibility with the upgrade control terminal 2, or insufficient power supply voltage to the microcontroller target board 1. Preferably, the download box 3 can be configured with corresponding hardware circuits to implement the corresponding functions. More preferably, this hardware circuit can be implemented using an FTDI chip and its peripheral circuits.
[0043] After the upgrade control terminal 2, download box 3, and microcontroller target board 1 are properly connected, when it is necessary to perform an ISP firmware upgrade on microcontroller target board 1, it is first necessary to trigger microcontroller target board 1 to enter BOOT mode. However, microcontroller target board 1 itself does not have a conventional BOOT pin, so it cannot be triggered to enter BOOT mode by configuring the BOOT pin. In this embodiment, the download box 3 sends a fixed sequence to trigger microcontroller target board 1 to enter BOOT mode.
[0044] Specifically, the upgrade control terminal 2 can control the download box 3 to send a fixed sequence to the microcontroller target board 1 during the power-on stabilization and reset hold period after the microcontroller target board 1 is powered on. At this time, since the microcontroller target board 1 is already in a reset state, it can directly enter the BOOT mode after receiving the fixed sequence. In this case, the download box 3 first supplies power to the microcontroller target board 1. After the voltage of the chip power supply pin VDD of the microcontroller target board 1 rises to the supply voltage, the power-on reset signal is valid, the system stably outputs on-chip power supply, and after waiting for the clock to stabilize, the detection upgrade module 12 is started to determine whether the microcontroller target board 1 is started from the user code storage area 111 or the boot code storage area 112. Then, register initialization is performed, including configuring all system registers to initial values and configuring the configuration register config0 to the boot mode.
[0045] Alternatively, the upgrade control terminal 2 can control the download box 3 to send data to the microcontroller target board 1 in its normal operating state after power-on startup and reset. Upon receiving this fixed sequence, the microcontroller target board 1 needs to first reset, and then enter BOOT mode during the reset holding period, satisfying the upgrade requirements of the microcontroller target board 1 in different states. Compared to the existing method of upgrading via serial port commands from LDROM (boot code storage area), this invention can effectively improve system startup time and reduce logical processing errors during incorrect BOOT mode switching, thus improving the stability of ISP upgrades. Compared to the method of booting from APROM (user code storage area), this invention reduces reliance on flow control signals in DB9, reduces erroneous logic during power-on and re-insertion processes, improves stability, and reduces pin requirements.
[0046] In a preferred embodiment of the present invention, the detection upgrade module 12 includes a first configuration unit 121, which is used to configure the microcontroller target board 1 to start from the boot code storage area 112 to enter the BOOT mode after the microcontroller target board 1 is reset according to a fixed sequence, so that the microcontroller target board 1 starts to execute the BOOTROM firmware after the reset is completed.
[0047] Specifically, in this embodiment, the first configuration unit 121 configures the config0 of the microcontroller target board 1 so that the microcontroller target board 1 can start from the boot code storage area 112 to enter BOOT mode.
[0048] In a preferred embodiment of the present invention, the fixed sequence includes at least one upgrade request signal and one upgrade confirmation signal;
[0049] The download box 3 includes an upgrade trigger module 31, which is used to send an upgrade request signal to the microcontroller target board 1, and when it receives a confirmation response signal from the microcontroller target board 1, it sends an upgrade confirmation signal to the microcontroller target board 1 to trigger the microcontroller target board 1 to reset and enter BOOT mode.
[0050] Specifically, in this embodiment, the fixed sequence includes at least one upgrade request signal and at least one upgrade confirmation signal to avoid accidental upgrade triggering and improve the stability of switching BOOT mode.
[0051] In a preferred embodiment of the present invention, the connection interface between the download box 3 and the microcontroller target board 1 has a power supply pin VCC, a reset pin RST, a communication transmit pin UART_TX, a communication receive pin UART_RX and a ground pin GND.
[0052] Download box 3 supplies power to microcontroller target board 1 through power supply pin VCC, and sends upgrade request signal and upgrade confirmation signal through multiplexed reset pin RST, communication transmit pin UART_TX and communication receive pin UART_RX.
[0053] Specifically, in this embodiment, before entering BOOT mode, a fixed sequence is simultaneously transmitted using the reset pin RST, the communication transmit pin UART_TX, and the communication receive pin UART_RX. At this time, the reset pin RST serves both as a condition for entering BOOT mode and as a hardware reset function for the microcontroller target board 1. Based on this, during normal operation after the microcontroller target board 1 powers on and resets, a hardware reset can also be performed upon receiving the fixed sequence. It can be understood that during the upgrade phase after entering BOOT mode, the aforementioned communication transmit pin UART_TX and communication receive pin UART_RX resume their data transmission and reception functions, enabling data interaction between the download box 3 and the microcontroller target board 1. Through pin multiplexing, the BOOT pin requirements are effectively reduced.
[0054] In a preferred embodiment of the present invention, the microcontroller target board 1 further includes an online upgrade module 13, the online upgrade module 13 comprising:
[0055] The handshake unit 131 is used to perform a handshake process with the upgrade control terminal 2 after the BOOTROM firmware is started, and to send a positive response to the upgrade control terminal 2 when the handshake is successful, so that the upgrade control terminal 2 sends a firmware data packet according to the positive response.
[0056] The upgrade unit 132 is used to verify and confirm the firmware data packet when it receives the firmware data packet, and when the verification and version confirmation is successful, to perform an erase and then program operation on the user code storage area 111 according to the firmware version size of the firmware data packet.
[0057] Specifically, in this embodiment, by executing the handshake process of the upgrade control terminal 2 before the upgrade, it can be determined that the communication with the upgrade control terminal 2 is normal, whether the microcontroller target board 1 needs to be upgraded, and whether the current operating state of the microcontroller target board 1 allows the upgrade, and then determine whether to proceed with the next upgrade operation. Based on this, in a preferred embodiment of the present invention, the handshake unit 131 includes:
[0058] The first handshake subunit 1311 is used to start the BOOTROM firmware and, upon receiving a connection establishment request sent by the upgrade control terminal, to send a confirmation response to the upgrade control terminal 2, so that the upgrade control terminal 2 can issue a read version information command based on the confirmation response.
[0059] The second handshake subunit 1312 is used to feed back the current version information of the user program stored in the user code storage area 111 to the upgrade control terminal 2 when it receives the instruction to read version information, so that the upgrade control terminal 2 can issue a firmware update request when it determines that the user program needs to be upgraded based on the current version information.
[0060] The third handshake subunit 1313 is used to send a positive response indicating a successful handshake to the upgrade control terminal 2 when it determines that the current running status is suitable for online programmable upgrades upon receiving a firmware update request.
[0061] Specifically, in this embodiment, when it is determined that the current operating state is that the power is insufficient to support the upgrade, or that important data is being stored, the upgrade can be indicated to the upgrade control terminal 2 by sending the corresponding protocol code. At this time, the application software terminates the firmware version update.
[0062] In a preferred embodiment of the present invention, the detection upgrade module 12 includes a second configuration unit 122, which is used to configure the microcontroller target board 1 to start from the user code storage area 111 after the programming operation is completed, and then control the microcontroller target board 1 to perform a software reset and restart to complete the online programming.
[0063] In a preferred embodiment of the present invention, the upgrade unit 132 includes:
[0064] The download subunit 1321 is used to parse the firmware data packet when it is received, and to verify and confirm the version of the firmware data packet after parsing. Then, it sends a download result back to the upgrade control terminal 2.
[0065] The upgrade subunit 1322 is used to perform an erase-then-program operation on the user code storage area 111 according to the firmware version size of the firmware data packet when the verification and version confirmation is passed, and to feed back an upgrade burning result to the upgrade control terminal 2 after the programming operation is completed.
[0066] Specifically, in this embodiment, after the handshake process confirms that the communication between the microcontroller target board 1 and the upgrade control terminal 2 is normal, and that the microcontroller target board 1 needs to be upgraded and the upgrade is currently allowed, the application program of the upgrade control terminal 2 loads the firmware data package to be upgraded and sends it to the microcontroller target board 1 through the download box 3. This firmware data package can be a firmware hex file or a bin file. It is understood that the above-mentioned parsing, verification, and version confirmation of the firmware data package are conventional technical means, and the specific process will not be described in detail here.
[0067] In a preferred embodiment of the present invention, the upgrade subunit 1322 calls the IAP instruction to perform an erase operation on the user code storage area 111, and after the erase is completed, calls the IAP write instruction to perform a programming operation on the user code storage area 111.
[0068] Specifically, in this embodiment, after the IAP write instruction is called to perform programming operations on the user code storage area 111, a read verification operation is also performed on the user code storage area 111 to confirm the correctness of the written data, and then a software reset and restart is performed to complete the upgrade.
[0069] This invention also provides an in-circuit programmable method for a microcontroller without a BOOT pin, applicable to in-circuit programmable systems, such as... Figure 2 As shown, online programming methods include:
[0070] Step S1: When a firmware upgrade is required, the download box is controlled by the upgrade control terminal to send a fixed sequence to the microcontroller target board.
[0071] Step S2: The microcontroller target board is controlled to reset and enter BOOT mode according to a fixed sequence, and then the BOOTROM firmware is started.
[0072] Step S3: Send upgrade firmware data to the microcontroller target board via the upgrade control terminal;
[0073] Step S4: The microcontroller target board performs an online programmable upgrade of the user code storage area based on the upgraded firmware data.
[0074] The above description is merely a preferred embodiment of the present invention and does not limit the implementation and protection scope of the present invention. Those skilled in the art should realize that any equivalent substitutions and obvious changes made using the content of this specification and illustrations should be included within the protection scope of the present invention.
Claims
1. An in-system programmable upgrade system for a single-chip microcontroller without a BOOT pin, characterized in that, include: A microcontroller target board, wherein a non-volatile memory of the microcontroller target board includes a user code storage area and a boot code storage area, wherein the boot code storage area stores BOOTROM firmware; The upgrade control terminal is connected to the microcontroller target board via a download box. When a firmware upgrade is required, the upgrade control terminal controls the download box to send a fixed sequence to the microcontroller target board in its normal working state after power-on reset. The microcontroller target board also includes a detection and upgrade module connected to the non-volatile memory. It is used to control the microcontroller target board to reset and enter BOOT mode according to the fixed sequence, and then control the startup of the BOOTROM firmware to perform online programmable upgrades to the user code storage area according to the upgrade firmware data sent by the upgrade control terminal. The fixed sequence includes at least one upgrade request signal and one upgrade confirmation signal; The connection interface between the download box and the microcontroller target board has a power pin, a reset pin, a communication transmit pin, a communication receive pin, and a ground pin. The download box supplies power to the microcontroller target board through the power pin, and sends the upgrade request signal and the upgrade confirmation signal by multiplexing the reset pin, the communication transmit pin and the communication receive pin.
2. The online programmable upgrade system according to claim 1, characterized in that, The detection and upgrade module includes a first configuration unit, which is used to configure the microcontroller target board to start from the boot code storage area to enter the BOOT mode after the microcontroller target board is reset according to the fixed sequence, so that the microcontroller target board starts to execute the BOOTROM firmware after the reset is completed.
3. The online programmable upgrade system according to claim 1 or 2, characterized in that, The download box includes an upgrade trigger module, which is used to send the upgrade request signal to the microcontroller target board, and when it receives a confirmation response signal from the microcontroller target board, it sends the upgrade confirmation signal to the microcontroller target board to trigger the microcontroller target board to reset and enter the BOOT mode.
4. The online programmable upgrade system according to claim 1, characterized in that, The microcontroller target board also includes an online upgrade module, which includes: The handshake unit is used to perform a handshake process with the upgrade control terminal after the BOOTROM firmware is started, and to send a positive response to the upgrade control terminal when the handshake is successful, so that the upgrade control terminal sends a firmware data packet according to the positive response. The upgrade unit is used to perform verification and version confirmation on the firmware data packet when it receives the firmware data packet, and when the verification and version confirmation is successful, to perform an erase-and-program operation on the user code storage area according to the firmware version size of the firmware data packet.
5. The online programmable upgrade system according to claim 4, characterized in that, The handshake unit includes: The first handshake subunit is used to start the BOOTROM firmware and, upon receiving a connection establishment request sent by the upgrade control terminal, to send a confirmation response to the upgrade control terminal, so that the upgrade control terminal issues a read version information instruction based on the confirmation response. The second handshake subunit is used to feed back the current version information of the user program stored in the user code storage area to the upgrade control terminal when the read version information instruction is received, so that the upgrade control terminal can issue a firmware update request when it determines that the user program needs to be upgraded based on the current version information. The third handshake subunit is used to send a positive response indicating a successful handshake to the upgrade control terminal when it determines that the current running state is suitable for online programmable upgrades upon receiving the firmware update request.
6. The online programmable upgrade system according to claim 4, characterized in that, The detection and upgrade module includes a second configuration unit, which is used to configure the microcontroller target board to start from the user code storage area after the programming operation is completed, and then control the microcontroller target board to perform a software reset and restart to complete the online programming.
7. The online programmable upgrade system according to claim 4, characterized in that, The upgrade unit includes: The download subunit is used to parse the firmware data packet when it is received, and to verify and confirm the version of the firmware data packet after parsing. Then, it sends a download result back to the upgrade control terminal. The upgrade subunit is used to perform an erase-then-program operation on the user code storage area according to the firmware version size of the firmware data packet when the verification and version confirmation are passed, and to feed back an upgrade burning result to the upgrade control terminal after the programming operation is completed.
8. The online programmable upgrade system according to claim 7, characterized in that, The upgrade subunit calls the IAP instruction to erase the user code storage area, and after the erasure is completed, calls the IAP write instruction to program the user code storage area.
9. An in-circuit programmable method for a microcontroller without a BOOT pin, characterized in that, Applied to the online programmable system as described in any one of claims 1-8, the online programmable method comprises: Step S1: When a firmware upgrade is required, the download box is controlled by the upgrade control terminal to send a fixed sequence to the microcontroller target board in the normal working state after the microcontroller target board is powered on and reset. Step S2: The microcontroller target board is controlled to reset and enter BOOT mode according to the fixed sequence, and then the BOOTROM firmware is started. Step S3: Send upgrade firmware data to the microcontroller target board through the upgrade control terminal; Step S4: The microcontroller target board performs an online programmable upgrade of the user code storage area based on the upgraded firmware data.
Citation Information
Patent Citations
Circuit breaker controller, software upgrading method thereof and circuit breaker
CN105260212A
Method for downloading firmware by chip and chip
CN111758088A
An online program upgrading method and electronic equipment
CN113407218A