CN109710277B - Burning method and system for onboard SPI Flash memory - Google Patents

Burning method and system for onboard SPI Flash memory Download PDF

Info

Publication number
CN109710277B
CN109710277B CN201811571474.6A CN201811571474A CN109710277B CN 109710277 B CN109710277 B CN 109710277B CN 201811571474 A CN201811571474 A CN 201811571474A CN 109710277 B CN109710277 B CN 109710277B
Authority
CN
China
Prior art keywords
embedded processor
ejtag
upper computer
debugging interface
memory chip
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.)
Active
Application number
CN201811571474.6A
Other languages
Chinese (zh)
Other versions
CN109710277A (en
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.)
Arkmicro Technologies Inc
Original Assignee
Arkmicro Technologies Inc
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 Arkmicro Technologies Inc filed Critical Arkmicro Technologies Inc
Priority to CN201811571474.6A priority Critical patent/CN109710277B/en
Publication of CN109710277A publication Critical patent/CN109710277A/en
Application granted granted Critical
Publication of CN109710277B publication Critical patent/CN109710277B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention is suitable for the field of electricity, and provides a programming method and a system for an onboard SPI Flash memory. The programming method comprises the following steps: the upper computer provided with the J-LINK driver program for driving the EJTAG debugging unit runs the J-LINK driver program, and downloads the system program to the memory chip through the EJTAG debugging interface and the embedded processor; the upper computer enables the embedded processor to run the system program downloaded into the memory chip through the EJTAG debugging interface, and when data are completely copied to the SPI Flash memory from the memory chip, the programming of the onboard SPI Flash memory is completed. Therefore, after the SPI Flash memory is fixedly connected to the circuit board, if a program needs to be programmed, the embedded processor can be controlled from the outside through a J-LINK driving program to complete programming of the onboard SPI Flash memory by directly utilizing an EJTAG debugging interface of the embedded processor on the circuit board, and a simple and convenient means is provided for subsequent equipment upgrading and maintenance.

Description

