CN114756480A - NOR FLASH storage space expansion method and device based on DSP board card - Google Patents

NOR FLASH storage space expansion method and device based on DSP board card Download PDF

Info

Publication number
CN114756480A
CN114756480A CN202210443438.1A CN202210443438A CN114756480A CN 114756480 A CN114756480 A CN 114756480A CN 202210443438 A CN202210443438 A CN 202210443438A CN 114756480 A CN114756480 A CN 114756480A
Authority
CN
China
Prior art keywords
cmd
evmc66x
spi
flash
address
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
CN202210443438.1A
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.)
Yangzhou Jianxing Electronic Technology Co ltd
Original Assignee
Yangzhou Jianxing 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 Yangzhou Jianxing Electronic Technology Co ltd filed Critical Yangzhou Jianxing Electronic Technology Co ltd
Priority to CN202210443438.1A priority Critical patent/CN114756480A/en
Publication of CN114756480A publication Critical patent/CN114756480A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1048Scalability

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Read Only Memory (AREA)

Abstract

The invention discloses a method and a device for expanding NOR FLASH memory space based on a DSP board card, wherein the total number of defined sectors is modified according to the chip capacity of NOR FLASH based on evmc66x _ nor.h provided by TI; the corresponding content in evmc66x _ nor.h is modified, and all values originally defining 3-byte address access are changed into 4 bytes; modifying the related contents of nor _ init, nor _ read, nor _ write and nor _ erase functions in a source file evmc66x _ nor.c, adding a command for defining 4-byte address access in a nor _ init initialization function and sending the command to an SPI (serial peripheral interface), expanding an array cmd for defining the command and the address to 5 bytes in a nor _ read function, writing the 4-byte address into a position corresponding to the cmd, and changing the read 4-byte address and the command to 5 bytes; the modification of the nor _ write and nor _ erase functions is consistent with nor _ read. The invention realizes the access to the maximum storage space of 4GB, and enhances the practicability and the universality of the DSP board card.

Description

