之前既没有学过IAR,也没有玩过IAP,这次乘学习STM8的机会想把这两样都给学了,所以我选用IAR作为STM8的开发工具。
初次尝试编写IAP,遇到许多问题,盼可以得到高手们的指点。
1.使用AN2659里的代码修改后放在IAR里编译,有几条语句出现编译错误
a.DataAddress = *(__far unsigned char**)(&DataBuffer[N_ADDR_3]);
Error[Pe513]: a value of type "unsigned char __far *" cannot be assigned to an entity of type "unsigned char *" D:\Backup\我的文档\STM8\IAP\main.c 249
b.if (!WriteBuffer(DataAddress, DataCount+1))
Error[Pe167]: argument of type "unsigned char volatile *" is incompatible with parameter of type "unsigned char *" D:\Backup\我的文档\STM8\IAP\main.c 338
c. if ((DataAddress >= RAM_START) && (DataAddress <= RAM_END))
Warning[Pe186]: pointless comparison of unsigned integer with zero D:\Backup\我的文档\STM8\IAP\main.c 380
2.因为boot部分占用了CODE区的开始部分,AP程序在编译的时候要重新指向中断向量地址,在IAR里代码应该怎么实现? |