用习惯了 eclipse的环境后,总是觉得 IAR的编辑弱爆了,一直想外挂一个编辑器上去。 看到 这个帖子以后,仿照步骤一步一步操作即可。 主要改动的地方为 环境变量, IAR_PATH_STM8。

但是 V19的 slickedit 配置工程模板有问题,不能保存,提示: Failed to save project templates to XXX Path not found Make sure the file can be written to.

碰到这个情况,可以把 usrprjtemplates.vpt 放到 C:\Users\Administrator\Documents\My SlickEdit Config\19.0.1 中去,然后重新配置一遍就可以保存了。

今天使用 iar-stm8 编译 atomthread 出错,出错提示为: Error[Lc036]: no block or place matches the pattern "ro code section .text in atomport-asm-iar.o"

经过一番搜索,发现,解决办法很简单。

把 atomthread-asm-iar.s 打开,修改如下。

  SECTION .text:code
  改成:      
  SECTION `.near_func.text`:CODE

今天在用codeblock打开几年前的avr工程,编译的时候,出错了,错误是 undefined reference to `eewr_byte_m169p。 经过1个小时的努力,终于找到问题所在了。 解释: As you see the EEPROM support has changed in recent years so that now the header files identify the AVR you are using (mega644) and then concatenate this onto the eewrbyte* style routine names and these are then provided in the link from the device specific .o file. When this works the map file shows something like: e:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr5\libc.a(eewr_byte_atmega644.o) test.o (__eewr_byte_m644) That's built on Windows with WinAVR but the point is that it's ../avr/lib/avr5/libc.a that is providing the function. If you get undefined ref then that suggests that you environment is not linking with the right libc.a Maybe show your complete build output? Is the -mmcu=atmega644 being passed to the link as well as the compiles?

解决办法很简单,libc.a需要选择../avr/lib/avr5/libc.a这个才行。

allegro 快捷键 funckey r iangle 90 funckey f mirror funckey m move

allegro 默认生成的钻孔图在 cam350 当中不会自动导入,手动导入以后比例也有些问题,解决办法是在NC 参数那一项里面选中 Enhanced excellon format。这样就可以自动导入了

学习 《QT快速入门》命令行这一小节,发现有点问题。 编译的时候会提示没有 QApplication。 解决办法是在 *.pro 中添加

QT += widgets

在win7的命令行中要进行编译,首先环境变量当中要加入 \Tools\mingw482_32\bin 和 \5.3\mingw482_32\bin

  1. qmake -project
  2. qmake
  3. mingw32-make.exe

首先去 上面的 download 去下载

looking for the latest version? Download mingw-get-setup.exe

然后安装,我安装在 d 盘 安装完成以后,使用 mingw-get 来图形化安装,我选择了全部安装。 安装完成以后,需要修改 WIN 的环境变量 path 和 home 这两项, path 里面增加 D:\MinGW\bin,这个是为了给 eclipse 用的 home 修改为 D:\MinGW,这个是个msys使用的,如果不用msys,这一项不需要。

然后安装 jre,eclipse,注意eclipse 选择 c/c++ 的下载。 eclipse 下载安装以后,在新建项目的时候选择 MinGW 就可以了,项目编译的时候,会自动找到头文件的文件夹。

今天被枚举给坑了一下,枚举不能用于预编译中间,不能就肯定不是想要的逻辑。 例如 enum{Name_0, Name_1, Name_2};

define NAME Name_2

int main(void) {

if (NAME == Name_1)

 printf("111\n");

else

printf("222\n");

endif

} 结果输出的肯定是 111

找到的解释如下

The `#if' command in its simplest form consists of

if expression controlled text #endif / expression /

The comment following the #endif' is not required, but it is a good practice because it helps people match the#endif' to the corresponding #if'. Such comments should always be used, except in short conditionals that are not nested. In fact, you can put anything at all after the#endif' and it will be ignored by the GNU C preprocessor, but only comments are acceptable in ANSI Standard C.

expression is a C expression of integer type, subject to stringent restrictions. It may contain

Integer constants, which are all regarded as long or unsigned long.

Character constants, which are interpreted according to the character set and conventions of the machine and operating system on which the preprocessor is running. The GNU C preprocessor uses the C data type `char' for these character constants; therefore, whether some character codes are negative is determined by the C compiler used to compile the preprocessor. If it treats `char' as signed, then character codes large enough to set the sign bit will be considered negative; otherwise, no character code is considered negative.

Arithmetic operators for addition, subtraction, multiplication, division, bitwise operations, shifts, comparisons, and `&&' and `||'.

Identifiers that are not macros, which are all treated as zero(!).

Macro calls. All macro calls in the expression are expanded before actual computation of the expression's value begins.

Note that `sizeof' operators and enum-type values are not allowed. enum-type values, like all other identifiers that are not taken as macro calls and expanded, are treated as zero.

The controlled text inside of a conditional can include preprocessor commands. Then the commands inside the conditional are obeyed only if that branch of the conditional succeeds. The text can also contain other conditional groups. However, the #if' and#endif' commands must balance.

From:

今天使用GCC编译的时候发现了一个错误,invalid application of 'sizeof' to incomplete type 。 这个错误的原因是sizeof是在编译阶段进行计算的,而extern是在链接阶段工作的,所以在多文件的时候会出现这个错误。 解决办法也很简单,就是在头文件里面extern的地方显式的表现出数组的大小。

升级到新版的 jlink 使用几次以后还是出现了这个问题。 Failed to prepare for programming. Failed to download RAMCode!
经过尝试发现,原因应该是程序导致的问题,所以解决方法也很简单。
先用 r 来复位,然后用 erase 命令擦除flash,然后在用 loadbin 加载写入。
对 jlinkflash.txt 进行相应的修改就可以在 eclipse 中使用了