Achievement of single chip microcomputer firmware upgrading method based on network

A firmware upgrade and single-chip microcomputer technology, which is applied in the computer field, can solve problems such as the difficulty of upgrading and maintaining single-chip microcomputer application systems, and achieve the effects of improving convenience, good economic benefits, and easy promotion

Inactive Publication Date: 2015-12-30
INSPUR QILU SOFTWARE IND
3 Cites 29 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0003] The software maintenance and upgrading of single-chip microcomputer hardware products need manual on-site programming or replacement of the latest firmware chip...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

[0056] ENC28J60 is a standard serial peripheral interface (SerialPeripheralInterface, SPI) Ethernet control chip, it provides an internal DMA module, so that it has fast data throughput, IP checksum support hardware and calculation. Through the SPI protocol interface to communicate with the single-chip controller, its Ethernet physical layer device (PHY) and media access ...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention discloses the achievement of a single chip microcomputer firmware upgrading method based on a network, wherein the specific achievement process comprises the following steps of firstly designing memory address space of a BootLoader program and a user program in an internal memory of a single chip microcomputer; programming the BootLoader program by utilization of a JTAG (Joint Test Action Group) interface or an emulator, wherein the BootLoader program has module functions of reading, writing and erasing memory data, jumping program addresses and downloading network data; writing the BootLoader program in an on-chip Flash; erasing and writing an on-chip user program in the single chip microcomputer through the BootLoader program so as to realize remote upgrading and operation of the user program in the on-chip Flash. Compared with the prior art, the achievement of the single chip microcomputer firmware upgrading method based on the network has the advantages that the remote upgrading of the system firmware of the single chip microcomputer is realized, the convenience of the product firmware upgrading is improved, the system maintenance cost can be reduced at the same time, better economic benefits can be produced, and the effects of higher actual engineering application values, strong practicability, wide application range and easiness in popularization are achieved.

Application Domain

Technology Topic

Memory addressMicrocomputer +8

Image

  • Achievement of single chip microcomputer firmware upgrading method based on network
  • Achievement of single chip microcomputer firmware upgrading method based on network
  • Achievement of single chip microcomputer firmware upgrading method based on network

Examples

  • Experimental program(1)

Example Embodiment

