This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于 C5515 boot loader 和 JTAG 问题

Other Parts Discussed in Thread: TMS320C5515

专家好!

我写了一个程序,该程序关闭了 大部分端口,包括JTAG调试接口。 将该程序编译成 .out,并build 成bin,  然后烧录进了FLASH。

关机,重启之后,根据系统表现情况来看,程序运行起来了。

但从此以后,便无法使用JTAG 调试程序了。 因为板子上电之后,就启动了该程序,而该程序关闭了JTAG。

请问我除了更换烧录了程序的FLASH芯片之外, 是否有其他办法,让系统开机的时候,有个选择,不让其启动程序,同时,又可以使用JTAG?

非常着急!

盼答复

谢谢!

  • 想问一下你是怎么通过程序关闭JTAG调试接口的?

  • 在RTC only 模式下, 采用如下指令关闭了除RTC之外的其他外围电路.

      asm(" *port(#0x1930) = #0x0006 ");  //WU_DIR input & LDO & BG shutdown

    这条指令之下的代码便无法调试了,因为JTAG也被关闭。

    于是我将程序编译成BIN之后,烧录进FLASH,设备启动后,观察系统运行情况。

    出现的问题是,我无法唤醒设备,同时再也无法使用JTAG,因为,设备上电首先就运行这段程序。

    以上是当前问题。

    我真正想要的效果是, RTC Only 模式下,设定了10分钟之后,RTC的中断程序激活系统

    该中断函数包括了指令:asm(" *port(#0x1930) = #0x0000 ");

    问题是,很难调试程序,无法判断该中断函数在 RTC only模式下,是否被调用了。

    如果每次都烧录image方式,代价太大,并且很容易出错。

    希望多多指导, 是否有更好的方案验证我们的程序。

    谢谢!

  • RTC-only mode只能通过WAKEUP管脚唤醒,具体唤醒流程见下面的数据手册第109页描述。
    http://www.ti.com/lit/ds/symlink/tms320c5515.pdf

  • Mr. Zhang

    我通过WAKEUP pin唤醒了系统, 这个是我们需要实现的功能之一。

    另外,我们更希望通过 RTC Alarm Interrupt 来唤醒系统,比如设定10秒钟之后,RTC自动唤醒系统。

    根据文档 <<sprufx2a.pdf>> 以下章节描述

    1.2.3 RTC-Only Mode
    RTC-only mode allows all supplies except LDOI, DVDDRTC and CVDDRTC to be powered down. In this mode,
    the RTC counter continues to operate. The RTC has the capability to wake up the device from idle states,
    or completely power down the CPU, via alarms, periodic interrupts, or an external WAKEUP input. The
    RTC will reboot after waking up from the CPU powering down.
    In addition, the RTC is able to output an alarm or periodic interrupt on the WAKEUP pin to cause external
    power management to re-enable power to the DSP core and I/O.

    其中系统唤醒的方式包括了 Alarms, 但我没找到任何关于通过Alarms唤醒系统的详细流程说明。

    目前我的代码应该是成功启动了 RTC中断功能, 系统每1秒钟,就会调用一次中断。 但由于在RTC ONLY模式下,所以无法使用JTAG。

    在此情况下,我将bin烧录进了FLASH, 由于RTC启动了每秒中断一次的Alarms.  所以我们板子上的LED,每秒钟都会闪烁一次。

    说明在RTC ONLY 模式下,发生了每秒一次的中断。

    我现在的问题是, 在中断函数 rtc_isr  中添加任何代码, 或者根本不写任何代码, 系统的表现行为高度一致, LED每秒闪烁一次。

    这是不是说明, RTC发生了中断,而实际上根本没有进入 rtc_isr函数?

    而我们需要的是,在发生Alarms中断是,系统执行我们的代码,将系统唤醒,恢复正常运行。

    该如何办呢?

    谢谢指导!

  • RTC only模式只能通过wakeup管脚唤醒,不能通过alarm唤醒,以datasheet为准。

  • 问题:

    Datasheet 《TMS320C5515.PDF》也明确说明了: 107页,看看。

    5.11 Real-Time Clock (RTC) The C5515 includes a Real-Time Clock (RTC) with its own separated power supply and isolation circuits. The separate supply and isolation circuits allow the RTC to run while the rest of the C5515 device (Core and I/O) is powered off. All RTC registers are preserved (except for RTC Control and RTC Update Registers) and the counter continues to operate when the device is powered off. The RTC also has the capability to wakeup the device from idle states via alarms, periodic interrupts, or an external WAKEUP input. Additionally, the RTC is able to output an alarm or periodic interrupt on the WAKEUP pin to cause external power management to re-enable power to the DSP Core and I/O. The C5515 RTC provides the following features: • 100-year calendar up to year 2099. • Counts seconds, minutes, hours, day of the week, date, month, and year with leap year compensation • Millisecond time correction • Binary-coded-decimal (BCD) representation of time, calendar, and alarm • 24-hour clock mode • Second, minute, hour, day, or week alarm interrupt • Periodic interrupt: every millisecond, second, minute, hour, or day • Alarm interrupt: precise time of day • Single interrupt to the DSP CPU • 32.768-kHz crystal oscillator with frequency calibration Control of

    我参考的代码如下:

           Uint16 temp1920, temp1924;
            
            asm(" @#IFR0_L = #0xffff || mmap() "); // clear int flags
            asm(" @#IER0_L = #0x0000 || mmap() "); // set RTC int
            asm(" @#IFR1_L = #0xffff || mmap() "); // clear int flags
            asm(" @#IER1_L = #0x0004 || mmap() "); // set RTC int
            asm(" bit(ST1,#11) = #0 "); // GLOBAL INTERRUPT ENABLE

    // RTC configure

            asm(" *port(#0x1920) = #0x803F "); //clear interrupt flags

            asm(" *port(#0x1900) = #0x0001 "); //RTCINTEN enabled

            asm(" *port(#0x1924) = #0x0022 "); //EXTINTEN enabled

            asm(" *port(#0x1930) = #0x0000 "); //WU_DIR input

            do // waiting until RTC interrupt is enabled in the RTC domain could take 2 RTC clocks for write to propagate

            {

                    temp1924 = *(volatile ioport unsigned int *) (0x1924);

            } while ((temp1924&0x0022)==0);


            temp1920 = *(volatile ioport unsigned int *) (0x1920);

            if ((temp1920&0x0022)!=0)
            {
                    asm(" *port(#0x1920) = #0x803F "); //clear interrupt flags

            }


            asm(" *port(#0x1930) = #0x0006 "); //WU_DIR input & LDO & BG shutdown 进入RTC ONLY 模式

            asm(" *port(#0x1920) = #0x803F "); //clear interrupt flags


    // Enter RTC-only

            while (1)

            {

                    temp1920 = *(volatile ioport unsigned int *) (0x1920);

                    if ((temp1920&0x0022)!=0)  // 判断是否发生了中断, 如果发生了变恢复系统

                    {

                        asm(" *port(#0x1920) = #0x803F "); //clear interrupt flags

                        asm(" *port(#0x1930) = #0x0000 "); //WU_DIR input & LDO & BG power on

                        asm(" *port(#0x1920) = #0x803F "); //clear interrupt flags

                        break;
                    }

            }

    当系统运行这段代码时,每秒钟LED都会闪烁,电流也在发生上下震荡。 说明RTC中断产生了,但并没有唤醒系统。

    我们的程序始终进不了 黑体字 分支语句,否则系统会启动起来的。 由于LDO 和 BG 关闭了,也无法用JTAG调试,也只能通过LED和系统电流来判断是否唤醒。

    我们的问题是: 在RTC ONLY 模式下, 如何让系统按照预定时间(RTC Alarm) 自动唤醒设备?

    上述代码是否有问题?

    另外一些线索,根据RTC部分描述:

    A high pulse for a minimum of one RTC clock period (30.5 μs) to the WAKEUP pin will trigger the RTC
    interrupt when:
    • The WAKEUP pin is configured as an input (RTCPMGT:WU_DIR = 0)
    • The RTC interrupt is enabled (RTCINTEN:RTCINTEN = 1)
    • The External Event Interrupt in RTCINTREG is enabled (RTCINTREG:EXTINTEN = 1)

    给wakeup高电平脉冲时间需要持续30.5us以上,是不是由于RTC ALARM产生的高电平持续时间太短,而无法无法唤醒系统。

    我在做实验也发现,通过手工方式将WAKEUP引脚置高电平, 如果高电平持续时间太短,是无法唤醒系统的,时间持续接近1秒时,便启动了。

    如果真是由于RTC ALARM产生高电平时间太短, 那么我们该如何调整这个持续时间,进而达到唤醒系统的需要呢?

    我的分析未必正确,请TI专家协助!

    项目告急!肯定帮忙!

    谢谢

  • 请问你还有5515的烧录程序吗,在调烧录程序是总是有问题。

  • 在CSL库里有:

    C:\ti\c55_lp\c55_csl_3.07\ccs_v6.x_examples\programmer