TI中文支持网
TI专业的中文技术问题搜集分享网站

Flash里的程序如何执行?

C6205通过EMIF接口CE1外接Flash,那Flash里的程序是如何执行的?是DSP通过EMIF不断从Flash里读取数据吗?读取的速度是怎么控制的?

Denny%20Yang99373:

NOR FLASH支持片上执行,读取速度是有芯片内部固件决定的

Yujing Wang:

回复 Denny%20Yang99373:

我现在用的是nor flash,发现EMIF接口有信号,片选信号每次使能(拉低)时间大约16us,禁能(拉高)时间很短,说明DSP和FLASH有通信吧?这个通信速度是DSP内部固件决定的?

现在的现象是:一样的程序,烧写在FLASH运行速度和直接在线仿真速度相差很多,比在线慢很多,这大概是什么原因呢?

Tony Tang:

Yujing WangC6205通过EMIF接口CE1外接Flash,那Flash里的程序是如何执行的?是DSP通过EMIF不断从Flash里读取数据吗?读取的速度是怎么控制的?

C6205是一款很老的DSP,还不支持XIP,NOR flash boot即文档spru642里描述的ROM boot process,不是从flash运行,而是从flash copy到address 0再运行。

4 Boot ProcessesThe boot process is determined by the boot configuration selected, as describedin section 5. Up to three types of boot processes are available: No boot process: The CPU begins direct execution from the memorylocated at address 0. If SDRAM is used in the system, the CPU is held untilSDRAM initialization is complete. Operation is undefined if invalid code islocated at address 0. ROM boot process: The program located in external ROM is copied toaddress 0 by the DMA controller. Although the boot process begins whenthe device is released from external reset, this transfer occurs while theCPU is internally stalled. For the C620x/C670x DSP, these values areexpected to be stored in little-endian format in the external memory,typically a ROM device.The transfer is automatically done by the DMA controller as a single-frameblock transfer from the ROM to address 0. The DMA copies 64K bytesfrom CE1 to address 0, using default ROM timings. After completion of theblock transfer, the CPU is unstalled and allowed to run from address 0. Host boot process: The CPU is internally stalled while the remainder ofthe device is released. During this period, an external host can initializethe CPU memory space as necessary through the host interface, includinginternal configuration registers, such as those that control the EMIF orother peripherals. Once the host is finished with all necessary initialization,it must set the DSPINT to complete the boot process. This transitioncauses the boot configuration logic to unstall the CPU. The CPU thenbegins execution from address 0. The DSPINT condition is not latched bythe CPU, because it occurs while the CPU is stalled. Also, DSPINTunstalls the CPU only if the host boot process is selected. All memory maybe written to and read by the host. This allows for the host to verify whatit sends to the processor, if required. After the CPU is unstalled, the CPUneeds to clear the DSPINT bit; otherwise, no more DSPINTs can be received.

关于boot的配置,见文档的5.4节。

5.4 C6205 DSP Boot and Device Configuration

Tony Tang:

回复 Yujing Wang:

Yujing Wang我现在用的是nor flash,发现EMIF接口有信号,片选信号每次使能(拉低)时间大约16us,禁能(拉高)时间很短,说明DSP和FLASH有通信吧?这个通信速度是DSP内部固件决定的?

这是芯片的bootloader通过DMA在从flash搬代码到adress 0. DMA访问是连续的,所以你看到CS拉低很长时间。这是DSP内部固件决定的。

Yujing Wang现在的现象是:一样的程序,烧写在FLASH运行速度和直接在线仿真速度相差很多,比在线慢很多,这大概是什么原因呢?

这个你是怎么判断的?同样的代码速度有区别,那就看一下PLL的配置是不是一样了。还是参考spru642的5.4节.

Yujing Wang:

回复 Tony Tang:

我的代码是点LED的,两种方式下LED闪烁的频率不同,用示波器查看高低电平持续的时间差很多

PLL就是硬件配置的,就是PLLCONF[0:2],程序里没有

DMA会一直搬代码吗?还是搬固定大小的代码就不搬了?现在是一直有信号

Yujing Wang:

回复 Tony Tang:

我又看了一下绿色部分,是搬64K就不搬了是吧?现在是一直有信号啊

还有如果程序超过64K怎么办呢?

还有那个XIP是什么意思啊?

Tony Tang:

回复 Yujing Wang:

Yujing Wang还有如果程序超过64K怎么办呢?

超过则需要采用二级boot方式,由二级boot代码配置好片外内存接口时序参数,再把应用代码搬过去,跳转到应用代码的入口地址。

XIP: execute in peripheral, 即直接在外设上运行,也就并行nor flash支持这种方式,当然前提是ROM bootloader要支持。C6205 ROM bootloader不支持。

Tony Tang:

回复 Yujing Wang:

Yujing WangDMA会一直搬代码吗?还是搬固定大小的代码就不搬了?现在是一直有信号

固定64Kbyte,且只搬这一次,这64K应该不是一个CS低就能完成的,中间应该有分割。

你说的一直是多久,代码跑起来后CE1还是低吗?不可能吧。

Yujing Wang我的代码是点LED的,两种方式下LED闪烁的频率不同,用示波器查看高低电平持续的时间差很多

只听说仿真器可能比boot跑起来慢,而你的情况是反的,这~~~确定是同一个程序吗?

Yujing Wang:

回复 Tony Tang:

二级boot也是搬64K吗?还是二级boot就没有限制了呢?

Yujing Wang:

回复 Tony Tang:

一直是LED已经闪烁了,我随时测还是有拉低。或者我是什么地方配置错了导致的?

是一个程序,我刚又比较了一下代码

赞(0)
未经允许不得转载:TI中文支持网 » Flash里的程序如何执行?
分享到: 更多 (0)