Burning method and system for onboard SPI Flash memory
Technical Field
The invention relates to the field of electricity, in particular to a programming method and a system of an onboard SPI Flash memory.
Background
In an on-vehicle practical application scheme, in order to resist shock or save the size of an integrated circuit board, an SPI (Serial Peripheral Interface) Flash memory with a smaller Package size, such as an SOP (Small Outline Package) and a TSSOP (Thin reduced SOP Package), is often selected, and is generally called an SPI Flash memory, and is soldered on the integrated circuit board, and may be called an on-board SPI Flash memory.
For an on-board SPI Flash memory, in the prior art, a burner is generally used to burn a bare chip of the SPI Flash memory (the SPI Flash memory before burning has no executable program), and then the bare chip is uniformly soldered to an integrated circuit board, the bare chip is uniformly upgraded on the integrated circuit board by an SD card, or the system is upgraded on-line by the SD card after being normally started.
Once faults such as error erasing or upgrading failure occur in development or test, the system cannot be normally started, the method for maintaining can only blow off a welded onboard SPI Flash memory by using a special heating air gun, then burn programs by using a burner, and finally weld the onboard SPI Flash memory back to the original position again. Therefore, the method has high maintenance cost and great technical difficulty in maintenance.
Disclosure of Invention
The invention aims to provide a programming method and a system of an onboard SPI Flash memory, and aims to solve the problems of high maintenance cost and high technical difficulty of maintenance in the prior art.
In a first aspect, the present invention provides a programming method for an onboard SPI Flash memory, the programming method comprising:
the upper computer provided with the J-LINK driver program for driving the EJTAG debugging unit runs the J-LINK driver program, and downloads the system program to the memory chip through the EJTAG debugging interface and the embedded processor;
the upper computer enables the embedded processor to run the system program downloaded into the memory chip through the EJTAG debugging interface, and when data are completely copied to the SPI Flash memory from the memory chip, the programming of the onboard SPI Flash memory is completed.
The invention provides a programming system of an onboard SPI Flash memory, which comprises an embedded processor, an EJTAG debugging interface, a memory chip and an upper computer, wherein the embedded processor comprises an EJTAG debugging unit, a memory controller, an SPI controller and an SRAM which are connected through a bus;
the upper computer provided with the J-LINK driver program for driving the EJTAG debugging unit runs the J-LINK driver program, and downloads the system program to the memory chip through the EJTAG debugging interface and the embedded processor;
the upper computer enables the embedded processor to run the system program downloaded into the memory chip through the EJTAG debugging interface, and when data are completely copied to the SPI Flash memory from the memory chip, the programming of the onboard SPI Flash memory is completed.
In the invention, the upper computer enables the embedded processor to run the system program downloaded into the memory chip through the EJTAG debugging interface, thereby automatically completing the programming of the onboard SPI Flash memory. Therefore, after the SPI Flash memory is fixedly connected to the circuit board, if a program needs to be programmed, the program does not need to be disassembled or fixed sealing glue is removed by hot melting through a professional heating air gun, the programming of the onboard SPI Flash memory can be completed by directly utilizing an EJTAG debugging interface of the embedded processor on the circuit board and controlling the embedded processor from the outside through a J-LINK driving program, and a simple and convenient means is provided for subsequent equipment upgrading and maintenance.
Drawings
Fig. 1 is a schematic diagram of a programming system of an on-board SPI Flash memory according to an embodiment of the present invention.
Fig. 2 is a flowchart of a programming method of an on-board SPI Flash memory according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Referring to fig. 1, a programming system of an onboard SPI Flash memory according to an embodiment of the present invention includes an embedded processor 1, an EJTAG debug interface 2, a memory chip 3, and an upper computer 4, where the embedded processor 1 includes an EJTAG (Enhanced Joint Test Action Group) debug unit 11, a memory controller 12, an SPI controller 13, and an SRAM14, the EJTAG debug unit 11 is connected to the EJTAG debug interface 2, the memory controller 12 is connected to the memory chip 3, the EJTAG debug interface 2 is further connected to the upper computer 4, the SPI controller 13 is connected to the SPI Flash memory welded to an integrated circuit board, and a J-LINK driver for driving the EJTAG debug unit is installed in the upper computer 4.
The memory chip 3 may be a DDR (Double Data Rate) memory chip, such as a DDR1 memory chip, a DDR2 memory chip, a DDR3 memory chip, and the like. The J-LINK driver can be any version of J-LINK driver, such as a J-LINK V4.90 driver, a J-LINK V6.20 driver, and the like.
The programming method of the onboard SPI Flash memory provided by the embodiment of the invention comprises the following steps:
s101, an upper computer provided with a J-LINK driver program for driving an EJTAG debugging unit runs the J-LINK driver program, and downloads a system program to a memory chip through an EJTAG debugging interface and an embedded processor;
s102, enabling the embedded processor to run the system program downloaded into the memory chip by the upper computer through the EJTAG debugging interface, and completing the programming of the onboard SPIFlash memory when data is completely copied to the SPI Flash memory from the memory chip.
In the embodiment of the present invention, S101 may specifically include the following steps:
s1011, the upper computer provided with the J-LINK driver for driving the EJTAG debugging unit runs the J-LINK driver, and resets the embedded processor through the EJTAG debugging interface;
s1012, the upper computer hangs up the embedded processor through an EJTAG debugging interface;
s1013, the upper computer downloads a system boot program to an SRAM (Static Random-Access Memory) of the embedded processor through the EJTAG debugging interface; the system boot program can be stored from the SRAM initial address;
s1014, setting a PC pointer of the embedded processor by the upper computer through an EJTAG debugging interface; the method specifically comprises the following steps: the upper computer sets a PC pointer of the embedded processor as an SRAM starting address through an EJTAG debugging interface;
s1015, enabling the embedded processor to run the system boot program downloaded to the SRAM through the EJTAG debugging interface by the upper computer;
s1016, after the system boot program runs, the upper computer hangs up the embedded processor through an EJTAG debugging interface;
s1017, setting the embedded processor to be in an ARM running state by the upper computer through an EJTAG debugging interface; specifically, the state of an embedded processor is set by an upper computer through an EJTAG debugging interface and is changed from a THUMB state to an ARM running state; in the ARM architecture, the system can work in three different states, namely an ARM state, a Thumb-2 state and a debugging state.
S1018, downloading a system program to the memory chip by the upper computer through the EJTAG debugging interface and the embedded processor; specifically, the system program may be stored from a start address of the memory chip.
In the embodiment of the present invention, S102 may specifically include the following steps:
s1021, the upper computer sets a J-LINK system upgrading identifier in the SRAM of the embedded processor through an EJTAG debugging interface; specifically, the spare address after 4K in the SRAM writes "spidrite" (0x 530 x 500 x 490 x 570 x 520 x 490 x 540 x45) as the system upgrade flag;
s1022, the upper computer sets a PC pointer of the embedded processor through an EJTAG debugging interface; the method specifically comprises the following steps: the upper computer sets a PC pointer of the embedded processor as a memory starting address through an EJTAG debugging interface;
s1023, the upper computer sets a system program operation breakpoint through an EJTAG debugging interface; the method specifically comprises the following steps: the upper computer sets a system program operation breakpoint in front of the SPI Flash memory by copying data in the memory chip through an EJTAG debugging interface;
s1024, enabling the embedded processor to run the system program downloaded into the memory chip by the upper computer through the EJTAG debugging interface;
s1025, after the system program runs to a breakpoint, the upper computer hangs up the embedded processor through an EJTAG debugging interface;
s1026, the upper computer downloads a system program containing a system program information frame header into the memory chip through an EJTAG debugging interface; the method specifically comprises the following steps: the upper computer downloads the system program containing the system program information frame header to the memory chip through the EJTAG debugging interface again to automatically upgrade the initial copy address, and the difference between the system program downloaded to the memory chip at this time and the system program downloaded to the memory chip in S1018 is only that the system program information frame header is added;
s1027, enabling the embedded processor to continue to run the system program in the memory chip by the upper computer through an EJTAG debugging interface, enabling the system to enter an automatic upgrading state at the moment, and copying data from the memory chip to the SPIFlash memory; the method specifically comprises the following steps: the memory controller controls the processing data to start copying data from the initial copy address of the memory chip for automatic upgrading and writes the data into the SPI Flash memory through the SPI controller;
s1028, when the data are completely copied to the SPI Flash memory from the initial copy address of the automatic upgrading of the memory chip, the programming of the onboard SPI Flash memory is completed.
In the invention, the upper computer enables the embedded processor to run the system program downloaded into the memory chip through the EJTAG debugging interface, thereby automatically completing the programming of the onboard SPI Flash memory. Therefore, after the SPI Flash memory is fixedly connected to the circuit board, if a program needs to be programmed, the program does not need to be detached or fixed sealing glue is removed by hot melting through a professional heating air gun, the programming of the onboard SPI Flash memory can be completed by directly utilizing an EJTAG debugging interface of the embedded processor on the circuit board and controlling the embedded processor from the outside through a J-LINK driving program, and a simple and convenient means is provided for subsequent equipment upgrading and maintenance.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A programming method of an on-board SPI Flash memory is characterized by comprising the following steps:
the upper computer provided with the J-LINK driver program for driving the EJTAG debugging unit runs the J-LINK driver program, and downloads the system program to the memory chip through the EJTAG debugging interface and the embedded processor;
the upper computer sets a J-LINK system upgrading identification in the SRAM of the embedded processor through an EJTAG debugging interface;
the upper computer sets an embedded processor PC pointer through an EJTAG debugging interface;
the upper computer sets a system program operation breakpoint through an EJTAG debugging interface;
enabling the embedded processor to run a system program downloaded into the memory chip by the upper computer through an EJTAG debugging interface;
after the system program runs to a breakpoint, the upper computer hangs up the embedded processor through an EJTAG debugging interface;
the upper computer downloads a system program containing a system program information frame header into the memory chip through an EJTAG debugging interface;
enabling the embedded processor to continue operating the system program in the memory chip by the upper computer through the EJTAG debugging interface, enabling the system to enter an automatic upgrading state at the moment, and copying data from the memory chip to the SPI Flash memory;
and when the data is completely copied to the SPI Flash memory from the initial copy address of the automatic upgrading of the memory chip, the programming of the onboard SPI Flash memory is finished.
2. The programming method of claim 1, wherein the running of the J-LINK driver by the upper computer having the J-LINK driver installed therein for driving the EJTAG debug unit, the downloading of the system program to the memory chip via the EJTAG debug interface and the embedded processor specifically comprises:
the upper computer provided with the J-LINK driver program for driving the EJTAG debugging unit runs the J-LINK driver program, and resets the embedded processor through the EJTAG debugging interface;
the upper computer suspends the embedded processor through an EJTAG debugging interface;
the upper computer downloads a system bootstrap program to an SRAM of the embedded processor through an EJTAG debugging interface;
the upper computer sets a PC pointer of the embedded processor through an EJTAG debugging interface;
enabling the embedded processor to run a system boot program downloaded into the SRAM by the upper computer through an EJTAG debugging interface;
after the system boot program runs, the upper computer hangs up the embedded processor through the EJTAG debugging interface;
the upper computer sets the embedded processor to be in an ARM running state through an EJTAG debugging interface;
and the upper computer downloads the system program to the memory chip through the EJTAG debugging interface and the embedded processor.
3. The programming method of claim 2, wherein the host computer downloads the system boot program into the SRAM of the embedded processor through the EJTAG debug interface, and in particular stores the system boot program starting from the SRAM start address.
4. The programming method of claim 2, wherein the setting, by the upper computer through the EJTAG debug interface, of the PC pointer of the embedded processor is specifically: and the upper computer sets a PC pointer of the embedded processor as an SRAM starting address through an EJTAG debugging interface.
5. The programming method of claim 2, wherein the host computer sets the embedded processor to the ARM operating state through the EJTAG debug interface, and in particular, the host computer sets the state of the embedded processor through the EJTAG debug interface to change the state of the embedded processor from the THUMB state to the ARM operating state.
6. The programming method of claim 2, wherein the host computer downloads the system program into the memory chip through the EJTAG debug interface and the embedded processor, and stores the system program from a start address of the memory chip.
7. The programming method of claim 1, wherein the setting of the PC pointer of the embedded processor by the upper computer through the EJTAG debug interface is specifically: the upper computer sets a PC pointer of the embedded processor as a memory starting address through an EJTAG debugging interface.
8. The programming method of claim 1, wherein the setting of the system program running breakpoint by the upper computer through the EJTAG debug interface is specifically: and the upper computer sets the system program operation breakpoint in front of the SPI Flash memory by copying the data in the memory chip through the EJTAG debugging interface.
9. A programming system of an onboard SPI Flash memory is characterized by comprising an embedded processor, an EJTAG debugging interface, a memory chip and an upper computer, wherein the embedded processor comprises an EJTAG debugging unit, a memory controller, an SPI controller and an SRAM which are connected through a bus;
the upper computer provided with the J-LINK driver program for driving the EJTAG debugging unit runs the J-LINK driver program, and downloads the system program to the memory chip through the EJTAG debugging interface and the embedded processor;
the upper computer sets a J-LINK system upgrading identification in the SRAM of the embedded processor through an EJTAG debugging interface;
the upper computer sets an embedded processor PC pointer through an EJTAG debugging interface;
the upper computer sets a system program operation breakpoint through an EJTAG debugging interface;
enabling the embedded processor to run a system program downloaded into the memory chip by the upper computer through an EJTAG debugging interface;
after the system program runs to a breakpoint, the upper computer hangs up the embedded processor through an EJTAG debugging interface;
the upper computer downloads a system program containing a system program information frame header into the memory chip through an EJTAG debugging interface;
enabling the embedded processor to continue operating the system program in the memory chip by the upper computer through the EJTAG debugging interface, enabling the system to enter an automatic upgrading state at the moment, and copying data from the memory chip to the SPI Flash memory;
and when the data is completely copied to the SPI Flash memory from the initial copy address of the automatic upgrading of the memory chip, the programming of the onboard SPI Flash memory is finished.
10. The write system of claim 9, wherein the memory chip is a DDR memory chip.
CN201811571474.6A 2018-12-21 2018-12-21 Burning method and system for onboard SPI Flash memory Active CN109710277B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811571474.6A CN109710277B (en) 2018-12-21 2018-12-21 Burning method and system for onboard SPI Flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811571474.6A CN109710277B (en) 2018-12-21 2018-12-21 Burning method and system for onboard SPI Flash memory

