CN109271174A - A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller - Google Patents

A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller Download PDF

Info

Publication number
CN109271174A
CN109271174A CN201810864933.3A CN201810864933A CN109271174A CN 109271174 A CN109271174 A CN 109271174A CN 201810864933 A CN201810864933 A CN 201810864933A CN 109271174 A CN109271174 A CN 109271174A
Authority
CN
China
Prior art keywords
burning
firmware
address
flash
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810864933.3A
Other languages
Chinese (zh)
Inventor
刘军
谭晨曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Xingyi Electronic Technology Co Ltd
Original Assignee
Guangzhou Xingyi Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Xingyi Electronic Technology Co Ltd filed Critical Guangzhou Xingyi Electronic Technology Co Ltd
Priority to CN201810864933.3A priority Critical patent/CN109271174A/en
Publication of CN109271174A publication Critical patent/CN109271174A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention belongs to single-chip microcontroller burning technical fields, and in particular to a kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller.It is improved for the method for burn-recording of the multiple firmwares of STM32/GD32 series monolithic, it being capable of the burning since any legal address FLASH when using ARM company SWD agreement to STM32/GD32 family chip burning, therefore in the burning to multiple firmwares, each firmware is dispersed into burning FLASH to specified region.The replication rate of product of the production based on STM32/GD32 series monolithic is promoted, the time needed for burning when saving production, time cost is reduced, increases productivity;It allows users to simplify the operating procedure to the firmware for needing burning, while flexible configuration can be carried out.

Description