[0044] Specific examples:
[0045] The present invention mainly adopts STM32F103xx series single-chip microcomputer and ENC28J60 Ethernet control chip to design a method with BootLoader function and remote firmware update through a network interface, and its design principle and implementation process are described in detail.
[0046] Take advantage of the STM32F103xx series microcontroller self-reading and writing on-chip program space characteristics, first write the BootLoader program in the on-chip Flash, and then use the BootLoader program to erase and write the on-chip user program of the single-chip microcomputer, without the traditional emulator and JTAG interface Ways to do programming work.
[0047] STM32F103xx series microcontrollers are based on the ARMCortex-M3 core and are designed for high-performance, low-cost, and low-power embedded applications. It has a clock frequency of up to 72MHz, on-chip integrated 32-512KB Flash memory, which can be used to store programs and data, 6-64KB SRAM memory, can be read and written at clock speed, up to 112 fast IO ports, and can be read from flash memory Features such as space execution code. The start address of the internal flash memory (FLASH) of the STM32F103xx series single-chip microcomputer is 0x08000000, and the program file is generally written from this address. The start address of the "interrupt vector table" is 0x08000004. After the MCU is powered on or reset, its PC pointer will point to the start address of the interrupt vector table, read the start address of the reset interrupt function, and after the reset interrupt function is executed, jump to the main function of the user program main (void) To complete the startup process.
[0048] The BootLoader program is the program that is executed first after the microcontroller is powered on/reset. Its main function is to complete the hardware initialization, firmware upgrade operations and jump to the user program space to run. First, the internal memory address space of the MCU is divided into BootLoader program area and user program area. The start address range of BootLoader program space area is set to: 0x08000000-0x0800FFFF (64Kbyte), and the start address of user program space area is: 0x08010000—maximum The space address, that is, the offset is 0x10000 (64Kbyte), and the BootLoader program file is written from the start address 0x08000000 of the internal flash memory (FLASH) of the microcontroller. After the microcontroller is powered on/reset, it still fetches the reset interrupt vector address from the address 0x08000004 and jumps to the reset interrupt service routine. After the reset interrupt function is executed, it jumps to the main function main (void) of the BootLoader program. And in the main (void) function to check whether the firmware needs to be upgraded, if the firmware version does not need to be upgraded, it will directly jump to the start address of the user program space to run. If the firmware version needs to be upgraded, use the uIP protocol stack to download the firmware from the server. Binary data, stored in the on-chip SRAM after verification, then erase the existing user program space area, and write the firmware data in the SRAM memory from the user program space starting address 0x08010000, and jump to the user after the write is successful The program space start address is executed. Such as figure 1 , Figure 4 Shown.
[0049] After the MCU is powered on/reset, the PC pointer is positioned at the "interrupt vector table", the reset interrupt vector address is taken out, the reset interrupt program is executed, and then jumps to the main function main (void) of BootLoader to perform firmware detection and update operations .
[0050] After the BootLoader program is executed, it jumps to the start address of the user program space, takes out the reset interrupt vector address in the user program, and jumps to the reset interrupt service routine in the user program.
[0051] After the reset in the user program interrupts the program execution, it jumps to the main function of the user program main (void) for execution.
[0052] During the execution of the main function main (void) of the user program, if the CPU gets an interrupt request, the PC pointer will forcibly jump to the address 0x08000004 interrupt vector table.
[0053] According to the interrupt vector table offset 0x10000 (64Kbyte) set in the user program, jump to the interrupt function in the corresponding user program.
[0054] After executing the relevant user interrupt request, the program returns to the interruption of the main function main (void) of the user program to continue running.
[0055] Hardware interface circuit design.
[0056] ENC28J60 is an Ethernet control chip with a standard serial peripheral interface (SerialPeripheralInterface, SPI). It provides an internal DMA module to enable it to have fast data throughput and support hardware IP checksum calculation. It communicates with the microcontroller controller through the SPI protocol interface. Its Ethernet physical layer device (PHY) and media access controller (MAC) can achieve a transmission rate of 10Mbps, and it also has an LED indicator function for network activity status. Such as figure 2 As shown, SO, SI, SCK of ENC28J60 are respectively connected with SPI serial bus MISO, MOSI, CLK, NSS of STM32F103XX series single-chip microcomputer. They are interrupt output pins and device reset input. Low level is active.
[0057] System software design.
[0058] STM32F103xx series single-chip on-chip memory programs are mainly divided into two categories: BootLoader programs and user applications. The BootLoader program includes network TCP/IP communication, Flash programming, address jump and other modules. The program file is generally written from the internal flash memory (FLASH) starting address 0x08000000 through the JTAG interface or the emulator. After completion, the BootLoader program area Set to write protection to prohibit programming or erasing operations in this area. The user application program only needs to simply change the start address of the compiler and set the offset of the interrupt vector table to ensure normal interruption and operation after it is written into the microcontroller.
[0059] uIP protocol stack realizes TCP/IP communication.
[0060] The ENC28J60 hardware chip provides the physical layer and the MAC layer, and uses the SPI protocol for data communication. The single-chip microcomputer controls the ENC28J60 hardware to send and receive data packets through the SPI interface, and then implements the network layer and transport layer protocols through the protocol stack, and transfers the original Ethernet data packets to data Resolve. uIP is an open source code provided for the establishment of TCP/IP protocol for embedded processors. It contains protocol functions such as ARP, IP, ICMP, TCP, and UDP, and realizes the communication between upper-level applications and underlying hardware. The uIP protocol stack is implemented in standard C language, which can be transplanted to run on STM32F103xx series single-chip computers. Such as image 3 As shown, it mainly describes the execution flow of the uIP protocol stack receiving remote server firmware data in the single-chip microcomputer as a client mode. It obtains Ethernet data packets by using ENC28J60 Ethernet hardware physical layer and MAC layer, and analyzes the data packets To obtain firmware data.
[0061] Software module realization.
[0062] When compiling the user program, the starting address of the compiler IROM1 such as MDK-ARM should be set to 0x08010000. During the execution of the main function main(void) of the user program, if the CPU receives an interrupt request, the PC pointer is still forced to jump to the interrupt vector table at address 0X08000004. Therefore, the interrupt vector table offset 0x10000 needs to be set to jump to In the interrupt service program corresponding to the interrupt source user program. The user program main function needs to add interrupt vector table mapping:
[0063] NVIC_VectTab_FLASH=0X08000004;
[0064] NVIC_SetVectorTable(NVIC_VectTab_FLASH,0x10000);
[0065] 2. BootLoader program jumps to the realization function of user address space:
[0066] #defineApplicationAddress0x08010000
[0067] typedefvoid(*pFunction)(void);
[0068] pFunctionJump_To_Application;
[0069] u32JumpAddress;
[0070] voidJumpApplication(void)
[0071] {
[0072] NVIC_SETFAULTMASK();//Close the total interrupt
[0073] JumpAddress=*(__IOuint32_t*)(ApplicationAddress+4);
[0074] Jump_To_Application=(pFunction)JumpAddress;
[0075] __set_MSP(*(__IOuint32_t*) ApplicationAddress);
[0076] Jump_To_Application();
[0077] }.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Keyless entry system

Owner:ALPS ALPINE CO LTD

Classification and recommendation of technical efficacy words

  • Low maintenance
  • Improve convenience

Self-steering axle suspension system having a rotary stabilizer

ActiveUS20080018070A1Low maintenanceIncrease payload capacityLiquid resistance brakesSpringsAutomotive engineeringSnubber
Owner:HENDRICKSON USA L L C

Hydrogen filling apparatus and hydrogen filling method

ActiveUS20100307636A1Improve convenienceAccurate timingLiquid fillingGas handling/storage effectsHydrogen tankChemistry
Owner:HONDA MOTOR CO LTD

Method for treating Sjogren's syndrome

InactiveUS20060062787A1Low costImprove convenienceBiocideSenses disorderVisual analogue scaleRegimen
Owner:GENENTECH INC
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products