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.

EVM5515例程CSL_USB_MSC_dmaExample_Out生成bin文件,下载到开发板无法正常工作,怎么办?

例程使用的GEL文件为0250.evm5515.gel

我将GEL文件的功能用C文件实现,如下

7245.evm5515.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/********************************************************************/
/* evm5515.gel */
/* Version 0.02 */
/* */
/* This GEL file is to be used with the 5515 EVM. */
/* Changes may be required to support specific hardware designs. */
/* */
/* Code Composer Studio supports six reserved GEL functions that */
/* automatically get executed if they are defined. They are: */
/* */
/* StartUp() - Executed whenever CCS is invoked */
/* OnReset() - Executed after Debug->Reset CPU */
/* OnRestart() - Executed after Debug->Restart */
/* OnPreFileLoaded() - Executed before File->Load Program */
/* OnFileLoaded() - Executed after File->Load Program */
/* OnTargetConnect() - Executed after Debug->Connect */
/* */
/* Version History */
/* v0.01 Initial Release */
/* v0.02 Corrected PLL settings */
/********************************************************************/
//StartUp()
//{
// c5515_MapInit();
//}
/*--------------------------------------------------------------*/
/* OnTargetConnect() -- this function is called after a target */
/* connect. */
/*--------------------------------------------------------------*/
void OnTargetConnect()
{
// GEL_Reset();
Peripheral_Reset();
ProgramPLL_100MHz();
SDRAM_INIT();
// GEL_TextOut("Target Connection Complete.\n");
}
/*--------------------------------------------------------------*/
/* OnPreFileLoaded() */
/* This function is called automatically when the 'Load Program'*/
/* Menu item is selected. */
/*--------------------------------------------------------------*/
//OnPreFileLoaded()
//{
// /* Reset the CPU to clean up state */
// //GEL_Reset();
//}
/*--------------------------------------------------------------*/
/* OnRestart() */
/* This function is executed before a file is restarted. Disable*/
/* interrupts and DMA from the current program so pending */
/* events and transfers don't interfere with the new program. */
/*--------------------------------------------------------------*/
void OnRestart()
{
/* Disable interrupts */
*(volatile ioport Uint16 *)0x0003 = *(volatile ioport Uint16 *)0x0003 | 0x0800; //*(int*)0x0003 = *(int*)0x0003 | 0x0800; // Set INTM
*(volatile ioport Uint16 *)0x0000 = 0; //*(int*)0x0000 = 0; // Clear IER0
*(volatile ioport Uint16 *)0x0045 = 0; //*(int*)0x0000 = 0; // Clear IER1
}
/*--------------------------------------------------------------*/
/* OnReset() */
/* This function is called by CCS when you do Debug->Resest. */
/* The goal is to put the C55xx into a known good state with */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

并在main函数的开头调用

OnRestart();

OnTargetConnect();

调试结果正常,能够实现USB MSC功能,通过PC读写开发板上的文件。

生成bin文件下载到开发板上,运行不正常,PC无法识别USB设备。

  • 生成bin文件步骤如下:

    双击上图中的cmd.bat文件即生成EVM_Sample.bin文件。

    cmd.bat文件内容为:

    hex55 evm5515.cmd

    EVM5515.cmd文件内容为:

    -boot
    -v5505
    -serial8
    -b
    -o EVM_Sample.bin
    EVM_Sample.out

  • 建议用仿真器跟一下boot过程,看是代码没有加载进来还是加载后运行错误。
    processors.wiki.ti.com/.../Debugging_Boot_Issues
  • 你好!

    你发的这个链接上的操作有点复杂,我不确定自己都做对了没有。

    CCS Crashing when Connecting这个步骤不知道怎么弄。

    能不能简单一点,因为开发板是EVM5515,例程也是TI官方的,能不能帮我验证这个例程,怎么才能获得能正确实现USB MSC功能的.bin文件。

    我用前面描述的方法,在HID例程上能够正常实现USB鼠标的功能。

    另外,我清空GEL文件的内容,即GEL文件实际上没有作任何操作,然后在C中实现GEL中的函数。

    在调试模式下,能够正常实现USB MSC功能,生成bin文件下载后还是不正常。

    我们产品的主要功能已经实现了,现在还差通过PC的USB接口读取TF卡的功能。

    我已经尝试了很多次,都没有成功。不知道问题在哪里。

    所以恳请帮帮忙,谢谢!

  • 检查一下初始化代码里是否将相应的时钟重新使能了。请见下面截图说明,芯片的ROM bootloader启动后将所有时钟都关掉了,所以需要用户在在自已的main里重新使能。 

  • user5287758 说:
    CCS Crashing when Connecting这个步骤不知道怎么弄。

    这个跟你的问题无关。

    如果烧写的文件有问题导致连不上仿真器,可以在上电前将flash的CS与3V3短接,在上电后就可以松开,以让bootloader跳过从flash读取代码的过程,然后再连接仿真器,将flash擦掉,烧写正确的bin文件。

  • 你好!

    例程中,main()函数调用了CSL_mscTest()函数,该函数的前两行就是使能所有外设时钟

    CSL_Status CSL_mscTest(void)
    {
    	CSL_Status      status;
    	volatile Uint32 looper;
    
    	*(ioport volatile int *)0x1c02 = 0x0;
    	*(ioport volatile int *)0x1c03 = 0x0;
    ......
    ......
    }

    在GEL文件中,ProgramPLL_100MHz()也对这两个寄存器进行了操作,我在evm5515.c中也实现了相同的操作。

  • 你好!
    这个问题能解决吗?我发了两个类似的贴了,都是无果而终。


    因为开发板是EVM5515,例程也是TI官方的,能不能帮我验证这个例程,怎么才能获得能正确实现USB MSC功能的.bin文件。


    能否让你们FAE工程师帮我验证一下,或者加我的QQ(1957056403阿德(陆**))协助解决?

    谢谢!
  • 你好!
    这个问题能解决吗?我发了两个类似的贴了,都是无果而终。


    因为开发板是EVM5515,例程也是TI官方的,能不能帮我验证这个例程,怎么才能获得能正确实现USB MSC功能的.bin文件。


    能否让你们FAE工程师帮我验证一下,或者加我的QQ(1957056403阿德(陆**))协助解决?

    谢谢!
  • 【最终解决方法】:程序原来使用.tcf对中断函数mmcsd0_isr()、USBisr()等进行配置绑定,改为使用IRQ_enable()、IRQ_plug()等函数进行配置。