A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller
Technical field
The invention belongs to single-chip microcontroller burning technical fields, and in particular to a kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller.
Background technique
Single-chip microcontroller is a kind of IC chip, is using very large scale integration technology with data-handling capacity Central processor CPU, random access memory ram, read only memory ROM, it is a variety of I/O mouthfuls and interrupt system, timer/counter Etc. functions (may further include the circuits such as display driver circuit, pulse-width modulation circuit, analog multiplexer, A/D converter) collection At to the small and perfect microcomputer system constituted on one piece of silicon wafer, it is widely applied in industrial control field.From upper The eighties in century, by 4,8 single-chip microcontrollers at that time, the high-speed microprocessor of 600M till now.
STM32 series monolithic is STMicw Electronics (STMicroelectronics) release based on ARMCortex- 32 single-chip microcontroller series of M0/M3/M4/M7 kernel, the SWD for supporting ARM to propose debug Port Profile, can be with by SWD agreement The control register group for accessing FLASH also can specify address and send data, and STM32 series monolithic is using address from the side of increasing Formula single at most receives 4K byte data.GD32 series monolithic is million easy innovation (GigaDevice) releases based on ARM 32 single-chip microcontroller series of Cortex-M3/M4 kernel, the SWD for supporting ARM to propose debug Port Profile, can be with by SWD agreement The control register group for accessing FLASH also can specify address and send data, and STM32 series monolithic is using address from the side of increasing Formula single at most receives 4K byte data.Existing STM32/GD32 series monolithic firmware burning flow chart is as shown in Fig. 1, Its process is generally as follows:
(1) each user's firmware for needing burning specified by user and its relative to the address offset of the base address FLASH Amount;
(2) the multiple firmwares for needing to be burnt to STM32/GD32 single-chip microcontroller are corresponded into the address FLASH to be spliced into one and rise Beginning address is necessary for the base address FLASH, comprising all user's firmware datas but the large size that is not limited only to user's firmware data is solid Part, distribution schematic diagram of user's firmware in the section FLASH is as shown in Fig. 2, if discontinuous in FLASH address section The section FLASH 1., 3., 5. in burning 3 user's firmwares, then need to be spliced into one cover 1., 2., 3., 4., 5. totally five The large-scale firmware in the section FLASH, and this large-scale firmware is being needed to correspond to the non-firmware storage areas position of the section FLASH 2., 4. Set the meaningless data of filling;
(3) size of the large-scale firmware obtained according to splicing wipes the corresponding firmware size from the base address FLASH The section FLASH;
(4) the large size firmware is burnt to the section FLASH of step 3 erasing since the base address FLASH.
Lead to following technological deficiency in this way:
(1) toward subinterval shown in Fig. 2,2., 4. the middle meaningless data of filling usually make the large-scale firmware ultimately produced File size far beyond the file size summation of original user firmware, the recordable time under the conditions of identical burning can prolong It is long;
(2) toward subinterval shown in Fig. 2,2., 4. the middle meaningless data of filling will cover the valid data in the section, It will cause the loss of effective data in the section;
(3) the blank section between all firmwares and firmware can be spliced into together after one large-scale firmware again by original technology It is burnt in FLASH, flexibly can not individually update user's firmware of partial section therein.
Summary of the invention
In order to solve the defect of the above-mentioned prior art, it is an object of the present invention to provide a kind of multiple firmwares of single-chip microcontroller to disperse burning Method.It improves for the method for burn-recording of the multiple firmwares of STM32/GD32 series monolithic, is assisted using ARM company SWD When discussing to STM32/GD32 family chip burning can the burning since any legal address FLASH, therefore to multiple solid When the burning of part, each firmware is dispersed into burning FLASH to specified region.It promotes production and is based on STM32/GD32 series monolithic Product replication rate, save production when burning needed for the time, reduce time cost, increase productivity;It enables a user to Enough operating procedures simplified to the firmware for needing burning, while flexible configuration can be carried out.
The object of the invention is achieved through the following technical solutions:
A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller, flow chart are as shown in Fig. 3, comprising the following steps:
(1) the specified each user's firmware for needing burning of user and its starting burning address;
(2) size of each user's firmware is specified to obtain the corresponding size replaced between firmware storage areas according to user respectively, It then is respectively each corresponding section FLASH of firmware erasing;
(3) according to the starting burning address of each user's firmware, each user's firmware is burnt to corresponding FLASH respectively Section;
Burning step described in step (3) are as follows:
A: the starting burning address of one of user's firmware is set as current burning address, analyzes current burning address Whether it is aligned relative to the base address FLASH according to 4K, is not aligned according to 4K if being currently burnt to address, calculates and consolidate user Part be aligned according to 4K after, the byte number N among the address that is aligned to 4K of current burning address, the N number of byte data of burning is to current The section FLASH that burning address is risen, current burning address is from N is increased, and user's firmware data offset is from N is increased, so as to burn next time Record operation can will be to the data recording of burning to the correct section FLASH.If current burning address is aligned according to 4K, direct burning The section FLASH that 4K data rise to current burning address then carries out from the operation for increasing 4K current burning address;
B: whether the firmware data byte number that analysis residue is not burnt to the section objective chip FLASH is less than 4K byte, If be more than 4K byte, from remaining users firmware data take before 4K direct burning starting burning address the section FLASH, then Current burning address is carried out from the operation for increasing 4K;
C: repeating (2) step, until the firmware data byte number that residue is not burnt to the section objective chip FLASH is less than 4K byte, judges whether the firmware data byte number for not being burnt to the section objective chip FLASH is more than 0 byte at this time, if more In 0 byte, then user's firmware data total number of non-burning is burnt to the section FLASH where current burning address;
D: repeating (1)~(3) step, until all firmwares of user to be all burnt to the specified section FLASH, completion pair The burning of chip.
Preferably, the single-chip microcontroller is STM32 series monolithic or GD32 series monolithic.
Compared with the existing technology, the invention has the following advantages and beneficial effects:
(1) technical solution of the present invention becomes large-scale firmware without splicing each user's firmware, to simplify burning operation step Suddenly;
(2) technical solution of the present invention only understands each user's firmware data that burning user specifies, meaningless without burning Data, will not both cover the valid data in the section FLASH of non-user firmware storage, while can also greatly save needed for burning Time;
(3) when user, which just hopes, individually updates one of user's firmware, the prior art must be by each user's firmware It is spliced into one large-scale firmware, therefore all user's firmware datas need to be updated again;And technical solution of the present invention can individually more User's firmware data in the section FLASH that new user specifies, not only flexibly, and the data volume of burning is preferably minimized, and is saved significantly Time overhead needed for saving burning.
Detailed description of the invention
Fig. 1 is STM32/GD32 series monolithic firmware burning flow chart in the prior art;
Fig. 2 is user's firmware during prior art STM32/GD32 series monolithic firmware burning in the section FLASH Distribution schematic diagram;
Fig. 3 is the flow chart that the multiple firmwares of single-chip microcontroller of the present invention disperse method for burn-recording technical solution;
Fig. 4 is single-chip microcontroller firmware burning flow chart in the embodiment of the present invention.
Specific embodiment
Present invention will now be described in further detail with reference to the embodiments and the accompanying drawings, but embodiments of the present invention are unlimited In this.
Embodiment 1
It is a kind of based on the off line cd-rom recorder of SWD agreement to STM32F1xx family chip (hereinafter referred to as " objective chip ") into The step of stroke sequence replication.The following are the detailed descriptions of key step, wherein the flow chart of (3)~(6) step such as 4 institute of attached drawing Show:
(1) user configures off line cd-rom recorder, the incoming each firmware for wanting burning, and specified starting burning address;
(2) off line cd-rom recorder enters stagnation operational mode by SWD protocol access objective chip, control chip;
(3) firmware size for the firmware that off line cd-rom recorder is specified according to user and starting burning address erasing firmware store institute The section FLASH needed;
(4) off line cd-rom recorder takes out the information of a firmware, with being set as current burning by the starting burning address of the firmware Whether location, analysis are aligned according to 4K relative to the base address FLASH with current burning address, if be currently burnt to address not according to 4K alignment, calculates the byte number N after being aligned user's firmware according to 4K, among the address that current burning address is aligned to 4K, The section FLASH that the N number of byte data of burning rises to current burning address, current burning address are deviated from N, user's firmware data is increased Amount is from N is increased, so that burning operation can will be to the data recording of burning to the correct section FLASH next time;If current burning Location is aligned according to 4K, and the section FLASH that direct burning 4K data to current burning address rise then carries out current burning address From the operation for increasing 4K;
(5) whether the remaining firmware data byte number for not being burnt to the section objective chip FLASH of off line cd-rom recorder analysis Less than 4K byte, if being more than 4K byte, from remaining users firmware data takes preceding 4K direct burning starting burning address The section FLASH then carries out from the operation for increasing 4K current burning address;
(6) (5) step is repeated, until the firmware data byte number that residue is not burnt to the section objective chip FLASH is few In 4K byte, judge whether the firmware data byte number for not being burnt to the section objective chip FLASH is more than 0 byte at this time, if More than 0 byte, then user's firmware data total number of non-burning is burnt to the section FLASH where current burning address;
(7) (3)~(6) step is repeated, it is specified until being all burnt to all firmwares of user configuration off line cd-rom recorder The burning to chip is completed in the section FLASH.
Embodiment 2
It is a kind of that GD32F10x family chip (hereinafter referred to as " objective chip ") is carried out based on the off line cd-rom recorder of SWD agreement The step of burning program.The following are the detailed descriptions of key step, wherein the flow chart of (3)~(6) step is as shown in Fig. 4:
(1) user configures off line cd-rom recorder, the incoming each firmware for wanting burning, and specified starting burning address;
(2) off line cd-rom recorder enters stagnation operational mode by SWD protocol access objective chip, control chip;
(3) firmware size for the firmware that off line cd-rom recorder is specified according to user and starting burning address erasing firmware store institute The section FLASH needed;
(4) off line cd-rom recorder takes out the information of a firmware, with being set as current burning by the starting burning address of the firmware Whether location, analysis are aligned according to 4K relative to the base address FLASH with current burning address, if be currently burnt to address not according to 4K alignment, calculates the byte number N after being aligned user's firmware according to 4K, among the address that current burning address is aligned to 4K, The section FLASH that the N number of byte data of burning rises to current burning address, current burning address are deviated from N, user's firmware data is increased Amount is from N is increased, so that burning operation can will be to the data recording of burning to the correct section FLASH next time;If current burning Location is aligned according to 4K, and the section FLASH that direct burning 4K data to current burning address rise then carries out current burning address From the operation for increasing 4K;
(5) whether the remaining firmware data byte number for not being burnt to the section objective chip FLASH of off line cd-rom recorder analysis Less than 4K byte, if being more than 4K byte, from remaining users firmware data takes preceding 4K direct burning starting burning address The section FLASH then carries out from the operation for increasing 4K current burning address;
(6) (5) step is repeated, until the firmware data byte number that residue is not burnt to the section objective chip FLASH is few In 4K byte, judge whether the firmware data byte number for not being burnt to the section objective chip FLASH is more than 0 byte at this time, if More than 0 byte, then user's firmware data total number of non-burning is burnt to the section FLASH where current burning address;
(7) (3)~(6) step is repeated, it is specified until being all burnt to all firmwares of user configuration off line cd-rom recorder The burning to chip is completed in the section FLASH.
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodiment Limitation, other any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present invention, It should be equivalent substitute mode, be included within the scope of the present invention.