NOR FLASH storage space expansion method and device based on DSP board card
Technical Field
The invention relates to the technical field of electronic communication interfaces, in particular to a NOR FLASH storage space expansion method and device based on a DSP board card.
Background
On a board card based on a DSP chip, a NOR FLASH device is used as a common method for loading and booting a DSP program, which provides an effective means for a user to maintain a system that may need to change data or codes in the future. By using the NOR FLASH device, online program programming and data storage can be realized. The common hardware design scheme is that a NOR FLASH chip (the model of the chip is determined according to the capacity requirement) of an SPI interface is externally connected with the DSP and is used for storing programs and data.
Because the DSP development board hardware and software driver provided by TI address the NOR FLASH with 24 bit address, only 16MB memory space can be accessed, when the chip capacity of the selected NOR FLASH exceeds 16MB, the memory space of 16MB is far from enough without corresponding driver development, and with the high-speed development and more extensive use of DSP technology.
Disclosure of Invention
The invention aims to provide a method and a device for expanding NOR FLASH memory space based on a DSP board card, which expand the interface between a DSP chip and a NOR FLASH chip from a 24-bit address to a 32-bit address, thereby realizing the purpose of accessing the maximum 4GB memory space.
The technical solution for realizing the purpose of the invention is as follows: a NOR FLASH storage space expansion method based on a DSP board card comprises the following specific steps:
step 1, modifying the total number of defined sectors according to the selected NOR FLASH chip capacity based on a header file evmc66x _ nor.h in a software driven package provided by TI;
step 2, modifying the read memory operation in evmc66x _ nor.h, and expanding the read 3-byte address to a 4-byte address range;
step 3, modifying a byte page programming operation item in evmc66x _ nor.h, and expanding the original 3-byte address to a 4-byte address range;
step 4, modifying the sector erasing operation in evmc66x _ nor.h, wherein the mode is changed from 3 bytes to 4 bytes;
step 5, adding a defined extension address register in evmc66x _ nor.h, and carrying out initialization assignment;
step 6, adding definitions into a 4-byte address mode register in evmc66x _ nor.h, and carrying out initialization assignment;
step 7, adding a definition exit 4-byte address mode register in evmc66x _ nor.h, and carrying out initialization assignment;
step 8, modifying the relevant content of the NOR _ init function in the software-driven source file evmc66x _ nor.c based on accessing the NOR FLASH: adding an address access command initialized to 4 bytes and sending the command to an SPI (serial peripheral interface) chip;
Step 9, modifying the related content of the nor _ read function in evmc66x _ nor.c: expanding an array cmd for defining the command and the address from 4 bytes to 5 bytes, writing the 4-byte address into a position corresponding to the cmd, and changing the read 4-byte address and the command into a read 5-byte address and a command;
step 10, modify the relevant content of nor _ write function in evmc66x _ nor.c: expanding an array cmd for defining a command and an address from 4 bytes to 5 bytes, writing a 4-byte address into a position corresponding to the cmd, and changing the 4-byte address and the command into a 5-byte address and a command;
step 11, modifying the related content of the nor _ erase function in evmc66x _ nor.c: extend the array cmd, which defines the command and address, from 4 bytes to 5 bytes, write the 4 byte address into the location where the cmd corresponds, and change the value cmd _ len, which defines cmd _ 4 to be equal to 5.
Further, in step 1, the total number of defined sectors is modified according to the selected NOR FLASH chip capacity, which is specifically as follows:
based on the header file evmc66x _ nor.h in the software driven package provided by TI, the total number of sectors δ defined is modified:
the total number δ of the initially defined sectors is 256, one sector is 64KB in size, and the original driver can only access NOR FLASH of 64KB × δ × 64KB × 256 MB;
The user modifies the total number of sectors delta according to the selected NOR FLASH chip capacity:
if 64MB of NOR FLASH is used, δ -64 MB/64 KB-1024;
if 128MB of NOR FLASH is used, δ -128 MB/64 KB (128 × 1024KB) ÷ 64 KB-2048;
by analogy, the total number delta of the sectors is modified to 65536, and the capacity of a corresponding NOR FLASH chip is 4 GB.
Furthermore, the board card consists of a DSP chip TMS320C6657 and a FLASH chip MT25QU512ABB8E12-0SIT, and the capacity of the FLASH chip is 64 MB.
Further, in step 1, based on the header file evmc66x _ nor.h in the software-driven package provided by TI, the total number of sectors is changed from 256 to 1024 according to the selected NOR FLASH chip capacity, which is specifically as follows:
changing the original macro definition SPI _ NOR _ SECTOR _ COUNT:
namely: # define SPI _ NOR _ SECTOR _ COUNT 256
The method is modified as follows: # define SPI _ NOR _ SECTOR _ COUNT 1024.
Further, the steps 2 to 7 are as follows:
step 2 modifies the read memory operation in evmc66x _ nor.h, changing the read 3 byte address to read 4 byte address:
changing the original macro definition SPI _ NOR _ CMD _ READ:
namely: # define SPI _ NOR _ CMD _ READ 0x03
The method comprises the following steps: # define SPI _ NOR _ CMD _ READ 0x13
Step 3 modifies the page programming entry in evmc66x _ nor.h from original 0x02 to 0x 12:
Changing the original macro definition SPI _ NOR _ CMD _ PP:
namely: # define SPI _ NOR _ CMD _ PP 0x02
The method comprises the following steps: # define SPI _ NOR _ CMD _ PP 0x12
Step 4, modify the sector erasure in evmc66x _ nor.h, from original 0xd8 to 0 xdc:
namely: # define SPI _ NOR _ CMD _ SE 0xd8
The method comprises the following steps: # define SPI _ NOR _ CMD _ SE 0xdc
Step 5 adds an extended address register initialization in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ EXTAD 0xc5
Step 6 adds to enter 4byte address mode operation in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ ADD4BYTE 0xb7
Step 7 adds exit 4byte address mode operation in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ EXITADD4BYTE 0xe9
Further, the NOR _ init function in step 8 is to configure the SPI controller for communication between the DSP and the NOR FLASH, modifying the NOR _ init function in evmc66x _ nor.c:
adding initialization SPI interface
Defining: agent 8_ t CMD ═ SPI _ NOR _ CMD _ ADD4 BYTE;
at spi _ release ();
return NOR_EOK;
the previous increase:
spi_xfer(1,&cmd,null,FALSE);
further, the NOR _ read function in step 9 functions to read data from NOR FLASH, modifying the NOR _ read function in evmc66x _ nor.c:
mixing the agent 8_ t cmd [4 ];
Change to agent 8_ t cmd [5 ];
CMD [0] is equal to SPI _ NOR _ CMD _ READ;
cmd[1]=(uint8_t)(addr>>16);
cmd[2]=(uint8_t)(addr>>8);
cmd[3]=(uint8_t)addr;
ret_val=(spi_cmd_read(cmd,4,buf,len));
modified to the following statement:
cmd[0]=SPI_NOR_CMD_READ;
cmd[1]=(uint8_t)(addr>>24);
cmd[2]=(uint8_t)(addr>>16);
cmd[3]=(uint8_t)(addr>>8);
cmd[4]=(uint8_t)addr;
ret_val=(spi_cmd_read(cmd,5,buf,len));
further, the NOR _ write function in step 10 functions to write data into NOR FLASH, modifying the function content of NOR _ write in evmc66x _ nor.c:
let U nt8_ t cmd [4 ];
change to agent 8_ t cmd [5 ];
setting CMD [0] as SPI _ NOR _ CMD _ PP;
cmd[1]=(uint8_t)(addr>>16);
cmd[2]=(uint8_t)(addr>>8);
cmd[3]=(uint8_t)addr;
ret=spi_cmd_write(cmd,4,buf+actual,chunk_len);
the following statements are changed:
cmd[0]=SPI_NOR_CMD_PP;
cmd[1]=(uint8_t)(addr>>24);
cmd[2]=(uint8_t)(addr>>16);
cmd[3]=(uint8_t)(addr>>8);
cmd[4]=(uint8_t)addr;
ret=spi_cmd_write(cmd,5,buf+actual,chunk_len);
further, the NOR _ erase function in step 11 is to erase the data in NOR FLASH, modify the function content of NOR _ erase in evmc66x _ nor.c
Let U nt8_ t cmd [4 ]; change to agent 8_ t cmd [5 ];
CMD [0] ═ SPI _ NOR _ CMD _ SE;
cmd[1]=(address>>16)&0xff;
cmd[2]=(address>>8)&0xff;
cmd[3]=(address>>0)&0xff;
cmd_len=4;
the following statements are changed:
cmd[0]=SPI_NOR_CMD_SE;
cmd[1]=(address>>24)&0xff;
cmd[2]=(address>>16)&0xff;
cmd[3]=(address>>8)&0xff;
cmd[4]=(address>>0)&0xff;
cmd_len=5;
a NOR FLASH memory space expansion device based on a DSP board card realizes the expansion of the capacity of accessing NOR FLASH based on evmc66x _ nor.h and evmc66x _ nor.c driving programs provided by TI and by adopting the NOR FLASH memory space expansion method based on the DSP board card.
Compared with the prior art, the invention has the following remarkable advantages: (1) 3-byte address access in 4 functions of NOR _ init, NOR _ read, NOR _ write and NOR _ erase is modified into 4-byte address access, so that the expansion of NOR FLASH storage capacity is realized; (2) the capacity of the DSP board card for storing programs and data is enlarged, and the practicability and the universality of the DSP board card are enhanced; (3) the space which can only access 16MB originally is expanded to the space which can access 4GB, so that a user can store a large amount of precious data of the outfield test into NOR FLASH for export or permanent storage, and the requirement of modern technology on large storage capacity is met.
Drawings
FIG. 1 is a flow chart diagram of the NOR FLASH memory space expansion method based on the DSP board card.
FIG. 2 is a block diagram of the hardware components of the NOR FLASH memory space expansion device based on the DSP board card.
Detailed Description
The invention provides a method and a device for expanding NOR FLASH memory space based on a DSP board card, which expand the interface between a DSP chip and a NOR FLASH chip from a 24-bit address to a 32-bit address, thereby realizing the access to the maximum 4GB memory space. The adopted technical scheme is as follows: the address extension technology is completed by software and hardware design, and the hardware interface design of the DSP and the NOR FLASH chip refers to the relevant part design of a DSP development board and follows the interface design specification.
With reference to fig. 1, the NOR FLASH memory space expansion method based on the DSP board card of the present invention specifically includes the following steps:
step 1, based on the header file evmc66x _ nor.h in the software driver package provided by TI, modifying the total number of defined sectors according to the selected NOR FLASH chip capacity, specifically as follows:
based on the header file evmc66x _ nor.h in the software driven package provided by TI, the total number of sectors δ defined is modified:
the initially defined total number δ of sectors is 256, one sector is 64KB in size, and the original driver can only access NOR FLASH of 64KB × δ × 64KB × 256 MB;
The user modifies the total number of sectors delta according to the selected NOR FLASH chip capacity:
if 64MB of NOR FLASH is used, δ -64 MB/64 KB-1024;
if 128MB of NOR FLASH is used, δ -128 MB/64 KB (128 × 1024KB) ÷ 64 KB-2048;
by analogy, the total number delta of the sectors is modified to 65536, and the capacity of a corresponding NOR FLASH chip is 4 GB.
Step 2, modifying the read memory operation in evmc66x _ nor.h, and expanding the read 3-byte address to a 4-byte address range;
step 3, modifying byte page programming operation items in evmc66x _ nor.h, and extending the original 3-byte address A23-A0 to a 4-byte address range A31-A0;
step 4, modifying the sector erasing operation in evmc66x _ nor.h, wherein the mode is changed from 3 bytes to 4 bytes;
step 5, adding a defined extension address register in evmc66x _ nor.h, and carrying out initialization assignment;
step 6, adding definitions into a 4-byte address mode register in evmc66x _ nor.h, and carrying out initialization assignment;
step 7, adding a definition exit 4-byte address mode register in evmc66x _ nor.h, and carrying out initialization assignment;
based on the software-driven source file evmc66x _ nor.c accessing the NOR FLASH, the relevant content of the NOR _ init (the function is to configure the communication of the SPI controller between the DSP and the NOR FLASH) function is modified: adding an address access command initialized to 4 bytes, and additionally sending the command to an SPI interface chip;
Step 9, modify the related content of NOR _ read (function is reading data from NOR FLASH) function in evmc66x _ nor.c: expanding an array cmd for defining the command and the address from 4 bytes to 5 bytes, writing the 4-byte address into a position corresponding to the cmd, and changing the read 4-byte address and the command into a read 5-byte address and a command;
step 10, modify the relevant content of NOR _ write (function is writing data into NOR FLASH) function in evmc66x _ nor.c: expanding an array cmd for defining the command and the address from 4 bytes to 5 bytes, writing the 4-byte address into a position corresponding to the cmd, and changing the 4-byte address and the command into a 5-byte address and a command;
step 11, modify the related content of the NOR _ erase function (the function is to erase data in NOR FLASH) in evmc66x _ nor.c: the array cmd, which defines the command and address, is extended from 4 bytes to 5 bytes, the 4 byte address is written to the location corresponding to the cmd, and the value cmd _ len, which defines a value equal to 4, is changed to equal to 5.
According to the above 11 operation steps, the capacity of extended access to NOR FLASH can be realized by modifying and extending the evmc66x _ nor.h and evmc66x _ nor.c drivers provided by TI.
In order to expand the address in the interface driving software provided by TI, firstly, a technical manual of a NOR FLASH chip is consulted, all values originally defining 3-byte address access are changed into values of 4-byte address access, namely, the corresponding content in the evmc66x _ nor.h header file in the steps 2 to 7 is modified; secondly, determining which functions in the interface driving software are related to reading and writing the NOR FLASH, and separating the NOR _ init, NOR _ read, NOR _ write and NOR _ erase functions through layer-by-layer stripping. A command defining 4-byte address access is added to the NOR _ init initialization function and sent to the SPI interface, which enables a 4-byte address access mode of the DSP and NOR FLASH. The sending of the command is not in the original driver software, and the command sending is successful through debugging and testing. In the nor _ read function, the array cmd defining the command and address is extended from 4 bytes to 5 bytes, the 4 byte address is written to the location corresponding to the cmd, and the read 4 byte address and command are changed to read the 5 byte address and command. The modification of this program is not described in the original driver software, and is obtained by a plurality of times of inference and evolution, and the NOR FLASH memory area other than 16MB can be accessed by debugging and testing. And after the nor _ read function is successfully modified, the modification of the nor _ write and nor _ erase functions is completed accordingly. The extended capacity of successfully reading, writing and erasing NORFLASH is realized through testing.
With reference to fig. 2, the present invention further provides a NOR FLASH memory space expansion device based on the DSP board card, which includes a DSP chip, a NOR FLASH chip, JTAG, SDRAM, evmc66x _ nor.h and evmc66x _ nor.c drivers provided based on TI, and the method for expanding and accessing the NOR FLASH memory space is adopted to realize expanding and accessing the capacity of NOR FLASH.
The invention is further illustrated by the following examples in conjunction with the drawings.
Examples
With reference to fig. 2, the design of the relevant part of the DSP board card in this embodiment is composed of a DSP chip TMS320C6657 and a NORFLASH chip MT25QU512ABB8E12-0SIT (64MB), on the basis of ensuring the basic functions of the DSP board card, the versatility and the practicability of the program and data that can be stored in NOR FLASH are fully considered, and the design is performed from two aspects of hardware design and software design, so as to achieve the effect that the NOR FLASH chip can use 64MB at the maximum, and meet the use requirements of various different scenarios and systems for large data amount of FLASH storage. The hardware composition is shown in figure 2.
The main functions of the NOR FLASH board card are to store DSP programs and some initialization data, the maximum demand is estimated to be about 32MB, and the maximum demand is expanded to 64MB in order to enhance the universality and practicability of the board card. Considering the problems of hardware design compatibility and the like, MT25QU512ABB8E12-0SIT (64MB) is selected.
The software is realized by designing an interface driver, the embodiment mainly modifies and expands the software driver provided by the original TI, the board card of the invention consists of a DSP chip TMS320C6657 and a FLASH chip MT25QU512ABB8E12-0SIT (64MB), and the modification content of the driver software is as follows:
with reference to fig. 1, the NOR FLASH memory space expansion method based on the DSP board card of the present invention is implemented by designing an interface driver, modifying and expanding a software driver provided by TI, and specifically includes the following steps for the DSP chip TMS320C6657 and the NOR FLASH chip MT25QU512ABB8E12-0 SIT:
step 1, based on the header file evmc66x _ nor.h in the software driven package provided by TI (i.e. accessing the header file of NOR FLASH software drive), the total number of defined sectors in the software driven package is changed from 256(16MB) to 1024(64 MB). One sector size is 64KB and the present invention uses the MT25QU512ABB8E2-0SIT NOR FLASH chip, which has 64MB of memory space, so it is changed to 1024 here. This value depends on the capacity of the NOR FLASH chip, and can be set to 65536(4GB) at maximum;
step 2, modifying the read memory operation in evmc66x _ nor.h, and expanding the read 3-byte address to a 4-byte address range;
step 3, modifying a byte page programming operation item in evmc66x _ nor.h, and extending the original 3-byte address (A23-A0) to a 4-byte address range (A31-A0);
Step 4, modifying the sector erasing operation in evmc66x _ nor.h, wherein the mode is changed from 3 bytes to 4 bytes;
step 5, adding a defined extension address register in evmc66x _ nor.h, and carrying out initialization assignment;
step 6, adding definitions into a 4-byte address mode register in evmc66x _ nor.h, and carrying out initialization assignment;
step 7, adding a definition exit 4-byte address mode register in evmc66x _ nor.h and carrying out initialization assignment;
step 8, modifying relevant content of a NOR _ init function based on a software-driven source file evmc66x _ nor.c for accessing the NOR FLASH, wherein the NOR _ init function is used for configuring communication of the SPI controller between the DSP and the NOR FLASH;
step 9, modifying the relevant content of a nor _ read function in evmc66x _ nor.c, wherein the nor _ read function is reading data from NORFLASH;
step 10, modifying the relevant content of a NOR _ write function in evmc66x _ nor.c, wherein the NOR _ write function is used for writing data into NOR FLASH;
step 11, modify the related content of the NOR _ erase function in evmc66x _ nor.c, where the NOR _ erase function is to erase the data in NOR FLASH.
According to the above 11 operation steps, the modification and extension based on the evmc66x _ nor.h and evmc66x _ nor.c drivers provided by TI can easily realize the extension of the access capacity of NOR FLASH.
Further, step 1 changes the total number of sectors in the software driver evmc66x _ nor.h provided by TI from 256(16M) to 1024 (64M):
changing the original macro definition SPI _ NOR _ SECTOR _ COUNT:
namely: # define SPI _ NOR _ SECTOR _ COUNT 256
The method is modified as follows: # define SPI _ NOR _ SECTOR _ COUNT 1024;
further, step 2 modifies the read memory operation in evmc66x _ nor.h, changing the read 3 byte address to read 4 byte address:
changing the original macro definition SPI _ NOR _ CMD _ READ:
namely: # define SPI _ NOR _ CMD _ READ 0x03
The method is modified as follows: # define SPI _ NOR _ CMD _ READ 0x13
Further, step 3 modifies the page program entry in evmc66x _ nor.h from original 0x02 to 0x 12:
changing the original macro definition SPI _ NOR _ CMD _ PP:
namely: # define SPI _ NOR _ CMD _ PP 0x02
The method comprises the following steps: # define SPI _ NOR _ CMD _ PP 0x12
Further, step 4 modifies the sector erasure in evmc66x _ nor.h from original 0xd8 to 0 xdc:
namely: # define SPI _ NOR _ CMD _ SE 0xd8
The method comprises the following steps: # define SPI _ NOR _ CMD _ SE 0xdc
Further, step 5 adds an extended address register initialization in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ EXTAD 0xc5
Further, step 6 adds to enter 4 byte address mode operation in evmc66x _ nor.h:
I.e. add macro definition: # define SPI _ NOR _ CMD _ ADD4BYTE 0xb7
Further, step 7 adds exit 4byte address mode operation in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ EXITADD4BYTE 0xe9
Further, step 8 modifies the function nor _ init in evmc66x _ nor.c:
adding initialization SPI interface
Defining: agent 8_ t CMD ═ SPI _ NOR _ CMD _ ADD4 BYTE;
at spi _ release ();
return NOR_EOK;
the previous increase:
spi_xfer(1,&cmd,null,FALSE);
further, step 9 modifies the function of nor _ read in evmc66x _ nor.c:
mixing the agent 8_ t cmd [4 ];
changing to agent 8_ t cmd [5 ];
CMD [0] ═ SPI _ NOR _ CMD _ READ;
cmd[1]=(uint8_t)(addr>>16);
cmd[2]=(uint8_t)(addr>>8);
cmd[3]=(uint8_t)addr;
ret_val=(spi_cmd_read(cmd,4,buf,len));
modified to the following statement:
cmd[0]=SPI_NOR_CMD_READ;
cmd[1]=(uint8_t)(addr>>24);
cmd[2]=(uint8_t)(addr>>16);
cmd[3]=(uint8_t)(addr>>8);
cmd[4]=(uint8_t)addr;
ret_val=(spi_cmd_read(cmd,5,buf,len));
further, step 10 modifies the function content of nor _ write in evmc66x _ nor.c:
mixing the agent 8_ t cmd [4 ];
changing to agent 8_ t cmd [5 ];
setting CMD [0] as SPI _ NOR _ CMD _ PP;
cmd[1]=(uint8_t)(addr>>16);
cmd[2]=(uint8_t)(addr>>8);
cmd[3]=(uint8_t)addr;
ret=spi_cmd_write(cmd,4,buf+actual,chunk_len);
the following statements are changed:
cmd[0]=SPI_NOR_CMD_PP;
cmd[1]=(uint8_t)(addr>>24);
cmd[2]=(uint8_t)(addr>>16);
cmd[3]=(uint8_t)(addr>>8);
cmd[4]=(uint8_t)addr;
ret=spi_cmd_write(cmd,5,buf+actual,chunk_len);
further, step 11 modifies the function content of nor _ erase in evmc66x _ nor.c:
mixing the agent 8_ t cmd [4 ]; changing to agent 8_ t cmd [5 ];
CMD [0] ═ SPI _ NOR _ CMD _ SE;
cmd[1]=(address>>16)&0xff;
cmd[2]=(address>>8)&0xff;
cmd[3]=(address>>0)&0xff;
cmd_len=4;
the following statements are changed:
cmd[0]=SPI_NOR_CMD_SE;
cmd[1]=(address>>24)&0xff;
cmd[2]=(address>>16)&0xff;
cmd[3]=(address>>8)&0xff;
cmd[4]=(address>>0)&0xff;
cmd_len=5;
through the design, the NOR FLASH space which can only access 16MB originally by the DSP board card can be expanded to the space which can access 4GB, so that a user can store a large amount of precious data of an external field in the NOR FLASH in an outdoor test for later export or permanent storage. The requirement for FLASH storage data in practical application is well met, and the practicability and the universality of the DSP board card are enhanced.
Interpretation of terms:
DSP-digital signal processing
NOR FLASH-nonvolatile FLASH memory
TI-Texas instruments
TMS320C 6657-TI multicore DSP chip
MT25QU512ABB8E2-0 SIT-NOR FLASH chip
Bit-position
KB-kilobyte (1024 bytes)
MB-megabyte (1024X 1024 bytes)
GB-gigabyte (1024X 1024 bytes)
JTAG-Joint test action group (JTAG interface)
DDR3 SDRAM-double data rate three synchronous dynamic random access memory
EMIF-external memory interface
SPI-serial peripheral interface
evmc66x _ nor.h-TI provided header file to access NOR FLASH driver
evmc66x _ NOR. c-TI provides source files that access NOR FLASH drivers
In light of the foregoing description of preferred embodiments in accordance with the invention, it is to be understood that numerous changes and modifications may be made by those skilled in the art without departing from the scope of the invention. The technical scope of the present invention is not limited to the contents of the specification, and must be determined according to the scope of the claims.