Publications (2)

Publication Number Publication Date
CN109710277A CN109710277A (en) 2019-05-03
CN109710277B true CN109710277B (en) 2022-04-01

Family

ID=66256051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811571474.6A Active CN109710277B (en) 2018-12-21 2018-12-21 Burning method and system for onboard SPI Flash memory

Country Status (1)

Country Link
CN (1) CN109710277B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116594700B (en) * 2023-07-17 2023-12-12 合肥康芯威存储技术有限公司 Method and device for cloning eMMC chip, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184741A (en) * 2011-02-28 2011-09-14 浪潮电子信息产业股份有限公司 Method for programming serial periphery interface (SPI) FLASH
CN102629212A (en) * 2012-04-28 2012-08-08 广东宝莱特医用科技股份有限公司 Method for indirectly programming to NANDFLASH based on J-LINK
CN202956753U (en) * 2012-11-05 2013-05-29 汕尾芯灵电子科技有限公司 Programming device and programming system of flash memory chip in embedded system
CN103677885A (en) * 2012-09-21 2014-03-26 厦门雅迅网络股份有限公司 ARM FLASH simple program programming method
CN108021385A (en) * 2017-12-29 2018-05-11 北京神州龙芯集成电路设计有限公司 A kind of programming system and method for onboard SPI Flash

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7421633B2 (en) * 2005-03-21 2008-09-02 Texas Instruments Incorporated Controller receiving combined TMS/TDI and suppyling separate TMS and TDI
US9348783B2 (en) * 2012-04-19 2016-05-24 Lockheed Martin Corporation Apparatus and method emulating a parallel interface to effect parallel data transfer from serial flash memory
CN203117963U (en) * 2012-12-17 2013-08-07 新唐科技股份有限公司 Debugging system and device for providing graphical pin interface
US10223094B2 (en) * 2016-09-30 2019-03-05 Intel Corporation Initializing a system on a chip

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184741A (en) * 2011-02-28 2011-09-14 浪潮电子信息产业股份有限公司 Method for programming serial periphery interface (SPI) FLASH
CN102629212A (en) * 2012-04-28 2012-08-08 广东宝莱特医用科技股份有限公司 Method for indirectly programming to NANDFLASH based on J-LINK
CN103677885A (en) * 2012-09-21 2014-03-26 厦门雅迅网络股份有限公司 ARM FLASH simple program programming method
CN202956753U (en) * 2012-11-05 2013-05-29 汕尾芯灵电子科技有限公司 Programming device and programming system of flash memory chip in embedded system
CN108021385A (en) * 2017-12-29 2018-05-11 北京神州龙芯集成电路设计有限公司 A kind of programming system and method for onboard SPI Flash

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种基于EJTAG快速在线烧写Flash的设计;董相晖等;《微电子学与计算机》;20071205(第12期);第106-108+112页 *
基于龙芯平台的J-Link协议移植实现;夏豪骏等;《计算机工程》;20140228;第267-270页 *

