
用了一段时间eclipse+ac6,感觉挺好用的。 可上周突然发现编译不了工程了,有如下提示: 00:35:52 **** Incremental Build of configuration Debug for project 4PTV1_1_1 **** make all Building target: 4PTV1_1_1.elf Invoking: MCU GCC Linker make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3) 00:35:52 Build Finished (took 375ms) 使用的是默认的external builder,并且没有产生.elf文件。 网上搜了下,有的说是环境变量里有其他path变量影响了,我试着将都删除了只保留java相关的一个,结果仍是不行。 如果改成internal builder的话,可以通过编译。 但有新的问题出现了,我是通过增加_write(), _read()函数实现printf()重定向的。结果通过printf函数无法向串口输出数据了。 |
如果在win 下,用编译器编译的话,makefile是每次编译都实时更新的,你可能需要其他方式(比如cmake?)来编译文件
如果使用其他方法定义一个printStr函数如何?重定向必然是有各类限制的。
SHELL=C:/Windows/System32/cmd.exe
参考:http://superuser.com/questions/3 ... pt-exception-caught
试过这个,一点编译就自动把makefile文件更新了,也许是我的操作不对。
试过这个,一点编译就自动把makefile文件更新了,也许是我的操作不对。
不懂那么多啊...
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
这个问题,通过重新安装eclipse+ac6插件,解决了,现在可以用external builder编译了。
printf()函数这里还是有问题,
int _write(int fd, char *ptr, int len)
{
HAL_UART_Transmit(&huart1, (uint8_t *) ptr, len, 0xFFFF);
return len;
}
用stlink调试,发现执行到HAL_UART_Transmit(&huart1, (uint8_t *) ptr, len, 0xFFFF)时,ptr指向的是:
Name : ptr
Details:0x20002e60 "\r\nBð\b\002\232a\232i\002ð\b\002\002\222\002\232\232iBð@\002\232a\233i\003ð@\003\003\223\003\233&L\001\"°! Fý÷îüßø\230\200"
而实际printf函数是想这样输出的:
printf("\r\n the Version of XXX: V1.1.2");
新建了个简单的工程,printf()函数还是通过_write()重定向到串口1输出。
增加了个printf()语句,结果第一个printf( )语句能正常输出了。
又试了变为连续3各printf( )语句,仍是最后一个printf( )语句丢失。
printf("\r\n project name: 4PTtest1");
printf("\r\n one second past.");
printf("\r\n hahaha.");
[08:34:41.265]收←◆
project name: 4PTtest1
[08:35:14.506]收←◆
project name: 4PTtest1
one second past.