Claims (10)

1. A NOR FLASH storage space expansion method based on a DSP board card is characterized by comprising the following specific steps:
step 1, modifying the total number of defined sectors according to the selected NOR FLASH chip capacity based on a header file evmc66x _ nor.h in a software drive package provided by TI;
Step 2, modifying the read memory operation in evmc66x _ nor.h, and expanding the read 3-byte address to a 4-byte address range;
step 3, modifying a byte page programming operation item in evmc66x _ nor.h, and expanding the original 3-byte address to a 4-byte address range;
step 4, modifying the sector erasing operation in evmc66x _ nor.h, wherein the mode is changed from 3 bytes to 4 bytes;
step 5, adding a defined extension address register in evmc66x _ nor.h, and carrying out initialization assignment;
step 6, adding definitions into a 4-byte address mode register in evmc66x _ nor.h, and carrying out initialization assignment;
step 7, adding a definition exit 4-byte address mode register in evmc66x _ nor.h and carrying out initialization assignment;
step 8, modifying the relevant content of the NOR _ init function in the software-driven source file evmc66x _ nor.c based on accessing the NOR FLASH: adding an address access command initialized to 4 bytes and sending the command to an SPI interface chip;
and 9, modifying the related content of the nor _ read function in the evmc66x _ nor.c: expanding an array cmd for defining the command and the address from 4 bytes to 5 bytes, writing the 4-byte address into a position corresponding to the cmd, and changing the read 4-byte address and the command into a read 5-byte address and a command;
Step 10, modifying the relevant content of the nor _ write function in evmc66x _ nor.c: expanding an array cmd for defining the command and the address from 4 bytes to 5 bytes, writing the 4-byte address into a position corresponding to the cmd, and changing the 4-byte address and the command into a 5-byte address and a command;
step 11, modifying the relevant content of the nor _ erase function in evmc66x _ nor.c: the array cmd, which defines the command and address, is extended from 4 bytes to 5 bytes, the 4 byte address is written to the location corresponding to the cmd, and the value cmd _ len, which defines a value equal to 4, is changed to equal to 5.
2. The DSP board based NOR FLASH memory space expansion method of claim 1, wherein in step 1 the total number of defined sectors is modified according to the selected NOR FLASH chip capacity, specifically as follows:
based on the header file evmc66x _ nor.h in the software driver package provided by TI, the total number of sectors δ defined is modified:
the initially defined total number δ of sectors is 256, one sector is 64KB in size, and the original driver can only access NOR FLASH of 64KB × δ × 64KB × 256 MB;
the user modifies the total number of sectors delta according to the selected NOR FLASH chip capacity:
if 64MB of NOR FLASH is used, δ is 64MB ÷ (64 × 1024) KB ÷ 64KB ÷ 1024;
If 128MB of NOR FLASH is used, δ -128 MB/64 KB (128 × 1024KB) ÷ 64 KB-2048;
by analogy, the total number delta of the sectors is modified to 65536, and the capacity of a corresponding NOR FLASH chip is 4 GB.
3. The NOR FLASH memory space expansion method based on DSP board card of claim 2, characterized in that the board card is composed of a DSP chip TMS320C6657 and a FLASH chip MT25QU512ABB8E12-0SIT, and the capacity of the FLASH chip is 64 MB.
4. The method for expanding the storage space of the NOR FLASH based on the DSP board card of claim 3, wherein the header file evmc66x _ nor.h in the software-driven package provided in step 1 based on TI changes the total number of sectors from 256 to 1024 according to the selected chip capacity of the NOR FLASH, specifically as follows:
changing the original macro definition SPI _ NOR _ SECTOR _ COUNT:
namely: # define SPI _ NOR _ SECTOR _ COUNT 256
The method is modified as follows: # define SPI _ NOR _ SECTOR _ COUNT 1024.
5. The DSP board card-based NOR FLASH memory space expansion method according to claim 3, wherein the steps 2-7 are as follows:
step 2 modifies the read memory operation in evmc66x _ nor.h, changing the read 3 byte address to read 4 byte address:
changing the original macro definition SPI _ NOR _ CMD _ READ:
Namely: # define SPI _ NOR _ CMD _ READ 0x03
The method is modified as follows: # define SPI _ NOR _ CMD _ READ 0x13
Step 3, modify the page program entry in evmc66x _ nor.h from original 0x02 to 0x 12:
changing the original macro definition SPI _ NOR _ CMD _ PP:
namely: # define SPI _ NOR _ CMD _ PP 0x02
The method comprises the following steps: # define SPI _ NOR _ CMD _ PP 0x12
Step 4, modify the sector erasure in evmc66x _ nor.h, from original 0xd8 to 0 xdc:
namely: # define SPI _ NOR _ CMD _ SE 0xd8
The method comprises the following steps: # define SPI _ NOR _ CMD _ SE 0xdc
Step 5 adds an extended address register initialization in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ EXTAD 0xc5
Step 6 adds to enter 4byte address mode operation in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ ADD4BYTE 0xb7
Step 7 adds exit 4byte address mode operation in evmc66x _ nor.h:
i.e. add macro definition: # define SPI _ NOR _ CMD _ EXITADD4BYTE 0xe 9.
6. The DSP board based NOR FLASH memory space expansion method of claim 3, wherein the NOR _ init function in step 8 is to configure the SPI controller to communicate between DSP and NOR FLASH, modify the NOR _ init function in evmc66x _ nor.c:
adding initialization SPI interface
Defining: agent 8_ t CMD ═ SPI _ NOR _ CMD _ ADD4 BYTE;
at spi _ release ();
return NOR_EOK;
the method comprises the following steps:
spi_xfer(1,&cmd,null,FALSE);。
7. the DSP board based NOR FLASH memory space expanding method of claim 3, wherein the NOR _ read function in step 9 is to read data from NOR FLASH, modify the NOR _ read function in evmc66x _ nor.c:
Figure FDA0003615533070000031
modified to the following statement:
Figure FDA0003615533070000032
Figure FDA0003615533070000041
8. the DSP board based NOR FLASH memory space expanding method of claim 3 wherein the NOR _ write function in step 10 is writing data into NOR FLASH, modifying the function content of NOR _ write in evmc66x _ nor.c:
let U nt8_ t cmd [4 ];
change to agent 8_ t cmd [5 ];
setting CMD [0] as SPI _ NOR _ CMD _ PP;
cmd[1]=(uint8_t)(addr>>16);
cmd[2]=(uint8_t)(addr>>8);
cmd[3]=(uint8_t)addr;
ret=spi_cmd_write(cmd,4,buf+actual,chunk_len);
the following statements are changed:
cmd[0]=SPI_NOR_CMD_PP;
cmd[1]=(uint8_t)(addr>>24);
cmd[2]=(uint8_t)(addr>>16);
cmd[3]=(uint8_t)(addr>>8);
cmd[4]=(uint8_t)addr;
ret=spi_cmd_write(cmd,5,buf+actual,chunk_len);。
9. the DSP board based NOR FLASH memory space expanding method of claim 3 wherein the NOR _ erase function in step 11 is to erase data in NOR FLASH, modify the function content of NOR _ erase in evmc66x _ nor.c
Mixing the agent 8_ t cmd [4 ]; changing to agent 8_ t cmd [5 ];
CMD [0] ═ SPI _ NOR _ CMD _ SE;
cmd[1]=(address>>16)&0xff;
cmd[2]=(address>>8)&0xff;
cmd[3]=(address>>0)&0xff;
cmd_len=4;
the following statements are changed:
cmd[0]=SPI_NOR_CMD_SE;
cmd[1]=(address>>24)&0xff;
cmd[2]=(address>>16)&0xff;
cmd[3]=(address>>8)&0xff;
cmd[4]=(address>>0)&0xff;
cmd_len=5;。
10. a NOR FLASH memory space expansion device based on a DSP board, characterized in that, based on evmc66x _ nor.h and evmc66x _ nor.c drivers provided by TI, the method for expanding the memory space of NOR FLASH based on a DSP board as claimed in any one of claims 1 to 9 is employed to achieve expansion of the access capacity of NOR FLASH.
CN202210443438.1A 2022-04-26 2022-04-26 NOR FLASH storage space expansion method and device based on DSP board card Pending CN114756480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210443438.1A CN114756480A (en) 2022-04-26 2022-04-26 NOR FLASH storage space expansion method and device based on DSP board card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210443438.1A CN114756480A (en) 2022-04-26 2022-04-26 NOR FLASH storage space expansion method and device based on DSP board card

