我想找一个Audio(通过I2S) 在DMA模式下的loopback例程,于是在这个链接下载的一个C5515 EZDSP的例程:http://code.google.com/p/c5505-ezdsp/ 。经过调试运行,都正常。但是只要我加一个*.tcf(信号量,中断什么的都没有加)文件进去出来的声音就变成持续的“滴”。有谁有什么想法吗?
谢谢!
chunhai feng:
如果把附件中的*.tcf文件删掉,然后把cmd文件DRAM那一行取消注释,就会运行正常。但是附件直接运行就会出来持续的滴声音。
chunhai feng:
回复 chunhai feng:
我怀疑是中断向量表冲突的问题,在原有的工程里就有一个vector.asm文件(见如下)定义了中断向量,这是不是会和tcf里的有冲突,如何把文件里的中断映射到tcf文件里呢
.mmregs.include "lpva200.inc".C54CM_off.CPL_off.ARMS_off;**********************************************************************************; predefined stack operation modes ;**********************************************************************************; USE_RETA : 2×16-bit fast return mode (RETA used); NO_RETA : 2×16-bit slow return mode (RETA not used); C54X_STK : 32-bit fast return mode
;********************************************************************************** .global _DMA_Isr ;.global _SAR_Isr ;.global _I2S0_TX_Isr;.global _I2S1_RX_Isr.global _RTC_Isr;.global _Timer_isr
;**********************************************************************************.sect "vector".align 256 ;**********************************************************************************
;****************************************************************************;* Other interrupt vector definitions go here;****************************************************************************.def _RST_RST: .ivec reset_isr, USE_RETA; Reset / Software Interrupt #0
NMI: .ivec reset_isr ; Nonmaskable Interrupt
INT0: .ivec dummy_isr ; External User Interrupt #0
INT1: .ivec dummy_isr ; External User Interrupt #1
;TINT0: .ivec _Timer_isr ; Timer #0 / Software Interrupt #4TINT0: .ivec dummy_isr ; Timer #0 / Software Interrupt #4
;PROG0: .ivec _I2S0_TX_Isr ; Programmable 0 InterruptPROG0: .ivec dummy_isr ; Programmable 0 Interrupt
UART: .ivec dummy_isr ; IIS #1 Receive Interrupt
PROG1: .ivec dummy_isr ; Programmable 1 Interrupt
DMA: .ivec _DMA_Isr ; DMA Interrupt;DMA: .ivec dummy_isr ; DMA Interrupt
PROG2: .ivec dummy_isr ; Programmable 2 Interrupt
COPROCFFT: .ivec dummy_isr ; Coprocessor FFT Module Interrupt
;PROG3: .ivec _I2S1_RX_Isr ; Programmable 3 InterruptPROG3: .ivec dummy_isr ; Programmable 3 Interrupt
LCD: .ivec dummy_isr ; LCD Interrupt
SARADC: .ivec dummy_isr ; SAR ADC Interrupt
XMIT2: .ivec dummy_isr ; I2S2 Tx Interrupt
RCV2: .ivec dummy_isr ; I2S2 Rx Interrupt
XMIT3: .ivec dummy_isr ; I2S3 Tx Interrupt
RCV3: .ivec dummy_isr ; I2S3 Rx Interrupt
RTC: .ivec _RTC_Isr ; RTC interrupt;RTC: .ivec dummy_isr ; RTC interrupt
SPI: .ivec dummy_isr ; SPI Receive Interrupt
USB: .ivec dummy_isr ; USB Transmit Interrupt
GPIO: .ivec dummy_isr ; GPIO Interrupt
EMIF: .ivec dummy_isr ; EMIF Interrupt
I2C: .ivec dummy_isr ; IIC interrupt
BERRIV:IV24: .ivec dummy_isr ; Bus error interrupt
; .ref _DLOGINT_isr DLOGIV:IV25: .ivec dummy_isr ; Data log (RTDX) interrupt
; .ref _RTOSINT_isrRTOSIV:IV26: .ivec dummy_isr ; Real-time OS interruptIV27: .ivec dummy_isr ; General-purpose software-only interruptIV28: .ivec dummy_isr ; General-purpose software-only interruptIV29: .ivec dummy_isr ; General-purpose software-only interruptIV30: .ivec dummy_isr ; General-purpose software-only interruptIV31: .ivec dummy_isr ; General-purpose software-only interrupt
;****************************************************************************;* Reset ;****************************************************************************
.text.def reset_isr.ref _c_int00.align 2 reset_isr:; *port(#0x1C01) = #0x0 ; Clear idlesbit (ST1, #11) = #1 ; Disable interrupts@IVPD_L = #(_RST >> 8) || mmap()@IVPH_L = #(_RST >> 8) || mmap()bit(ST3,#7) = #0 ; Clear bus error interruptsbit(ST3,#2) = #1 ; shut off clockout portbit(ST1,#13) = #0 ; shut off XF port
@#IFR0_L = #0xffff || mmap() ; clear all pending interrupts@#IFR1_L = #0xffff || mmap()
*port(#IDLE_ICR) = #(RESERVED_ICR|IPORT_IDLE|HWA_IDLE|DPORT_IDLE)idle
;**********************************************************************************; Reset all peripherals;***********************************************************************************port(#0x1C04) = 0x1nop_16*port(#0x1C05) = 0x00FB ; Reset all peripheralsnop_16
;**********************************************************************************; Enalbe EMIF;**********************************************************************************
*port(IDLE_PCGCR) = #0x0
;/* Config EMIF – System Control Regsiter */*port(#0x1C33) = #0x0
;// for SRAM in memory card (Async_CE1);/* Config EMIF – ASYNC Regsiters */*port(#0x1004) = #0x0080 *port(#0x1005) = #0x00E4
;/* Configure as 16-bit data bus */ ;// Async4 ==> Async_CE1 (SRAM) *port(#0x101C) = #0x40AD *port(#0x101D) = #0x0020
;// Async3 ==> Async_CE0(Flash)*port(#0x1018) = #0xFFFD *port(#0x1019) = #0x3FFF
;// do not assign Async_CE0 and Async_CE1 for NAND*port(#0x1060) = #0x0003 ;// Turn off page mode for all Chip Selects*port(#0x1068) = #0xFCFC *port(#0x1069) = #0xFCFC
goto _c_int00********************************************************************************** Name : no_isr **** **** Purpose : Spurious interrupt handler **** **** Author : **** **********************************************************************************.text no_isr: goto no_isr
dummy_isr:return_int.end
Shine:
回复 chunhai feng:
你好, 可以到BIOS GUI图形界面中设置HWI中断, 把主程序中的vectors.asm去掉, 另外,如果在HWI设置中断时选择了"Use Dispatcher", 在中断子程序前就不需要用interrupt关键字定义, 见下面的wiki网站说明。 http://processors.wiki.ti.com/index.php/DSP_BIOS_Debugging_Tips#Cause:_Improper_use_of_the_interrupt_keyword
chunhai feng:
回复 Shine:
谢谢回复!
把vector.asm去掉之后,在BIOS GUI里的HWI需要移植vector.asm里的哪些东西呢?因为我不太看得懂汇编,你能稍微举里面的一两个例子吗?
再次感谢!
chunhai feng:
回复 Shine:
比如说,上面vector.asm里的_DMA_Isr ,_RTC_Isr,_RST,NMI,…,一直到IV31都需要在HWI里面设置吗?还有就是reset_isr,no_isr,dummy_isr这些怎么处理呢?
Shine:
回复 chunhai feng:
你提到的这四个中断需要设置, 其他中断不用设置。只要在对应的HWI中断号上填上相应的中断子程序名称如funtion里填写_DMA_Isr, 并选择"Use Dispatcher", 可以参考下面的wiki网站,C55x要简单,设置类似。http://processors.wiki.ti.com/index.php/Setting_up_interrupts_in_DSP_BIOS
chunhai feng:
回复 Shine:
我按照你说的做了,把vector.asm里除了_RST,NMI两个定义之外其他都删掉了,只剩下了这些,然后再HWI里按照你给的链接里面设置了,貌似还是不对
.mmregs .include "lpva200.inc" .C54CM_off .CPL_off .ARMS_off
.global _DMA_Isr .global _RTC_Isr
.global _RST
.global NMI
.sect "vector" .align 256
.def _RST_RST: .ivec reset_isr, USE_RETA; Reset / Software Interrupt #0
NMI: .ivec reset_isr ; Nonmaskable Interrupt
.text .def reset_isr .ref _c_int00 .align 2 reset_isr:
bit (ST1, #11) = #1 ; Disable interrupts
bit(ST3,#7) = #0 ; Clear bus error interrupts bit(ST3,#2) = #1 ; shut off clockout port bit(ST1,#13) = #0 ; shut off XF port
idle
nop_16
nop_16
goto _c_int00
.text no_isr: goto no_isr
dummy_isr: return_int .end
Shine:
回复 chunhai feng:
是编译不通过还是程序不能运行?
有用仿真器跟过程序看是哪里的问题吗?
chunhai feng:
回复 Shine:
就是加了tcf文件之后还是会跑飞。不加bios是运行正常。难道不是向量表冲突的问题?