any012 发表于 2017-6-27 08:45:23

eclipse+ac6下stm32开发,出现make: Interrupt/Exception caught错误。

用了一段时间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函数无法向串口输出数据了。

SInzo 发表于 2017-6-27 08:45:24

any012 发表于 2017-6-27 09:50
试过这个,一点编译就自动把makefile文件更新了,也许是我的操作不对。

如果在win 下,用编译器编译的话,makefile是每次编译都实时更新的,你可能需要其他方式(比如cmake?)来编译文件

SInzo 发表于 2017-6-27 09:19:48



如果使用其他方法定义一个printStr函数如何?重定向必然是有各类限制的。

MrJiu 发表于 2017-6-27 09:24:24

eclipse开发ST,没搞成功过 ,只能帮顶!!!;P;P

SInzo 发表于 2017-6-27 09:26:15

试试这个方法,在makefile文件加入这一行

SHELL=C:/Windows/System32/cmd.exe


参考:http://superuser.com/questions/375029/make-interrupt-exception-caught

any012 发表于 2017-6-27 09:50:23

SInzo 发表于 2017-6-27 09:26
试试这个方法,在makefile文件加入这一行

SHELL=C:/Windows/System32/cmd.exe


试过这个,一点编译就自动把makefile文件更新了,也许是我的操作不对。

any012 发表于 2017-6-27 09:50:40

SInzo 发表于 2017-6-27 09:26
试试这个方法,在makefile文件加入这一行

SHELL=C:/Windows/System32/cmd.exe


试过这个,一点编译就自动把makefile文件更新了,也许是我的操作不对。

any012 发表于 2017-6-27 09:56:03

SInzo 发表于 2017-6-27 09:53
如果在win 下,用编译器编译的话,makefile是每次编译都实时更新的,你可能需要其他方式(比如cmake?) ...

不懂那么多啊...

any012 发表于 2017-6-27 11:29:33

本帖最后由 any012 于 2017-6-27 11:31 编辑

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");

any012 发表于 2017-6-28 16:37:06

printf函数的问题,有点进展了。
新建了个简单的工程,printf()函数还是通过_write()重定向到串口1输出。
增加了个printf()语句,结果第一个printf( )语句能正常输出了。
又试了变为连续3各printf( )语句,仍是最后一个printf( )语句丢失。

    printf("\r\n project name: 4PTtest1");
    printf("\r\n one second past.");
    printf("\r\n hahaha.");


收←◆
project name: 4PTtest1

收←◆
project name: 4PTtest1
one second past.


页: [1]
查看完整版本: eclipse+ac6下stm32开发,出现make: Interrupt/Exception caught错误。