Claims (2)

1. a kind of multiple firmwares of single-chip microcontroller disperse method for burn-recording, which comprises the following steps:
(1) the specified each user's firmware for needing burning of user and its starting burning address;
(2) size of each user's firmware is specified to obtain the corresponding size replaced between firmware storage areas according to user respectively, then Respectively each corresponding section FLASH of firmware erasing;
(3) according to the starting burning address of each user's firmware, each user's firmware is burnt to the corresponding area FLASH respectively Between;
Burning step described in step (3) are as follows:
A: being set as current burning address for the starting burning address of one of user's firmware, analysis with current burning address whether Be aligned relative to the base address FLASH according to 4K, if being currently burnt to address and not being aligned according to 4K, calculate by user's firmware by According to the byte number N after 4K alignment, among the address that current burning address is aligned to 4K, the N number of byte data of burning to current burning The section FLASH that address is risen, current burning address is from N is increased, and user's firmware data offset is from N is increased, so that burning next time is grasped Making can will be to the data recording of burning to the correct section FLASH.If current burning address is aligned according to 4K, direct burning 4K number According to the section FLASH risen to current burning address, then current burning address is carried out from the operation for increasing 4K;
B: whether the firmware data byte number that analysis residue is not burnt to the section objective chip FLASH is less than 4K byte, if more In 4K byte, then the section FLASH from 4K direct burning starting burning address before remaining users firmware data takes, then to working as Preceding burning address is carried out from the operation for increasing 4K;
C: repeating (2) step, until residue is not burnt to the firmware data byte number in the section objective chip FLASH less than 4K word Section, judges whether the firmware data byte number for not being burnt to the section objective chip FLASH is more than 0 byte at this time, if being more than 0 word User's firmware data total number of non-burning, then is burnt to the section FLASH where current burning address by section;
D: repeating (1)~(3) step, until all firmwares of user to be all burnt to the specified section FLASH, completes to chip Burning.
2. the multiple firmwares of a kind of single-chip microcontroller according to claim 1 disperse method for burn-recording, which is characterized in that the single-chip microcontroller For STM32 series monolithic or GD32 series monolithic.
CN201810864933.3A 2018-08-01 2018-08-01 A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller Pending CN109271174A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810864933.3A CN109271174A (en) 2018-08-01 2018-08-01 A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810864933.3A CN109271174A (en) 2018-08-01 2018-08-01 A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller

