大学生
最后登录1970-1-1
在线时间 小时
注册时间2013-6-4
|
本帖最后由 冷月_清秋 于 2013-6-19 11:49 编辑
int main()
{
// UINT16 i;
LED_Drive_Init();
UartInit();
printf("\r\n 串口初始化完成");
SysTick_Init();
W25X16_SPI_Init();
FlashDviecID=W25X16_Read_DeviceID();
FlashId=W25X16_Read_ID();
// printf("\r\n FlashDviecID= %d",FlashDviecID);
// printf("\r\n FlashId= %d",FlashId);
printf("\r\n FlashDviecID");
printf("\r\n FlashId");
LCD_Init();
while(1);
只要我的程序里面,加入了LCD_Init(); (之前没有加入LCD驱动,后来写了LCD驱动之后工作就不正常了。)
调试的时候就会出现这样的错误:
void Lcd_init_conf(void)
{
LCD_WriteCMD(0xCF);只要运行到这里,通过FSMC数据写数据到LCD,就会报下面的错误。
LCD_WriteDAT(0x00);
LCD_WriteDAT(0x81);
LCD_WriteDAT(0x30);
Load "..\\Out\\Mydemo.AXF"
* jtag Info: TotalIRLen = 9, IRPrint = 0x0011
* jtag Info: Found Cortex-M3 r1p1, Little endian.
* jtag Info: TPIU fitted.
* jtag Info: ETM fitted.
* jtag Info: FPUnit: 6 code (BP) slots and 2 literal slots
* jtag Info: Found Cortex-M3 r1p1, Little endian.
* jtag Info: TPIU fitted.
* jtag Info: ETM fitted.
* jtag Info: FPUnit: 6 code (BP) slots and 2 literal slots
BS \\Mydemo\../User/ILI9341Drive.c\190
BS \\Mydemo\../User/ILI9341Drive.c\189
WS 2, `outbuff
**jtag Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
***jtag Error: Can not read register 15 (R15) while CPU is running
***jtag Error: Can not read register 16 (XPSR) while CPU is running
***jtag Error: Can not read register 0 (R0) while CPU is running
***jtag Error: Can not read register 1 (R1) while CPU is running
***jtag Error: Can not read register 2 (R2) while CPU is running
***jtag Error: Can not read register 3 (R3) while CPU is running
***jtag Error: Can not read register 4 (R4) while CPU is running
***jtag Error: Can not read register 5 (R5) while CPU is running
***jtag Error: Can not read register 6 (R6) while CPU is running
***jtag Error: Can not read register 7 (R7) while CPU is running
***jtag Error: Can not read register 8 (R8) while CPU is running
***jtag Error: Can not read register 9 (R9) while CPU is running
***jtag Error: Can not read register 10 (R10) while CPU is running
***jtag Error: Can not read register 11 (R11) while CPU is running
***jtag Error: Can not read register 12 (R12) while CPU is running
***jtag Error: Can not read register 13 (R13) while CPU is running
***jtag Error: Can not read register 14 (R14) while CPU is running
***jtag Error: Can not read register 15 (R15) while CPU is running
***jtag Error: Can not read register 16 (XPSR) while CPU is running
***jtag Error: Can not read register 17 (MSP) while CPU is running
***jtag Error: Can not read register 18 (PSP) while CPU is running
***jtag Error: Can not read register 20 (CFBP) while CPU is running
后来我发现,我只要不用prinf()函数就不会出现这样的问题,一切都正常。。
进一步发现:
// UINT16 i;
LED_Drive_Init();
UartInit();
printf("\r\n 串口初始化完成");
SysTick_Init();
W25X16_SPI_Init();
FlashDviecID=W25X16_Read_DeviceID();
FlashId=W25X16_Read_ID();
// printf("\r\n FlashDviecID= %d",FlashDviecID);
// printf("\r\n FlashId= %d",FlashId);//只要屏蔽这两句里就可以
printf("\r\n FlashDviecID");
printf("\r\n FlashId");//再进一步发现,把上面的语句改成这样也没事。。
LCD_Init();
while(1);
哪位兄台能告诉我,有可能什么地方出问题,非常感激。。
刚才试验了一下,如果把,
printf("\r\n FlashDviecID");
printf("\r\n FlashId");//把这两句放到LCD_Init();之后也能正常工作。。。
太没天理了,谁能告诉我,到底怎么啦?
|
-
|