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

idk574x使用SD卡启动关机问题

下面这段程序是我在官方程序上面做了一点改动,为了验证程序是否允许,我在任务里面一直使用UART_printf("Data received is\n")打印信息,在SD卡上加载了MLO和app后,只能循环输出几次这个信息,然后板子就异常关机了。
当我把这段代码“BIOS_start()”屏蔽了板子不会关机,会while循环执行UART_printf("sssssssss\n")。

char echoPrompt[]="uart driver and utils example test cases :please enetr the 50 bytes of character or press the esc \n";
char echoPrompt1[]="DATA RECEIVED IS\n ";
#define SOC_CORE_PAD_IO_REGISTERS_BASE (0x4a003400U)

/* Length of the input in number of characters */
#define INPUT_LENGTH (16U)

Void uart_test(UArg arg0, UArg arg1)
{
char input = '\n';
char *buffPointer;

buffPointer = (char*)malloc(INPUT_LENGTH);
memset(buffPointer,0,INPUT_LENGTH);

// UART_puts("uart driver and utils example test cases :please enetr the 16 bytes of character or press the esc \n",sizeof("uart driver and utils example test cases :please enetr the 16 bytes of character or press the esc or carriage return\n"));

while(1) {

UART_printf("Data received is\n");
}

}

/*
* ======== main ========
*/
int main(void)
{
/* Call board init functions */
Task_Handle task;
Error_Block eb;
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;
Board_init(boardCfg);

Error_init(&eb);

#if 1
task = Task_create(uart_test, NULL, &eb);
if (task == NULL) {
System_printf("Task_create() failed!\n");
BIOS_exit(0);
}
#endif
/* Start BIOS */
BIOS_start();
while(1){
UART_printf("sssssssss\n");
}
return (0);
}

这个MLO是官方诊断程序里面的MLO(C:\TI\pdk_am57xx_1_0_12\packages\ti\boot\sbl\binary\idkAM574x\mmcsd\bin),官方诊断程序好像是裸机,不知道会不会有影响,我也没找到其他MLO。app是PDK创建给出的示例。就是下面这种

请问我需要主要什么吗,如何在BIOS_start()启动的情况下,程序能够正常运行。

Nancy Wang:

请问您上面贴出的uart_test代码是诊断程序吗?BIOS_start()是启动sys/bios。

user4839655:

回复 Nancy Wang:

现在是这种情况,上面的测试不是诊断程序,是PDK的一个例子,PDK例子都是启动了sys/bios的。现在是这样的情况:不屏蔽BIOS_start()的时候,当MLO是诊断程序里面的MLO(这个MLO是官方SD卡自带的)时,task里面的while(1) {UART_printf("Data received is\n");}会执行几次板子就断电关机了。因为这个MLO是诊断程序里的MLO,我想可能启动sys/bios可能会有问题,然后我就C:\TI\pdk_am57xx_1_0_12\packages\ti\boot\sbl\binary\idkAM574x\mmcsd\bin这里面的MLO,然后不能跳转到程序执行。

Nancy Wang:

回复 user4839655:

user4839655

然后我就C:\TI\pdk_am57xx_1_0_12\packages\ti\boot\sbl\binary\idkAM574x\mmcsd\bin这里面的MLO,然后不能跳转到程序执行。

不能跳转到程序执行,看一下是不是入口地址的配置问题。

4.6.3.2.9.2. Configuring entry point for SBL

The two key files that help setup the entry point in the SBL build are “sbl/soc/<SOC_NAME>/sbl_init.S” and the linker command file “sbl/soc/<SOC_NAME>/linker.cmd”. The global symbol Entry is used to provide the entry point to the SBL. The Base address of the memory section SBL_MEM is then used by the tiimage and GP Header tool to provide RBL the guidance to find the entry point to pass control. After MLO is created check the TI image format file(MLO or _ti.bin) or the GP Header file to confirm that the entry point matches the location of Entry symbol in the sbl.map

https://software-dl.ti.com/processor-sdk-rtos/esd/docs/06_03_00_106/AM437X/rtos/index_Foundational_Components.html#am57x

user4839655:

回复 Nancy Wang:

我用的都是官方的原始文件,应该没啥问题。之前说不能debug,后来英文论坛有人说将MLO放在SD卡,删除A15上的Gel文件,我试了下就可以debug了,现在又出现了新的问题,能够dubug一部分代码,debug某些代码时就报错CS_DAP_PC: Error: (Error -154 @ 0x0) One of the FTDI driver functions used to write data returned bad status or an error. (Emulation package 9.2.0.00002)

CS_DAP_PC: Error: (Error -154 @ 0x1) One of the FTDI driver functions used to write data returned bad status or an error. (Emulation package 9.2.0.00002)

CS_DAP_PC: Unable to determine target status after 20 attempts

CS_DAP_PC: Failed to remove the debug state from the target before disconnecting.  There may still be breakpoint op-codes embedded in program memory.  It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

CortexA15_0: JTAG Communication Error: (Error -154 @ 0x0) One of the FTDI driver functions used to write data returned bad status or an error. (Emulation package 9.2.0.00002)

报错了之后,板子就断电关机。

然后我就发现xds100v2的VID和PID不是(VID = 0403 PID = A6D0),然后我就按照https://processors.wiki.ti.com/index.php/XDS100#How_to_make_an_XDS100_.2F_How_to_build_an_XDS100_hardware_emulator这个方法程序重新将EEPROM编程为VID = 0403 PID = A6D0,如下图。结果还是报FTDI 驱动的问题,然后还是断电关机,这是问题1。自从程序烧写了EEPROM之后,用Tera Term就连不上UART了,我按照https://processors.wiki.ti.com/index.php/XDS100#Q:_Can_I_use_port_B_as_a_UART.3F这个方法试了也不行,这是问题2。不知道是不是因为我用的是Windows10的原因,我用Ubuntu连不上debug,所以才继续用的win10。

赞(0)
未经允许不得转载:TI中文支持网 » idk574x使用SD卡启动关机问题
分享到: 更多 (0)