Publications (1)

Publication Number Publication Date
CN109271174A true CN109271174A (en) 2019-01-25

Family

ID=65148328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810864933.3A Pending CN109271174A (en) 2018-08-01 2018-08-01 A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller

Country Status (1)

Country Link
CN (1) CN109271174A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045968A (en) * 2019-04-16 2019-07-23 广东欧谱曼迪科技有限公司 A kind of method of the STM32 across single-chip microcontroller burning program
CN111338658A (en) * 2020-02-27 2020-06-26 上海电力大学 Method and system for downloading PIC single-chip microcomputer program based on stm32CPU
CN113138777A (en) * 2021-04-09 2021-07-20 长芯盛(武汉)科技有限公司 Low-cost universal multi-path programming device and programming method suitable for various programming protocols
US11113226B2 (en) * 2019-08-30 2021-09-07 Shenzhen GOODIX Technology Co., Ltd. Firmware burning apparatus and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102543193A (en) * 2011-12-31 2012-07-04 深圳创维数字技术股份有限公司 Flash memory recording method as well as recording equipment and system
CN103049540A (en) * 2012-12-26 2013-04-17 深圳瑞高信息技术有限公司 Method and device for burning large files
CN103324503A (en) * 2013-05-29 2013-09-25 京东方科技集团股份有限公司 Data programming system and method
CN103544118A (en) * 2012-07-17 2014-01-29 群联电子股份有限公司 Memory storage device, memory controller thereof and data writing method
CN104317618A (en) * 2014-10-24 2015-01-28 福州瑞芯微电子有限公司 Firmware partitioning method and device
CN104461925A (en) * 2014-11-14 2015-03-25 浪潮(北京)电子信息产业有限公司 Automatic correcting method and device for aligning storage device addresses
CN105117253A (en) * 2015-08-27 2015-12-02 常州大学 BootLoader based remote upgrade method for UV LED (Ultraviolet Light Emitting Diode) curing system
CN106020905A (en) * 2016-05-31 2016-10-12 上海庆科信息技术有限公司 Microcontroller firmware developing and updating method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102543193A (en) * 2011-12-31 2012-07-04 深圳创维数字技术股份有限公司 Flash memory recording method as well as recording equipment and system
CN103544118A (en) * 2012-07-17 2014-01-29 群联电子股份有限公司 Memory storage device, memory controller thereof and data writing method
CN103049540A (en) * 2012-12-26 2013-04-17 深圳瑞高信息技术有限公司 Method and device for burning large files
CN103324503A (en) * 2013-05-29 2013-09-25 京东方科技集团股份有限公司 Data programming system and method
CN104317618A (en) * 2014-10-24 2015-01-28 福州瑞芯微电子有限公司 Firmware partitioning method and device
CN104461925A (en) * 2014-11-14 2015-03-25 浪潮(北京)电子信息产业有限公司 Automatic correcting method and device for aligning storage device addresses
CN105117253A (en) * 2015-08-27 2015-12-02 常州大学 BootLoader based remote upgrade method for UV LED (Ultraviolet Light Emitting Diode) curing system
CN106020905A (en) * 2016-05-31 2016-10-12 上海庆科信息技术有限公司 Microcontroller firmware developing and updating method and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045968A (en) * 2019-04-16 2019-07-23 广东欧谱曼迪科技有限公司 A kind of method of the STM32 across single-chip microcontroller burning program
US11113226B2 (en) * 2019-08-30 2021-09-07 Shenzhen GOODIX Technology Co., Ltd. Firmware burning apparatus and system
CN111338658A (en) * 2020-02-27 2020-06-26 上海电力大学 Method and system for downloading PIC single-chip microcomputer program based on stm32CPU
CN111338658B (en) * 2020-02-27 2023-10-10 上海电力大学 Method and system for downloading PIC (personal computer) singlechip program based on stm32CPU (Central processing Unit)
CN113138777A (en) * 2021-04-09 2021-07-20 长芯盛(武汉)科技有限公司 Low-cost universal multi-path programming device and programming method suitable for various programming protocols
CN113138777B (en) * 2021-04-09 2022-02-01 长芯盛(武汉)科技有限公司 Low-cost universal multi-path programming device and programming method suitable for various programming protocols