Also Published As

Publication number Publication date
CN109710277A (en) 2019-05-03

Similar Documents

Publication Publication Date Title
US8386694B2 (en) Memory device, its access method, and memory system
CN102279789B (en) Debugging system and debugging method for embedded system of production phase
CN106095620A (en) A kind of development approach of built-in Linux partition holding
US6842858B2 (en) Mechanism for updating firmware of an electronic device
CN105760191A (en) Embedded system equipment programming mass production method
CN104200843A (en) Flash memory burner, burning system and burning method
CN113377408B (en) High-reliability SRAM type FPGA online upgrading method and system
CN108037938B (en) Card opening method of eMMC
US20070258288A1 (en) Flash programmer for programming NAND flash and NOR/NAND combined flash
CN115658160B (en) Multi-operating system upgrading method, device and system based on multi-core heterogeneous SOC
CN109669729A (en) A kind of starting bootstrap technique of processor
JP2010140266A (en) Electronic device system and electronic device
CN102360569A (en) Burning method, system and apparatus for nand flash chips
US20160306757A1 (en) Bridge configuration in computing devices
JP2010500682A (en) Flash memory access circuit
CN109710277B (en) Burning method and system for onboard SPI Flash memory
CN106649137B (en) Nand Flash bad block management method and device and memory
US6925522B2 (en) Device and method capable of changing codes of micro-controller
US20190286544A1 (en) Method, device and server for checking a defective function
JP2001134629A (en) Simulation method and simulation system
JP3805195B2 (en) Program rewriting apparatus and program rewriting method
US6314024B1 (en) Data processing apparatus
US20030068162A1 (en) Updating system for digital players and method of using the same
CN104503905A (en) Debugging method and debugging system for embedded system
JP2907808B1 (en) Flash memory emulation device and debug system using the same

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
GR01 Patent grant
GR01 Patent grant