Publications (1)

Publication Number Publication Date
CN114756480A true CN114756480A (en) 2022-07-15

Family

ID=82332626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210443438.1A Pending CN114756480A (en) 2022-04-26 2022-04-26 NOR FLASH storage space expansion method and device based on DSP board card

Country Status (1)

Country Link
CN (1) CN114756480A (en)

Similar Documents

Publication Publication Date Title
US7082525B2 (en) Booting from non-linear memory
US7340566B2 (en) System and method for initializing a memory device from block oriented NAND flash
US8225067B2 (en) Multilevel cell NAND flash memory storage system, and controller and access method thereof
KR100867900B1 (en) Sdram memory device with an embedded nand flash controller
EP1423857B1 (en) Synchronous flash memory with virtual segment architecture
CN106484316B (en) Method for managing a memory device, memory device and controller
KR101159400B1 (en) Hybrid memory device with single interface
US8612791B2 (en) Method of selective power cycling of components in a memory device independently by turning off power to a memory array or memory controller
CN100456272C (en) System and method of booting by flaoh memory
US20080256352A1 (en) Methods and systems of booting of an intelligent non-volatile memory microcontroller from various sources
US7007140B2 (en) Storage device, storage device controlling method, and program
KR100725271B1 (en) USB-SD Memory with multiple DMA channels, and data storing method thereof
US20080162792A1 (en) Caching device for nand flash translation layer
US20040193864A1 (en) System and method for actively booting a computer system
US9037781B2 (en) Method for managing buffer memory, memory controllor, and memory storage device
US8914602B2 (en) Display controller having an embedded non-volatile memory divided into a program code block and a data block and method for updating parameters of the same
RU2002118114A (en) Computer device using non-renewable random access dynamic memory
WO2000067132A1 (en) Combination ata/linear flash memory device
US5333292A (en) Microcomputer for selectively accessing non-volatile memory and other storage unit in response to allocated address inputs
CN114756480A (en) NOR FLASH storage space expansion method and device based on DSP board card
WO2007032830A2 (en) Methods and apparatus for providing a virtual flash device
CN100578467C (en) Caching device based on universal serial bus
US7065639B2 (en) Utilization of SRAM in an execution of initialization code process upon system start up
US20040133755A1 (en) Minimization of overhead of non-volatile memory operation
CN102446071B (en) Access method for obtaining memory status information, electronic device and program product

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