我在这个网页下的
processors.wiki.ti.com/…/C5517_Boot-Image_Programmer
- 4.1.1 Relying on GEL File for initialization
- 4.1.2 Loading code into SARAM31
- 4.1.3 Ports idled by bootloader
这三个都试过了,但是都不行。
唯一一个能引导成功的工程就是只进行了PLL初始化,CLKOUT输出。其余的加载任何功能都不能成功引导。
平台 TMS320C5517
main.c文件
#include "stdio.h"
#include "evm5517.h"
#include "timer.h"
#include "evm5517_led.h"
#include "register_cpu.h"
#include "register_system.h"
/*******************************IER,IFR*****************************Administrator***********/
void InitSystem(void)
{
volatile int i;
CONFIG_MSW = 0; // Put PLL in bypass
PLL_CNTL1 = 0xc250;
PLL_CNTL2 = 0x0008;
PLL_CNTL4 = 0x0000; // Output divider = 0
PLL_CNTL3 = 0x0010; // Normal operating mode
for (i=0;i<0x7fff;i++); // Wait for PLL lock (at least 4ms)
CONFIG_MSW = 1; // Switch to PLL clock
// reset peripherals
PER_RSTCOUNT = 0x02;
PER_RESET = 0x00fb;
for (i=0; i< 200; i++);
}
int timer_count = 0;
/*
*
* main( )
*
*/
void main( void )
{
ST3_55 &= ~0x0004;
/* Initialize BSL */
InitSystem();
EVM5517_init();
EVM5517_LED_init();
IVPD = 0x0101;
IVPH = 0x0101;
IER0 = 0x0010;//timer
IER1 = 0x0000;
IFR0 = 0xffff;
IFR1 = 0xffff;
SYS_GlobalIntEnable();
*(volatile ioport Uint16 *)0x0001 = 0x020E;
asm(" idle");
Timer0Init();
StartTimer0();
int flag = 0;
while(1)
{
if(timer_count >= 1000)
{
timer_count = 0;
if(flag == 0)
{
flag = 1;
EVM5517_LED_on( 0 );
}else
{
flag = 0;
EVM5517_LED_off( 0 );
}
}
}
}
CMD文件
-stack 0x2000 /* Primary stack size */
-sysstack 0x1000 /* Secondary stack size */
-heap 0x2000 /* Heap area size */
-c /* Use C linking conventions: auto-init vars at runtime */
-u _Reset /* Force load of reset interrupt handler */
/* SPECIFY THE SYSTEM MEMORY MAP */
MEMORY
{
PAGE 0: /* —- Unified Program/Data Address Space —- */
MMR: origin = 0x000000, length = 0x0000c0 /* MMRs */
DARAM: origin = 0x0000c0, length = 0x00ff40
VECS: origin = 0x010000, length = 0x000200 /* 512B */
SARAM: origin = 0x010200, length = 0x03DD00 /* 64KB */
SARAM31: origin = 0x04E000, length = 0x002000 /* 64KB */
PDROM: origin = 0xff8000, length = 0x008000 /* 32KB */
PAGE 2: /* ——– 64K-word I/O Address Space ——– */
IOPORT: origin = 0x000000, length = 0x020000
}
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
SECTIONS
{
.text >> DARAM /* Code */
/* Both stacks must be on same physical memory page */
.stack > DARAM /* Primary system stack */
.sysstack > DARAM /* Secondary system stack */
.data >> DARAM /* Initialized vars */
.bss >> DARAM /* Global & static vars */
.const >> DARAM /* Constant data */
.sysmem > DARAM /* Dynamic memory (malloc) */
.switch > DARAM /* Switch statement tables */
.cinit > DARAM /* Auto-initialization tables */
.pinit > DARAM /* Initialization fn tables */
.cio > DARAM /* C I/O buffers */
.args > DARAM /* Arguments to main() */
vectors > VECS ALIGN = 256 /* Interrupt vectors */
.ioport > IOPORT PAGE 2 /* Global & static ioport vars */
}
vector.asm文件
;* ============================================================================
;* Copyright (c) 2008-2012 Texas Instruments Incorporated.;* Except for those rights granted to you in your license from TI, all rights;* reserved.
;*;* Software License Agreement
;* Texas Instruments (TI) is supplying this software for use solely and;* exclusively on TI devices. The software is owned by TI and/or its suppliers,;* and is protected under applicable patent and copyright laws. You may not;* combine this software with any open-source software if such combination would;* cause this software to become subject to any of the license terms applicable;* to such open source software.
;*;* THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
;* NO WARRANTIES APPLY TO THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY.;* EXAMPLES OF EXCLUDED WARRANTIES ARE IMPLIED WARRANTIES OF MERCHANTABILITY;* AND FITNESS FOR A PARTICULAR PURPOSE AND WARRANTIES OF NON-INFRINGEMENT,;* BUT ALL OTHER WARRANTY EXCLUSIONS ALSO APPLY. FURTHERMORE, TI SHALL NOT,;* UNDER ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, CONSEQUENTIAL;* OR PUNITIVE DAMAGES, FOR ANY REASON WHATSOEVER.
;* ============================================================================
;Module: INTC;File: vectors.asm – vector table
;**************************************************************************
;;**************************************************************************
.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
;********************************************************************************** .ref _c_int00
;.ref _sarISR
.ref _Timer_isr
;.ref _i2s2_rx_isr
;.ref _uart_isr
;.ref _dma_isr
;.ref _fpga_reset
;.ref _uart_analysis
.def RST
;**********************************************************************************
.sect "vectors"
.align 256
.global _VECSTART
;**********************************************************************************
_VECSTART:
RST: .ivec reset_isr, USE_RETA ; Reset / Software Interrupt #0
NMI: .ivec nmi_isr ; Nonmaskable Interrupt
INT0: .ivec int0_isr ; External User Interrupt #0
INT1: .ivec int1_isr ; External User Interrupt #1
TINT: .ivec tim_isr ; Timer #0 / Software Interrupt #4
PROG0: .ivec i2s0_mmc0_tx_isr ; Programmable 0 Interrupt
UART: .ivec uart_isr ; IIS #1 Receive Interrupt
PROG1: .ivec i2s0_mmc0_rx_isr ; Programmable 1 Interrupt
DMA: .ivec dma_isr ; DMA Interrupt
PROG2: .ivec i2s1_mmc1_tx_isr ; Programmable 2 Interrupt
COPROCFFT: .ivec coprocfft_isr ; Coprocessor FFT Module Interrupt
PROG3: .ivec i2s1_mmc1_rx_isr ; Programmable 3 Interrupt
LCD: .ivec lcd_isr ; LCD Interrupt
SARADC: .ivec saradc_isr ; SAR ADC Interrupt
XMT2: .ivec i2s2_tx_isr ; I2S2 Tx Interrupt
RCV2: .ivec i2s2_rx_isr ; I2S2 Rx Interrupt
XMT3: .ivec i2s3_tx_isr ; I2S3 Tx Interrupt
RCV3: .ivec i2s3_rx_isr ; I2S3 Rx Interrupt
RTC: .ivec rtc_isr ; RTC interrupt
SPI: .ivec spi_isr ; SPI Receive Interrupt
USB: .ivec usb_isr ; USB Transmit Interrupt
GPIO: .ivec gpio_isr ; GPIO Interrupt
EMIF: .ivec emif_error_isr ; EMIF Error Interrupt
I2C: .ivec i2c_isr ; IIC interrupt
BERR: .ivec berr_isr ; Bus Error Interrupt
DLOG: .ivec dlog_isr ; Emulation Interrupt – DLOG
RTOS: .ivec rtos_isr ; Emulation Interrupt – RTOS
RTDXRCV: .ivec rtdxrcv_isr ; Emulation Interrupt – RTDX receive
RTDXXMT: .ivec rtdxxmt_isr ; Emulation Interrupt – RTDX transmit
EMUINT: .ivec emuint_isr ; Emulation monitor mode interrupt
SINT30: .ivec sint30_isr ; Software Interrupt #30
SINT31: .ivec sint31_isr ; Software Interrupt #31
.text
reset_isr:
; *port(#0x1C01) = #0x0 ; Clear idles
bit (ST1, #11) = #1 ; Disable interrupts
@IVPD_L = #(RST >> 8) || mmap()
@IVPH_L = #(RST >> 8) || mmap()
bit(ST3,#7) = #0 ; Clear bus error interrupts
@#IFR0_L = #0xFFFF || mmap() ; clear all pending interrupts
@#IFR1_L = #0xFFFF || mmap()
;**********************************************************************************
; Reset all peripherals
;**********************************************************************************
*port(#0x1C04) = 0x20
nop_16
*port(#0x1C05) = 0x00FF ; Reset all peripherals
nop_16
goto _c_int00
nmi_isr: goto nmi_isr
int0_isr: goto int0_isr
int1_isr: goto int1_isr
tim_isr: goto _Timer_isr
i2s0_mmc0_tx_isr: goto i2s0_mmc0_tx_isr
uart_isr: goto uart_isr
i2s0_mmc0_rx_isr: goto i2s0_mmc0_rx_isr
dma_isr: goto dma_isr
i2s1_mmc1_tx_isr: goto i2s1_mmc1_tx_isr
coprocfft_isr: goto coprocfft_isr
i2s1_mmc1_rx_isr: goto i2s1_mmc1_rx_isr
lcd_isr: goto lcd_isr
saradc_isr: goto saradc_isr
i2s2_tx_isr: goto i2s2_tx_isr
i2s2_rx_isr: goto i2s2_rx_isr
i2s3_tx_isr: goto i2s3_tx_isr
i2s3_rx_isr: goto i2s3_rx_isr
rtc_isr: goto rtc_isr
spi_isr: goto spi_isr
usb_isr: goto usb_isr
gpio_isr: goto gpio_isr
emif_error_isr: goto emif_error_isr
i2c_isr: goto i2c_isr
berr_isr: bit(ST3,#7) = #0 ; Clear bus error interrupts
goto berr_isr
dlog_isr: goto dlog_isr
rtos_isr: goto rtos_isr
rtdxrcv_isr: goto rtdxrcv_isr
rtdxxmt_isr: goto rtdxxmt_isr
emuint_isr: goto emuint_isr
sint30_isr: goto sint30_isr
sint31_isr: goto sint31_isr
.text
********************************************************************************
** Name : no_isr **
** **
** Purpose : Spurious interrupt handler **
** **
** Author : **
** **
********************************************************************************
no_isr: goto no_isr
Shine:
试试把下面的两句放在main函数最开始处。
*(volatile ioport Uint16 *)0x0001 = 0x020E;
asm(" idle");
user5052112:
回复 Shine:
这个试过了,还是不行
TI中文支持网

