CN112667264A - Method and system for upgrading off-line downloaded software - Google Patents
Method and system for upgrading off-line downloaded software Download PDFInfo
- Publication number
- CN112667264A CN112667264A CN202110057395.9A CN202110057395A CN112667264A CN 112667264 A CN112667264 A CN 112667264A CN 202110057395 A CN202110057395 A CN 202110057395A CN 112667264 A CN112667264 A CN 112667264A
- Authority
- CN
- China
- Prior art keywords
- upgrading
- file
- offline
- memory card
- mode
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000003860 storage Methods 0.000 claims abstract description 6
- 230000008569 process Effects 0.000 claims description 24
- 230000004044 response Effects 0.000 claims description 9
- 239000011159 matrix material Substances 0.000 claims description 3
- 238000009434 installation Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 239000012141 concentrate Substances 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000000047 product Substances 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 239000006227 byproduct Substances 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Images
Abstract
The invention provides a method and a system for upgrading off-line downloaded software, wherein the method comprises the following steps: the off-line upgrading system periodically detects whether the first interface is inserted into the storage card; when detecting that the first interface is inserted into the memory card, executing the subsequent steps; a green light connected with the off-line upgrading system is turned on; and opening an off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode. The invention can get rid of dependence on huge PC computers, so that the upgrading platform is easier to deploy when manufacturers produce in batches, and the problem of software upgrading failure to the system on chip caused by inconsistent windows versions of the PC or drive installation failure and the like is solved, so that the software upgrading of the system on chip is just like copying an upgrading file to a U disk.
Description
Technical Field
The invention belongs to the field of system-on-chip software upgrading, and particularly relates to a method and a system for upgrading off-line downloaded software.
Background
Usually, the processors of the system on chip have limited memory space and computing power, and the static memory space of some low-end processors is only dozens of MB or even a few MB, so that compiling and running the program on the system on chip are impossible. Usually, we choose to perform cross-compilation on a PC with strong computing power, and then download a binary file that can be directly run to a target platform through some debugging download protocol. However, in mass production, the method of upgrading the program online is not feasible. For another example, a manufacturer that does not involve software design often needs to download the compiled binary executable file to the system-on-chip's false. Furthermore, the upgrading of the software to the system on chip may be failed due to inconsistency of Windows versions of PCs (Personal computers) or failure of driver installation.
Disclosure of Invention
In order to solve the problem that software upgrading of a system on chip fails due to reasons such as inconsistent Windows versions of current PCs or failed installation of drivers, the embodiment of the application provides a method and a system for upgrading off-line downloaded software.
In a first aspect, an embodiment of the present application provides a method for downloading a software upgrade offline, including:
the off-line upgrading system periodically detects whether the first interface is inserted into the storage card; when the first interface is detected to be inserted into the memory card, executing the subsequent steps;
a green light connected with the off-line upgrading system is turned on;
and opening the off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
Wherein, if the opening fails, loading the file in the memory card, and entering a key selection upgrading mode, including:
opening the file in the memory card by using the appointed file names in sequence, adding the current file name into the list whenever the return is successful, and finishing the loading of the file when the return is failed;
the loaded files are stored in a list according to the sequence of the dictionary order, the input command is received through a key, and a seven-segment digital tube connected with the offline upgrading system is displayed in a flashing mode to show that the files are being selected;
receiving a command of selecting a file through a determination key, displaying a seven-segment digital tube in a normally-on mode to indicate that the file is selected, wherein the numerical value displayed by the seven-segment digital tube indicates the number of the files in the list;
the method comprises the steps that a command for starting upgrading is received through a starting key, the offline upgrading system is connected with a target platform through an SWD interface, after the command for starting upgrading is received, a file is written into a fixed 0x08000000 position, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and red LED is used for indicating according to an error code.
Wherein, the opening the off-line upgrade configuration file in the memory card, and if the opening is successful, entering an automatic upgrade mode, includes:
reading the programming rule in the offline upgrade configuration file line by line, checking whether the read programming rule is correct, including whether the length of the file name is less than 15 characters, whether the written address value is in the range of 0x08000000 to 0x0801ffff, storing the correct programming rule in a linked list, if the linked list is not empty, waiting to receive a start instruction, connecting the SWD with a target platform, starting upgrading according to the programming rule, if the programming address in the programming rule is equal to 0x08000000, erasing a chip, and then writing the file into the address, otherwise, directly writing the file into the specified address in the programming rule.
Wherein, still include: and the green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and the red LED is used for indicating according to the error code.
Wherein, still include: after writing, if an error exists, the red LED is normally lighted for 1 second, and then flickers for a plurality of times according to an error code at the frequency of 200 milliseconds; and if the writing is normal, the green LED lamp is normally on.
The upgrading process comprises the following steps:
sending 51 '1's for resetting SWD, switching JTAG to SWD, reading the value of a debugging port identification register (DPIDR), and if the return value is not 0, successfully connecting with the system on chip;
setting the STKCMPCLR, STKERRCLR, WDERRCLR, ORUNERRCLR bit of an ABORT register (ABORT), clearing the state, ensuring that a CTRL/STAT register is selected in a DPBANKSEL, sending a system power-on request, waiting for a response, and stopping the program if the response is not responded after the time is out;
enabling the system on chip to enter a reset programming mode, downloading a programming algorithm to an SRAM and initializing;
reading 1024 bytes of data from the upgrade file in a circulating manner, programming the data to FLASH by using pages, and filling and aligning the data of the last page, wherein the size of the data of the last page is smaller than 1024 by using 0;
reading data from the first page and the last page of the FLASH programming according to the file size, and comparing the data with the upgrading file data, wherein if the data are the same, the upgrading is successful;
and resetting the system on the chip in a soft mode, and releasing the SWD interface.
In a second aspect, the present application provides a system for downloading a software upgrade offline, comprising: an offline upgrade system to:
periodically detecting whether the first interface is inserted into the memory card; when the first interface is detected to be inserted into the memory card, executing the subsequent steps;
controlling a green light connected with the off-line upgrading system to be turned on;
and opening the off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
The first interface is an SPI interface, and the storage card is a TF card.
The off-line upgrading system is connected with the matrix keyboard and the functional keys through GPIO interfaces, the off-line upgrading system is connected with the LED and the seven-segment digital tube through the GPIO interfaces, and the off-line upgrading system is connected with the target platform through an SWD interface.
Wherein the offline upgrade system is configured to:
opening the file in the memory card by using the appointed file names in sequence, adding the current file name into the list whenever the return is successful, and finishing the loading of the file when the return is failed;
the loaded files are stored in a list according to the sequence of the dictionary order, the input command is received through a key, and a seven-segment digital tube connected with the offline upgrading system is displayed in a flashing mode to show that the files are being selected;
receiving a command of selecting a file through a determination key, displaying a seven-segment digital tube in a normally-on mode to indicate that the file is selected, wherein the numerical value displayed by the seven-segment digital tube indicates the number of the files in the list;
the method comprises the steps that a command for starting upgrading is received through a starting key, the offline upgrading system is connected with a target platform through an SWD interface, after the command for starting upgrading is received, a file is written into a fixed 0x08000000 position, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and red LED is used for indicating according to an error code. .
The method and the system for upgrading the off-line downloaded software have the following beneficial effects:
the method for upgrading the off-line download software comprises the following steps: the off-line upgrading system periodically detects whether the first interface is inserted into the storage card; when detecting that the first interface is inserted into the memory card, executing the subsequent steps; a green light connected with the off-line upgrading system is turned on; and opening an off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
The invention can get rid of dependence on huge PC computers, and makes the upgrade platform easier to deploy when manufacturers produce in batches. The requirements on computer knowledge and professional knowledge of users are reduced, software upgrading of different platforms is simple and easy to achieve, the problem that software upgrading of the system on chip fails due to reasons of inconsistent windows versions of the PC or failure in drive installation is solved, the software upgrading of the system on chip is the same as copying an upgrading file to a U disk, and developers who just touch the system on chip can concentrate on software development.
Drawings
FIG. 1 is a flowchart illustrating a method for downloading software upgrades offline according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating another method for downloading software upgrades offline according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a system for downloading a software upgrade offline according to an embodiment of the present application.
Detailed Description
The present application is further described with reference to the following figures and examples.
In the following description, the terms "first" and "second" are used for descriptive purposes only and are not intended to indicate or imply relative importance. The following description provides embodiments of the invention, which may be combined or substituted for various embodiments, and this application is therefore intended to cover all possible combinations of the same and/or different embodiments described. Thus, if one embodiment includes feature A, B, C and another embodiment includes feature B, D, then this application should also be considered to include an embodiment that includes one or more of all other possible combinations of A, B, C, D, even though this embodiment may not be explicitly recited in text below.
The following description provides examples, and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements described without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For example, the described methods may be performed in an order different than the order described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
The invention is a device with small volume, portability and low manufacturing cost, which is connected with the system-on-chip through the SWD interface to carry out software upgrading, so that the software upgrading of the system-on-chip is simple, the problem of software upgrading failure of the system-on-chip caused by inconsistent windows versions of PCs or failure of drive installation and the like can be solved, an upgrading platform is easier to deploy when manufacturers produce in batches, the software upgrading of the system-on-chip is just like copying an upgrading file to a U disk, and developers just contacting the system-on-chip can concentrate on software development.
As shown in fig. 1 to 3, a method for downloading a software upgrade offline according to the present application includes: step S101, an off-line upgrading system periodically detects whether a first interface is inserted into a memory card; when detecting that the first interface is inserted into the memory card, executing the subsequent steps; s103, turning on a green light connected with the offline upgrading system; s105, opening the off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode. Each step is described below.
Step S101, an off-line upgrading system periodically detects whether a first interface is inserted into a memory card; when the first interface is detected to be inserted into the memory card, the following steps are executed. And S103, turning on a green light connected with the offline upgrading system.
FIG. 3 is a system framework diagram for offline download, as shown in FIG. 3: the system uses an FATFS file system to read and write TF card, and comprises 10 digital keys, 1 start key, 1 confirmation key as human-computer interaction input, STM32 as logic master control, 3 7-segment nixie tubes for displaying selected file numbers, 1 red LED lamp and 1 green LED lamp as result information indication, and an SWD interface for connecting with a system on chip.
Most of the processing units of the system on chip in the market are ARM architectures, and the main stream debugging and downloading interfaces of the ARM architectures at present mainly include: 1. JTAG (Joint Test Action Group) is an international standard protocol, and is mainly used for chip internal Test. At present, the JTAG protocol is supported by products of most chip manufacturers, and the standard JTAG interface is 4 lines: TMS, TCK, TDI, TDO are mode select, clock, data input and data output, respectively. 2. The SWD (Serial Wire Debug) only uses two interfaces 3 of SWDIO and SWCLK, and the RDI (Remote Debug Interface) is a standard Debug Interface proposed by ARM company, and is mainly used for simulation of ARM chips. At present, many IDE manufacturers gradually adopt standard RDI as a debugging interface of an ARM emulator, so that cross-platform hardware debugging is possible.
The difference between the SWD and the traditional debugging downloading mode is as follows: SWD mode is more reliable than JTAG in high speed mode. The JTAG download procedure may fail in the case of a large data volume, but the probability of SWD occurrence is much smaller. In the case of the emulation mode using basically JTAG, the SWD mode can be directly used. Compared with the traditional debugging download, the SWD uses fewer communication lines, so that the space used for designing the PCB is less, and the volume of a product is smaller.
The SWD interface uses a single bidirectional data connection (SWDIO) and a single clock-synchronous transfer of data (SWDCLK). The operation on the wire comprises two to three phases:
1: and when the request of the data packet is received, the external host debugger sends the request to the debugging port. The debug port is the target of the request and when the target receives a packet request from the debug host, it must respond immediately by entering the validation phase.
2: and the target machine sends a response to the external host machine in response to the data packet.
3: a data transmission phase, which only exists in two cases: a. a data read or data write request is followed by a valid (OK) acknowledge response. CTRL/STAT, ORUNDETECT flags 0b 1.
The system is electrified and then continuously detects whether the TF card is inserted through the SPI interface, at the moment, the green light is in a normally-off state, and when the TF card is detected to be inserted, the green light is turned on.
S105, opening the off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
In some embodiments, if the opening fails, loading the file in the memory card, and entering a key selection upgrade mode, the method includes:
opening the file in the memory card by using the appointed file names in sequence, adding the current file name into the list whenever the return is successful, and finishing the loading of the file when the return is failed; the loaded files are stored in a list according to the sequence of the dictionary order, the input command is received through a key, and a seven-segment digital tube connected with an offline upgrading system is displayed in a flashing mode to show that the files are being selected; receiving a command of selecting a file through a confirming key, displaying the seven-segment digital tube in a normally-on mode to indicate that the file is selected, and displaying the numerical value of the seven-segment digital tube to indicate the number of the files in the list; the method comprises the steps that a command for starting upgrading is received through a starting key, an offline upgrading system is connected with a target platform through an SWD interface, after the command for starting upgrading is received, a file is written into a fixed 0x08000000 position, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and the red LED is used for indicating according to an error code.
Cfg files are opened by using f _ open, if the files return to be successful, an automatic upgrading mode is entered, otherwise, the files are opened by using the appointed file names in sequence, the current file name is added into the list when the files return to be successful, the files are loaded when the files return to be failed, and then the upgrading mode is selected by entering a key.
And (3) selecting an upgrading mode by a key: in the mode, file names are stored in a list according to the sequence of a dictionary sequence, a seven-segment digital tube is displayed in a flashing mode when a key is input to indicate that a file is being selected, the file is displayed in a normally bright mode when the key is pressed to indicate that the file is selected, a display value indicates the number of the files in the list, the SWD is used for being connected with a target platform to start writing the file into a fixed 0x08000000 position after a start key is pressed, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and a red LED is used for indicating according to an error code.
In some embodiments, opening the offline upgrade configuration file in the memory card, and if the opening is successful, entering an automatic upgrade mode includes:
reading the programming rule in an offline upgrade configuration file (offline.cfg) line by line, checking whether the read programming rule is correct, including whether the length of a file name is less than 15 characters, whether the written address value is in the range of 0x08000000 to 0x0801ffff, storing the correct programming rule in a linked list, if the linked list is not empty, starting upgrading according to the programming rule by using SWD after waiting for receiving a starting instruction, if the programming address in the programming rule is equal to 0x08000000, erasing a chip and then writing the file in the address, otherwise, directly writing the file in the specified address in the programming rule.
In some embodiments, the method for downloading a software upgrade offline further includes: and the green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and the red LED is used for indicating according to the error code.
In some embodiments, the method for downloading a software upgrade offline further includes: after writing, if an error exists, the red LED is normally lighted for 1 second, and then flickers for a plurality of times according to an error code at the frequency of 200 milliseconds; and if the writing is normal, the green LED lamp is normally on. The upgrade can continue to cycle through such a cycle after the start key is pressed.
The format of the upgrade rule command is: < opt > < file name > < addr > [ size ], where opt is the operation performed, 'w' denotes writing FLASH, 'r' denotes reading FLASH, 'file name' denotes the file name of the upgrade file, or the file name of the read content save, 'addr' denotes the FLASH address to be written or read, 'size' is optional, and is valid only when the operation is read, which denotes how many bytes of data need to be read.
The upgrading process comprises the following steps:
sending 51 '1's for resetting SWD, switching JTAG to SWD, reading the value of a debugging port identification register (DPIDR), and if the return value is not 0, successfully connecting with the system on chip;
setting the STKCMPCLR, STKERRCLR, WDERRCLR, ORUNERRCLR bit of an ABORT register (ABORT), clearing the state, ensuring that a CTRL/STAT register is selected in a DPBANKSEL, sending a system power-on request, waiting for a response, and stopping the program if the response is not responded after the time is out;
enabling the system on chip to enter a reset programming mode, downloading a programming algorithm to an SRAM and initializing;
reading 1024 bytes of data from the upgrade file in a circulating manner, programming the data to FLASH by using pages, and filling and aligning the data of the last page, wherein the size of the data of the last page is smaller than 1024 by using 0;
reading data from the first page and the last page of the FLASH programming according to the file size, and comparing the data with the upgrading file data, wherein if the data are the same, the upgrading is successful;
and resetting the system on the chip in a soft mode, and releasing the SWD interface.
The invention is characterized in that:
1. the method of off-line downloading may be determined by checking if an offline.
2. The off-line downloading method comprises the following steps: a. and (4) selecting a fixed upgrade file by a key to burn the upgrade file into the address 0x08000000 of the FLASH of the system on chip. b. Cfg through the upgrade rule file in the offline.
3. The format of the upgrade rule command is: < opt > < file name > < addr > [ size ], where opt is the operation performed, 'w' denotes writing FLASH, 'r' denotes reading FLASH, 'file name' denotes the file name of the upgrade file, or the file name of the read content save, 'addr' denotes the FLASH address to be written or read, 'size' is optional, and is valid only when the operation is read, which denotes how many bytes of data need to be read.
4. And a green LED lamp is used for indicating the success or failure of the upgrade, the green lamp flickers in the upgrade process, the green lamp is always on when the upgrade is successful, and the green lamp is always off when the upgrade is failed.
5. And a red LED lamp is used for indicating the upgraded error information, the red lamp is normally turned off when no error exists, and the red lamp is firstly turned on for one second when an error exists, and then flickers for a plurality of times at the speed of 200 milliseconds according to the error code. For example, when the error code is 3, the red light is first lit for one second and then blinks for 3 times, i.e. 1 long code plus 3 short codes.
6. With several error notification codes as follows:
(1) SWD connection failure
(2) Failure to erase the chip
(3) The length of the error FLASH address or file name is more than 15
(4) Cannot open the upgrade file
(5) Check failure
7. Connecting SWD with system on chip, downloading and upgrading, and reading and writing TF card by FATFS file system
8. Different data can be written into different FLASH addresses according to the upgrading rule, and the data in different FLASH addresses can be read out and stored in the TF card.
The application has the following effects: compared with the traditional online upgrading technology, the method can get rid of dependence on huge PC computers, so that the upgrading platform is easier to deploy when manufacturers produce in batches. The requirements on computer knowledge and professional knowledge of users are reduced, software upgrading of different platforms becomes simple and easy to operate, and the upgrading file can be written by one key by pressing a start key. The upgrading system can complete the deployment of the upgrading platform by using 5V power supply and several wire harnesses, so that the upgrading environment is safer and more reliable. The problem that software upgrading for the system on chip fails due to reasons such as inconsistency of windows versions of PCs or failure of driver installation is solved, software upgrading of the system on chip is the same as copying of an upgrading file to a USB flash disk, and developers just contacting the system on chip can concentrate on software development. Different FLASH addresses can be written according to the upgrading rule, so that the method and the device can be used for writing bootloaders, apps, encrypted data, product information and the like.
As shown in fig. 3, the system for downloading software upgrade offline in the present application includes: an offline upgrade system to: periodically detecting whether the first interface is inserted into the memory card; when detecting that the first interface is inserted into the memory card, executing the subsequent steps; controlling a green light connected with an offline upgrading system to light up; and opening an off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
The first interface is an SPI interface, and the storage card is a TF card. The off-line upgrading system is connected with the matrix keyboard and the functional keys through GPIO interfaces, the off-line upgrading system is connected with the LED and the seven-segment digital tube through the GPIO interfaces, and the off-line upgrading system is connected with the target platform through an SWD interface.
The offline upgrade system is used for: opening the file in the memory card by using the appointed file names in sequence, adding the current file name into the list whenever the return is successful, and finishing the loading of the file when the return is failed; the loaded files are stored in a list according to the sequence of the dictionary order, the input command is received through a key, and a seven-segment digital tube connected with an offline upgrading system is displayed in a flashing mode to show that the files are being selected; receiving a command of selecting a file through a confirming key, displaying the seven-segment digital tube in a normally-on mode to indicate that the file is selected, and displaying the numerical value of the seven-segment digital tube to indicate the number of the files in the list; the method comprises the steps that a command for starting upgrading is received through a starting key, an offline upgrading system is connected with a target platform through an SWD interface, after the command for starting upgrading is received, a file is written into a fixed 0x08000000 position, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and the red LED is used for indicating according to an error code.
In the present application, the system embodiment of the offline download software upgrade is basically similar to the method embodiment of the offline download software upgrade, and reference is made to the description of the method embodiment of the offline download software upgrade for relevant points.
It is clear to a person skilled in the art that the solution according to the embodiments of the invention can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, an FPGA (Field-Programmable Gate Array), an IC (Integrated Circuit), or the like.
Each processing unit and/or module according to the embodiments of the present invention may be implemented by an analog circuit that implements the functions described in the embodiments of the present invention, or may be implemented by software that executes the functions described in the embodiments of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
All functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for downloading a software upgrade offline, comprising:
the off-line upgrading system periodically detects whether the first interface is inserted into the storage card; when the first interface is detected to be inserted into the memory card, executing the subsequent steps;
a green light connected with the off-line upgrading system is turned on;
and opening the off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
2. The method for off-line downloading of software upgrades as claimed in claim 1, wherein said loading the files in the memory card and entering a key-selected upgrade mode if the opening fails comprises:
opening the file in the memory card by using the appointed file names in sequence, adding the current file name into the list whenever the return is successful, and finishing the loading of the file when the return is failed;
the loaded files are stored in a list according to the sequence of the dictionary order, the input command is received through a key, and a seven-segment digital tube connected with the offline upgrading system is displayed in a flashing mode to show that the files are being selected;
receiving a command of selecting a file through a determination key, displaying a seven-segment digital tube in a normally-on mode to indicate that the file is selected, wherein the numerical value displayed by the seven-segment digital tube indicates the number of the files in the list;
the method comprises the steps that a command for starting upgrading is received through a starting key, the offline upgrading system is connected with a target platform through an SWD interface, after the command for starting upgrading is received, a file is written into a fixed 0x08000000 position, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and red LED is used for indicating according to an error code.
3. The method for downloading software upgrades offline as claimed in claim 1, wherein said opening an offline upgrade configuration file in said memory card, and if the opening is successful, entering an automatic upgrade mode, comprises:
reading the programming rule in the offline upgrade configuration file line by line, checking whether the read programming rule is correct, including whether the length of the file name is less than 15 characters, whether the written address value is in the range of 0x08000000 to 0x0801ffff, storing the correct programming rule in a linked list, if the linked list is not empty, waiting to receive a start instruction, connecting the SWD with a target platform, starting upgrading according to the programming rule, if the programming address in the programming rule is equal to 0x08000000, erasing a chip, and then writing the file into the address, otherwise, directly writing the file into the specified address in the programming rule.
4. The method for offline downloading of software upgrades of claim 1 to 3, further comprising: and the green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and the red LED is used for indicating according to the error code.
5. The method for offline downloading of software upgrades of claim 1 to 3, further comprising: after writing, if an error exists, the red LED is normally lighted for 1 second, and then flickers for a plurality of times according to an error code at the frequency of 200 milliseconds; and if the writing is normal, the green LED lamp is normally on.
6. A method for off-line downloading of software upgrades according to any of claims 1-3, characterised in that the process of upgrading comprises the steps of:
sending 51 '1's for resetting SWD, switching JTAG to SWD, reading the value of a debugging port identification register (DPIDR), and if the return value is not 0, successfully connecting with the system on chip;
setting the STKCMPCLR, STKERRCLR, WDERRCLR, ORUNERRCLR bit of an ABORT register (ABORT), clearing the state, ensuring that a CTRL/STAT register is selected in a DPBANKSEL, sending a system power-on request, waiting for a response, and stopping the program if the response is not responded after the time is out;
enabling the system on chip to enter a reset programming mode, downloading a programming algorithm to an SRAM and initializing;
reading 1024 bytes of data from the upgrade file in a circulating manner, programming the data to FLASH by using pages, and filling and aligning the data of the last page, wherein the size of the data of the last page is smaller than 1024 by using 0;
reading data from the first page and the last page of the FLASH programming according to the file size, and comparing the data with the upgrading file data, wherein if the data are the same, the upgrading is successful;
and resetting the system on the chip in a soft mode, and releasing the SWD interface.
7. A system for downloading a software upgrade offline, comprising: an offline upgrade system to:
periodically detecting whether the first interface is inserted into the memory card; when the first interface is detected to be inserted into the memory card, executing the subsequent steps;
controlling a green light connected with the off-line upgrading system to be turned on;
and opening the off-line upgrading configuration file in the memory card, entering an automatic upgrading mode if the opening is successful, loading the file in the memory card if the opening is failed, and entering a key selection upgrading mode.
8. The system for offline downloading of software upgrades of claim 7, wherein the first interface is an SPI interface and the memory card is a TF card.
9. The system for offline downloading of software upgrades of claim 7, wherein the offline upgrade system is connected with a matrix keyboard and function keys through GPIO interfaces, the offline upgrade system is connected with LEDs and seven-segment nixie tubes through GPIO interfaces, and the offline upgrade system is connected with a target platform through an SWD interface.
10. The system for offline downloading of software upgrades of any of claims 7 to 9, wherein the offline upgrade system is configured to:
opening the file in the memory card by using the appointed file names in sequence, adding the current file name into the list whenever the return is successful, and finishing the loading of the file when the return is failed;
the loaded files are stored in a list according to the sequence of the dictionary order, the input command is received through a key, and a seven-segment digital tube connected with the offline upgrading system is displayed in a flashing mode to show that the files are being selected;
receiving a command of selecting a file through a determination key, displaying a seven-segment digital tube in a normally-on mode to indicate that the file is selected, wherein the numerical value displayed by the seven-segment digital tube indicates the number of the files in the list;
the method comprises the steps that a command for starting upgrading is received through a starting key, the offline upgrading system is connected with a target platform through an SWD interface, after the command for starting upgrading is received, a file is written into a fixed 0x08000000 position, a green LED flashes quickly in the upgrading process, the upgrading is stopped when an error occurs in the process, the target platform is reset, and red LED is used for indicating according to an error code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110057395.9A CN112667264A (en) | 2021-01-15 | 2021-01-15 | Method and system for upgrading off-line downloaded software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110057395.9A CN112667264A (en) | 2021-01-15 | 2021-01-15 | Method and system for upgrading off-line downloaded software |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112667264A true CN112667264A (en) | 2021-04-16 |
Family
ID=75415419
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110057395.9A Pending CN112667264A (en) | 2021-01-15 | 2021-01-15 | Method and system for upgrading off-line downloaded software |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112667264A (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20050121074A (en) * | 2004-06-21 | 2005-12-26 | 엘지전자 주식회사 | Upgrading device of the mobile communication terminal using a memory card and controlling method therefore |
CN1734419A (en) * | 2004-08-03 | 2006-02-15 | 英保达股份有限公司 | Software updating apparatus and method for digital video record system |
CN1885921A (en) * | 2005-06-22 | 2006-12-27 | 厦门华侨电子企业有限公司 | TV set setting USB/memory card interface and its software upgrading method |
CN101599040A (en) * | 2008-06-05 | 2009-12-09 | 彭增金 | Multi-interface simulation programmer |
CN101937349A (en) * | 2010-08-28 | 2011-01-05 | 中兴通讯股份有限公司 | Wireless communication terminal and software upgrading method thereof |
US20110173598A1 (en) * | 2004-04-21 | 2011-07-14 | Chris Cassapakis | Updating an electronic device with update agent code |
CN102253846A (en) * | 2010-05-21 | 2011-11-23 | 康佳集团股份有限公司 | Method for upgrading embedded system software |
CN102662689A (en) * | 2012-03-15 | 2012-09-12 | 青岛海信传媒网络技术有限公司 | Method and system for upgrading embedded software based on USB interface |
CN103825737A (en) * | 2013-12-30 | 2014-05-28 | 北京金玉衡科技有限责任公司 | Security apparatus, system and method for on-line upgrading of industrial control system |
CN104102499A (en) * | 2013-04-02 | 2014-10-15 | 中兴通讯股份有限公司 | Mobile terminal and mobile terminal software upgrading method |
CN105867985A (en) * | 2016-04-25 | 2016-08-17 | 广州路派电子科技有限公司 | Method for upgrading file through vehicle-mounted decoder software |
CN108037931A (en) * | 2017-12-06 | 2018-05-15 | 广州路派电子科技有限公司 | A kind of method that file programming is carried out to microprocessor storage unit |
-
2021
- 2021-01-15 CN CN202110057395.9A patent/CN112667264A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110173598A1 (en) * | 2004-04-21 | 2011-07-14 | Chris Cassapakis | Updating an electronic device with update agent code |
KR20050121074A (en) * | 2004-06-21 | 2005-12-26 | 엘지전자 주식회사 | Upgrading device of the mobile communication terminal using a memory card and controlling method therefore |
CN1734419A (en) * | 2004-08-03 | 2006-02-15 | 英保达股份有限公司 | Software updating apparatus and method for digital video record system |
CN1885921A (en) * | 2005-06-22 | 2006-12-27 | 厦门华侨电子企业有限公司 | TV set setting USB/memory card interface and its software upgrading method |
CN101599040A (en) * | 2008-06-05 | 2009-12-09 | 彭增金 | Multi-interface simulation programmer |
CN102253846A (en) * | 2010-05-21 | 2011-11-23 | 康佳集团股份有限公司 | Method for upgrading embedded system software |
CN101937349A (en) * | 2010-08-28 | 2011-01-05 | 中兴通讯股份有限公司 | Wireless communication terminal and software upgrading method thereof |
CN102662689A (en) * | 2012-03-15 | 2012-09-12 | 青岛海信传媒网络技术有限公司 | Method and system for upgrading embedded software based on USB interface |
CN104102499A (en) * | 2013-04-02 | 2014-10-15 | 中兴通讯股份有限公司 | Mobile terminal and mobile terminal software upgrading method |
CN103825737A (en) * | 2013-12-30 | 2014-05-28 | 北京金玉衡科技有限责任公司 | Security apparatus, system and method for on-line upgrading of industrial control system |
CN105867985A (en) * | 2016-04-25 | 2016-08-17 | 广州路派电子科技有限公司 | Method for upgrading file through vehicle-mounted decoder software |
CN108037931A (en) * | 2017-12-06 | 2018-05-15 | 广州路派电子科技有限公司 | A kind of method that file programming is carried out to microprocessor storage unit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105573743B (en) | Chip burning system and method and electronic equipment | |
CN101330399A (en) | Method for upgrading built-in equipment | |
US11841398B2 (en) | Method and apparatus and non-transitory computer-readable storage medium for debugging solid-state disk (SSD) device | |
CN110196726A (en) | A method of the load of FPGA program remote upgrading is realized based on CPU+CPLD | |
CN111459744A (en) | Firmware burning method and firmware debugging method of video processing chip | |
CN112231005A (en) | Method for managing FPGA (field programmable Gate array) version based on UBOOT (Universal boot on Board) | |
US9600397B2 (en) | Dynamic debugging method of a software module and corresponding device | |
US20080126862A1 (en) | System and Method for Testing Software Code for Use on a Target Processor | |
CN108694052B (en) | Firmware upgrading method, firmware upgrading device and firmware upgrading system | |
CN111736882B (en) | Remote upgrading method of DSP program | |
CN113377586A (en) | Automatic server detection method and device and storage medium | |
CN111856241A (en) | Chip mass production platform system and implementation method thereof | |
CN112667264A (en) | Method and system for upgrading off-line downloaded software | |
CN100498710C (en) | Method for reading and electing read only memory program code on self-storing mechanism | |
US11933847B2 (en) | Apparatus and system for debugging solid-state disk (SSD) device | |
EP4296860A1 (en) | Method for running startup program of electronic device, and electronic device | |
US20220413766A1 (en) | Method and apparatus and non-transitory computer-readable storage medium for debugging solid-state disk (ssd) device | |
CN114996717A (en) | Upgrade program design method for preventing error erasure | |
CN113900693A (en) | Firmware upgrading method, device and system, electronic equipment and storage medium | |
CN110321171B (en) | Startup detection device, system and method | |
Harvey | Automated device for Raspberry Pi Pico recovery | |
CN219266939U (en) | Upgrading system for tail gas detection | |
CN102460386A (en) | Method, apparatus and computer program for loading files during boot- up process | |
CN102799466A (en) | Guide device and guide method applied to PowerPC minimum system | |
CN114038549A (en) | Anesthesia machine software online upgrading system and method |
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 |