Similar Documents

Publication Publication Date Title
CN109271174A (en) A kind of multiple firmwares dispersion method for burn-recording of single-chip microcontroller
WO2007147351A1 (en) A method for making a power amplifier support multi-power, a radio frequency module and a testing method
CN102501641B (en) Device and method for controlling heating time of thermosensitive head
RU2013124128A (en) DRY-RESISTANT PLANTS AND RELATED CONSTRUCTIONS, AND METHODS INCLUDING GENES ENCODING DTP6 POLYPEPTIDES
TW201430700A (en) Method of updating battery firmware, portable electronics device and rechargeable battery module
JP2008204456A (en) System for controlling complex non-linear data transfer
CN103067595B (en) Method and mobile terminal of sending out prompt information according to user identification card
CN101770557A (en) Method for calculating service time of software in system
CN102930877B (en) Digital monitoring system suitable for light module controller and implementation method of digital monitoring system
CN111045703B (en) Battery management unit software upgrading method and system
CN104540293B (en) Switching power driving chip, burning adjustment method and LED constant-current driving circuit
CN100481895C (en) Method and device for carrying out TV set software upgrade
CN109487023A (en) A method of judging furnace cylinder working state
WO2020192669A1 (en) Gas meter intelligent controller and firmware upgrade start-up method therefor
CN204269175U (en) Water meter intelligent processing system
CN201974798U (en) Television off-line upgrading tool
CN214375902U (en) PC machine energy-saving controller based on USB interface
CN102750163B (en) The method of line card internal memory is saved during a kind of network management upgrading
CN101179521A (en) Data synchronization updating system and method of digital family equipment
CN114659277A (en) Automatic time service water heater
CN220710042U (en) Device for improving temperature drift offset of resistor
CN101183947A (en) Wireless sensor node ID number and communication time slot configuration device and method
CN108287795A (en) A kind of new types of processors buffer replacing method
CN204469568U (en) A kind of crystallization of mannitol dissolvers
CN110581779A (en) Configuration issuing platform system and configuration issuing method based on local cache

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190125

RJ01 Rejection of invention patent application after publication