USB flash disk online upgrading method and device based on STM32 and readable medium
Through the automated upgrade method of STM32 and USB flash drive, the problem of complex and space limitations of equipment firmware upgrade operations is solved, and efficient and intelligent firmware upgrade of equipment in small spaces is achieved.
Patent Information
- Application Number
- CN202411297901.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-13
AI Technical Summary
The existing online upgrade method relies on computer operations to be complex and difficult to implement in a small space, and cannot meet the urgent needs of device firmware upgrades.
The STM32-based USB flash drive online upgrade method is adopted to establish communication with the USB flash drive through the Bootloader program, read and write firmware programs or data, realize automatic upgrade of the device, simplify the operation process, and is suitable for small spaces.
It realizes the simple and rapid upgrade of the equipment firmware, reduces maintenance costs, is suitable for environments that are small or are not conducive to the use of computers, and improves upgrade efficiency and intelligence.
Smart Images

Figure CN119127258A_ABST
Abstract
Description
Background Art
[0002] With the rapid development of Internet of Things (IoT) technology, embedded devices are widely used in various industries, from smart homes to industrial automation to medical equipment. The demand for firmware upgrades for these devices is becoming increasingly urgent. Although the traditional serial port + host computer online upgrade (IAP) solution meets the basic needs to a certain extent, it gradually reveals the following defects in actual applications:
[0003] 1. Operational complexity: It requires professional technicians to operate, and it is difficult for ordinary users to get started, which increases training costs and maintenance difficulties. The upgrade process involves multiple steps, such as connecting the serial port, configuring the software, uploading the firmware, etc. The operation is cumbersome and prone to errors.
[0004] 2. Environmental limitations: It relies on computers and is difficult to implement in small spaces or in some special spaces that are not conducive to the use of computers.
[0005] Therefore, there is an urgent need to develop a more intelligent and efficient upgrade method that does not rely on computers and is suitable for small spaces. Summary of the invention
[0006] In order to overcome the problems that the existing online upgrade method relies on computer implementation, is relatively complicated to operate and cannot be used in a small space, the present invention provides a USB flash drive online upgrade method, device and readable medium based on STM32.
[0007] The technical solution of the present invention is as follows:
[0008] In a first aspect, the present invention provides a USB flash drive online upgrade method based on STM32, comprising the following steps:
[0009] Step S1, system power-on initialization or reset;
[0010] Step S2, running the Bootloader program, and the Bootloader program determines whether there is a new program or data update requirement transmitted via the USB flash drive;
[0011] Step S3: If there is an update requirement, proceed to step S4; if there is no update requirement, proceed to step S5;
[0012] Step S4: the system performs corresponding update operations;
[0013] Step S5: The system command jumps to the application section and continues to execute the standard application logic.
[0014] As a preferred solution of the present invention, step S4 includes the following sub-steps:
[0015] Step S401, the Bootloader program establishes communication with the USB flash drive through the USB interface;
[0016] Step S402: The Bootloader program reads the firmware program or data in the USB flash drive, and displays the read firmware program or data on the human-computer interaction page of the device;
[0017] Step S403, the Bootloader program erases the existing corresponding firmware program or data in the non-volatile memory of the STM32 microcontroller according to the firmware program or data selected by the user;
[0018] Step S404, the Bootloader program writes the firmware program or data selected by the user into the non-volatile memory of the STM32 microcontroller;
[0019] In step S405, the system checks whether the writing is successful; if successful, proceed to step S5; if unsuccessful, then proceed to step S402.
[0020] As a preferred solution of the present invention, in step S401, the STM32 microcontroller is configured as a USB host mode, and drives the USB flash drive through a USB driver circuit.
[0021] As a preferred embodiment of the present invention, the USB driving circuit includes a USB interface, a resettable fuse F2, an ESD electrostatic protection component D3, a capacitor C31, a resistor R40 and a resistor R41, the VCC pin of the USB interface is respectively connected to one end of the capacitor C31, one end of the resettable fuse F2 and the VBUS voltage, the other end of the capacitor C31 is grounded, the other end of the resettable fuse F2 is connected to the USB_5V voltage, the D- pin of the USB interface is connected to the sixth pin of the ESD electrostatic protection component D3, the D+ pin of the USB interface is connected to the fourth pin of the ESD electrostatic protection component D3, the GND pin of the USB interface is grounded, the first pin of the ESD electrostatic protection component D3 is connected to the USB_OTG_D- pin of the STM32 microcontroller after passing through the resistor R41, the third pin of the ESD electrostatic protection component D3 is connected to the USB_OTG_D+ pin of the STM32 microcontroller after passing through the resistor R40, the second pin of the ESD electrostatic protection component D3 is connected to the VBUS voltage, and the fifth pin of the ESD electrostatic protection component D3 is grounded.
[0022] As a preferred solution of the present invention, in step S401, the STM32 microcontroller configures and writes a USB flash drive driver through the STM32CubeMX tool to process the enumeration and connection of the USB flash drive through the USB flash drive driver.
[0023] As a preferred solution of the present invention, configuring and writing a USB drive driver through the STM32CubeMX tool includes the following steps:
[0024] Step A1. Select the appropriate STM32 microcontroller model in STM32CubeMX.
[0025] Step A2, configure the system clock, interrupt, debug interface, USB host interface and GPIO peripherals;
[0026] Step A3, STM32CubeMX automatically generates the underlying driver code based on the selected STM32 microcontroller model and configuration;
[0027] Step A4: Export the generated underlying driver code and integrate it into the project structure;
[0028] Step A5: Customize the automatically generated underlying driver code according to the specific requirements of the project.
[0029] As a preferred solution of the present invention, configuring and writing the USB drive driver through the STM32CubeMX tool also includes the following steps:
[0030] Step A6: Use the J-Link simulator to deeply check the code operation status;
[0031] Step A7: Experiment of performing read and write operations on the USB flash drive;
[0032] Step A8: Based on the data feedback from repeated tests, the code is comprehensively optimized, iterated and improved.
[0033] As a preferred solution of the present invention, configuring and writing the USB drive driver through the STM32CubeMX tool also includes the following steps:
[0034] Step A9: Setting error and exception handling logic;
[0035] Step A10: Develop advanced features, including USB file management system and formatting functions.
[0036] In a second aspect, the present invention provides a USB flash drive online upgrade device based on STM32, comprising:
[0037] at least one processor; and
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the STM32-based USB flash drive online upgrade method described in any of the above solutions.
[0040] In a third aspect, the present invention provides a computer-readable medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the above-mentioned STM32-based USB flash drive online upgrade method.
[0041] The present invention according to the above scheme has the following beneficial effects:
[0042] The present invention adopts the upgrade mode of U disk + device. It only needs to put the new firmware program or data into the U disk through a mobile phone, a computer or other terminal devices, and then insert the U disk into the device, and select the upgrade object for upgrading through the buttons and knobs of the device. The operation is simple and convenient, and no other tools are needed. Even non-professional personnel can easily operate successfully under the guidance and prompts of the human-computer interaction page. The IAP technology cooperates with the transmission scheme of the USB flash disk to open up a path for the development of a more intelligent and efficient upgrade method, and also reduces the maintenance cost of the equipment. The main application scenario is that in some small spaces or in some special spaces that are not conducive to the use of computers, only a U disk is needed to upgrade the device online. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of a method for online upgrading using a USB flash drive based on STM32 in one embodiment of the present invention;
[0044] Figure 2 for Figure 1 Specific flow diagram of step S4;
[0045] Figure 3 is a circuit diagram of a USB driving circuit in one embodiment of the present invention;
[0046] Figure 4 A schematic diagram of a specific process of configuring and writing a USB drive program by using the STM32CubeMX tool in one embodiment of the present invention;
[0047] Figure 5 The following is a schematic diagram of a specific process of configuring and writing a USB drive program by using the STM32CubeMX tool in another embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0049] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0050] Please refer to Figure 1 This embodiment provides a USB flash drive online upgrade method based on STM32, comprising the following steps:
[0051] Step S1: The system is powered on and initialized or reset.
[0052] Step S2, run the Bootloader program, and the Bootloader program determines whether there is a new program or data update requirement transmitted via the USB flash drive. The user can copy the new firmware program (BIN file) or data into the USB flash drive through a terminal device such as a computer or mobile phone. In addition, the new program or data needs to be placed in the root directory of the USB flash drive (the firmware program or data cannot be copied), otherwise the system will not be able to scan the new firmware program (BIN file) or data.
[0053] Step S3: If there is an update requirement, proceed to step S4; if there is no update requirement, proceed to step S5.
[0054] Step S4: The system performs corresponding update operations.
[0055] Step S5, the system command jumps to the application section and continues to execute the standard application logic. This step involves a jump mechanism. Under the framework of IAP technology, it is necessary to achieve smooth switching between the Bootloader program and the application. Specifically, once the Bootloader program completes its update task, the next key step is to turn to the application and start the execution process of the new code. Conversely, if the application needs to perform an IAP operation, it is also necessary to reversely transfer control to the Bootloader program area to ensure that the operation is smoothly implemented. This method ensures the seamless connection and execution of functions between different program modules.
[0056] Please refer to Figure 2 In one embodiment, step S4 includes the following sub-steps:
[0057] Step S401: The Bootloader program establishes communication with the USB flash drive via the USB interface.
[0058] Step S402: The Bootloader program reads the firmware program or data in the USB flash drive, and displays the read firmware program or data on the human-computer interaction page of the device.
[0059] Step S403: The Bootloader program erases the existing corresponding firmware program or data in the non-volatile memory of the STM32 microcontroller according to the firmware program or data selected by the user. For example, the user can select the required firmware program or data through the arrow keys or knobs on the device keyboard.
[0060] Step S404: The Bootloader program writes the firmware program or data selected by the user into the non-volatile memory of the STM32 microcontroller.
[0061] In step S405, the system checks whether the writing is successful; if successful, proceed to step S5; if unsuccessful, then proceed to step S402.
[0062] In one embodiment, the STM32 microcontroller is configured as a USB host mode and drives the USB flash drive through a USB driver circuit.
[0063] Please refer to Figure 3Specifically, the USB driving circuit includes a USB interface, a resettable fuse F2, an ESD electrostatic protection component D3, a capacitor C31, a resistor R40 and a resistor R41, the VCC pin of the USB interface is respectively connected to one end of the capacitor C31, one end of the resettable fuse F2 and the VBUS voltage, the other end of the capacitor C31 is grounded, the other end of the resettable fuse F2 is connected to the USB_5V voltage, the D- pin of the USB interface is connected to the sixth pin of the ESD electrostatic protection component D3, the D+ pin of the USB interface is connected to the fourth pin of the ESD electrostatic protection component D3, the GND pin of the USB interface is grounded, the first pin of the ESD electrostatic protection component D3 is connected to the USB_OTG_D- pin of the STM32 microcontroller after passing through the resistor R41, the third pin of the ESD electrostatic protection component D3 is connected to the USB_OTG_D+ pin of the STM32 microcontroller after passing through the resistor R40, the second pin of the ESD electrostatic protection component D3 is connected to the VBUS voltage, and the fifth pin of the ESD electrostatic protection component D3 is grounded. The above-mentioned USB drive circuit adds a self-resetting fuse F2. When the U disk is damaged or a foreign object causes a power short circuit in the U disk interface, the power supply can be cut off in time to protect the drive circuit and other power circuits; by adding an ESD electrostatic protection component D3, the USB interface is protected to prevent the USB interface from being damaged by ESD (electrostatic discharge).
[0064] It should be noted that since USB communication uses differential signals, differential pairs are used for routing in the USB driver circuit design. If the two lines are of different lengths, serpentine routing is required to ensure the symmetry of the two lines within a reasonable error to reduce signal distortion and noise interference.
[0065] In a specific embodiment, the type of the resettable fuse F2 is L050 / 16AR. The type of the resettable fuse F2 can not only isolate and protect the power supply, but also prevent the interference of power supply noise on USB communication.
[0066] In one embodiment, in step S401, the STM32 microcontroller configures and writes a USB flash drive driver through the STM32CubeMX tool to process the enumeration and connection of the USB flash drive through the USB flash drive driver.
[0067] STM32CubeMX is a graphical software configuration tool provided by STMicroelectronics, which is designed for the STM32 microcontroller and microprocessor series. Through STM32CubeMX, users can easily configure their projects, including selecting the correct MCU model, configuring the MCU's peripherals (such as GPIO, USART, I2C, SPI, USB, CAN, etc.), setting interrupt priorities, clock sources and clock trees, and configuring power management.
[0068] USB enumeration is actually the process in which the host (master device) detects the insertion of the device (slave device) and sends various standard requests to ask the device to return various USB descriptors. When the USB flash drive is inserted into the USB host interface, the host will send a series of standard requests to the USB flash drive, requesting it to return various USB descriptors (such as device descriptors, configuration descriptors, interface descriptors, etc.).
[0069] After the enumeration is completed, the code detects the insertion and removal events of the USB flash drive, and initializes the USB interface to establish communication with the USB flash drive to achieve the mounting and unmounting functions of the USB flash drive. Specifically, when the USB flash drive is detected to be inserted, the USB interface is initialized and communication is established with the USB flash drive, and its partition table and file system information are read and mapped to the memory space of the STM32 to achieve mounting. When the USB flash drive is removed, the relevant resources are released to achieve unloading.
[0070] See also Figure 4 Specifically, configuring and writing the USB driver through the STM32CubeMX tool includes the following steps:
[0071] Step A1. Select the appropriate STM32 microcontroller model in STM32CubeMX.
[0072] Step A2, configure the system clock, interrupt, debug interface, USB host interface and GPIO and other peripherals. These peripheral configurations ensure that the STM32 microcontroller can communicate correctly with USB flash drives. When configuring, pay special attention to the clock speed and pin assignment of the USB host interface, because USB communication requires strict timing and correct physical connection. The 48MHz clock frequency is one of the requirements of the USB 2.0 standard to ensure the stability and speed of data transmission.
[0073] Step A3: STM32CubeMX automatically generates low-level driver code based on the selected STM32 microcontroller model and configuration. The low-level driver code includes the basic framework required to initialize peripherals, configure interrupts, and handle USB communications.
[0074] Step A4: Export the generated underlying driver code and integrate it into the project structure. At the same time, you need to ensure that the project can correctly identify and include these code files (.c and .h).
[0075] Step A5: Customize the automatically generated underlying driver code according to the specific needs of the project, so as to perfectly match the specific needs of the project. Customized adjustments include a series of underlying programming work such as customization of USB interface function mode and implementation of interrupt callback function, aiming to optimize and enhance the USB interaction capability of the system.
[0076] In the above steps, with the assistance of STM32CubeMX, users can configure MCU peripherals such as GPIO, USART, USB, etc. by simply clicking and dragging, without having to manually write tedious register configuration code, which can greatly simplify the configuration and code generation process and reduce the difficulty of development.
[0077] See also Figure 5 In one embodiment, configuring and writing a USB driver through the STM32CubeMX tool also includes the following steps:
[0078] Step A6: Use the J-Link emulator to deeply test the code operation status. The J-Link emulator can provide precise control and debugging capabilities to help developers locate potential problems, thereby ensuring that the USB drive driver operates smoothly and can successfully realize the identification and connection functions with the USB drive.
[0079] Step A7: Perform a read and write operation experiment on the USB flash drive to verify the performance stability and functionality of the USB flash drive driver.
[0080] Step A8: Based on the data feedback from repeated tests, the code is comprehensively optimized, iterated and improved to further improve performance and stability. On this basis, the focus is on enhancing the robustness of the USB driver and improving the speed and reliability of the STM32 processor when processing USB disk file reading and writing tasks.
[0081] Step A9: Set up error and exception handling logic to deal with emergencies such as accidental removal of the USB flash drive, data access conflicts, or read and write errors, and build a solid defense system.
[0082] Step A10: On the basis of stable basic functions, further develop advanced features, such as USB file management system, formatting function, etc., to meet a wider range of practical needs. By integrating these advanced features, the depth and breadth of project functions can be expanded, and the overall value and practicality of the project can be improved.
[0083] The above steps, through in-depth inspection, performance verification, code optimization, error handling and function expansion, ensure the reliability, stability and practicality of the USB flash drive driver, laying a solid foundation for the successful implementation of the project.
[0084] To sum up, the U disk online upgrade method based on STM32 provided in this embodiment adopts the upgrade method of U disk + device. It only needs to put the new firmware program or data into the U disk through a mobile phone, computer or other terminal devices, and then insert the U disk into the device, and select the upgrade object for upgrading through the buttons and knobs of the device; the operation is simple and convenient, and no other tools are required. Even non-professional personnel can easily operate successfully under the guidance and prompts of the human-computer interaction page; IAP technology cooperates with the transmission scheme of USB flash disk to open up a path for the development of more intelligent and efficient upgrade methods, and also reduces the maintenance cost of the equipment; the main application scenario of this method is that in some small spaces or in some special spaces that are not conducive to the use of computers, only a U disk is needed to upgrade the device online.
[0085] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0086] According to the modules, submodules, units, and subunits of the present embodiment, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules, submodules, units, and subunits of the present embodiment, any one or more thereof can be split into multiple modules for implementation. According to the modules, submodules, units, and subunits of the present embodiment, any one or more thereof can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in any appropriate combination of any of them. Alternatively, according to the modules, submodules, units, and subunits of the present embodiment, one or more thereof can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0087] In one embodiment, the present invention provides a USB flash drive online upgrade device based on STM32, which may include at least one processing unit and at least one storage unit. The storage unit stores program code, and when the program code is executed by the processing unit, the processing unit executes the steps of the USB flash drive online upgrade based on STM32 according to various exemplary embodiments of the present invention described above in this specification. For example, the processing unit may execute the following steps: Figure 1The process of the USB online upgrade method based on STM32 is shown.
[0088] In one embodiment, the present invention provides a computer-readable medium storing computer-executable instructions for executing the steps of the STM32-based USB flash drive online upgrade method according to various exemplary embodiments of the present invention described above in this specification.
[0089] The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. The readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a readable program code is carried. The readable signal medium can also be any readable medium other than a readable storage medium, which can send, propagate or transmit a program used by an instruction execution system, device or device or used in combination with it. The program code contained on the readable medium can be transmitted with any appropriate medium, including - but not limited to - wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0090] In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0091] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.
[0092] The above is an exemplary description of the present invention in conjunction with the accompanying drawings. It is obvious that the implementation of the present invention is not limited to the above-mentioned method. As long as various improvements are made by adopting the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.
Claims
1. A USB flash drive online upgrade method based on STM32, characterized in that: The following steps are involved: Step S1, system power-on initialization or reset; Step S2, running the Bootloader program, and the Bootloader program determines whether there is a new program or data update requirement transmitted via the USB flash drive; Step S3: If there is an update requirement, proceed to step S4; if there is no update requirement, proceed to step S5; Step S4: the system performs corresponding update operations; Step S5: The system command jumps to the application section and continues to execute the standard application logic.
2. The USB flash drive online upgrade method based on STM32 according to claim 1, characterized in that, Step S4 includes the following sub-steps: Step S401, the Bootloader program establishes communication with the USB flash drive through the USB interface; Step S402: The Bootloader program reads the firmware program or data in the USB flash drive, and displays the read firmware program or data on the human-computer interaction page of the device; Step S403, the Bootloader program erases the existing corresponding firmware program or data in the non-volatile memory of the STM32 microcontroller according to the firmware program or data selected by the user; Step S404, the Bootloader program writes the firmware program or data selected by the user into the non-volatile memory of the STM32 microcontroller; Step S405, the system checks whether the writing is successful; if successful, proceed to step S5; If unsuccessful, then proceed to step S402.
3. The USB flash drive online upgrade method based on STM32 according to claim 2, characterized in that, In step S401, the STM32 microcontroller is configured as a USB host mode and drives the USB flash drive through a USB driver circuit.
4. The USB flash drive online upgrade method based on STM32 according to claim 3, characterized in that, The USB driving circuit includes a USB interface, a resettable fuse F2, an ESD electrostatic protection component D3, a capacitor C31, a resistor R40 and a resistor R41. The VCC pin of the USB interface is respectively connected to one end of the capacitor C31, one end of the resettable fuse F2 and the VBUS voltage, the other end of the capacitor C31 is grounded, the other end of the resettable fuse F2 is connected to the USB_5V voltage, the D- pin of the USB interface is connected to the sixth pin of the ESD electrostatic protection component D3, the D+ pin of the USB interface is connected to the fourth pin of the ESD electrostatic protection component D3, the GND pin of the USB interface is grounded, the first pin of the ESD electrostatic protection component D3 is connected to the USB_OTG_D- pin of the STM32 microcontroller after passing through the resistor R41, the third pin of the ESD electrostatic protection component D3 is connected to the USB_OTG_D+ pin of the STM32 microcontroller after passing through the resistor R40, the second pin of the ESD electrostatic protection component D3 is connected to the VBUS voltage, and the fifth pin of the ESD electrostatic protection component D3 is grounded.
5. The USB flash drive online upgrade method based on STM32 according to claim 3, characterized in that, In step S401, the STM32 microcontroller configures and writes a USB flash drive driver through the STM32CubeMX tool to process the enumeration and connection of the USB flash drive through the USB flash drive driver.
6. The USB flash drive online upgrade method based on STM32 according to claim 5, characterized in that, Configuring and writing the USB driver through the STM32CubeMX tool includes the following steps: Step A1. Select the appropriate STM32 microcontroller model in STM32CubeMX. Step A2, configure the system clock, interrupt, debug interface, USB host interface and GPIO peripherals; Step A3, STM32CubeMX automatically generates the underlying driver code based on the selected STM32 microcontroller model and configuration; Step A4: Export the generated underlying driver code and integrate it into the project structure; Step A5: Customize the automatically generated underlying driver code according to the specific requirements of the project.
7. The USB flash drive online upgrade method based on STM32 according to claim 6, characterized in that, Configuring and writing the USB driver through the STM32CubeMX tool also includes the following steps: Step A6: Use the J-Link simulator to deeply check the code operation status; Step A7: Experiment of performing read and write operations on the USB flash drive; Step A8: Based on the data feedback from repeated tests, the code is comprehensively optimized, iterated and improved.
8. The USB flash drive online upgrade method based on STM32 according to claim 7, characterized in that, Configuring and writing the USB driver through the STM32CubeMX tool also includes the following steps: Step A9: Setting error and exception handling logic; Step A10: Develop advanced features, including USB file management system and formatting functions.
9. A USB flash drive online upgrade device based on STM32, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the STM32-based USB flash drive online upgrade method as described in any one of claims 1 to 8.
10. A computer-readable medium storing computer-executable instructions, characterized in that: The computer executable instructions are used to execute the STM32-based USB flash drive online upgrade method as described in any one of claims 1 to 8.
Citation Information
Cited By
Embedded firmware upgrading method and device, equipment and medium
CN121957628A
