I have been testing the IAP example application, and find that it works fine as long as the file you are downloading is < 1024 bytes (like the example binary coming with the IAP) !! If the file is > 1024 bytes, the last 16 bytes in that block (1024) are programmed to 0x00 ??? I havent been able to find the problem yet, has anyone else seen this problem ? Programming the same binary using the hardware built in bootloader or a J-link works fine. BR Brian
Posted on May 17, 2011 at 12:24Have debugged the application a bit more and found that: 1. The error comes when copying a buffer using the memcpy function ! In Ymodem.c function Ymodem_Receive (u8 *buf) memcpy(buf_ptr, packet_data + PACKET_HEADER, packet_length); The length parameter supplied to memcpy is 1024, but it only copies 1008 I have verified this using the j-link debugger. Changing the call to memcpy(buf_ptr, packet_data + PACKET_HEADER, packet_length+16); copies 1024 bytes !! Now the application works :-? But as I see it, there must be an error in the library cotaining memcpy ! I have contacted IAR about this.
I now find that using the IAR EWARM 4.42 along with the IAP example supplied by ST works fine (the Keil example also works :-)). However the example coming with new IAR EWARM 5.11 kickstart seems to be broken. Here the last 16 byte are set to 0x00 in every 1024 block. There is no source differences between the ST and IAR example, but (5.11)implements a new linker command file, which forces some new section assignments. And maybe this is the problem. Has anyone succesfully converted old IAR projects to the 5.11 version ? BR Brian
Posted on May 17, 2011 at 12:24IAR support have acknowledged the bug with memcpy They state that it will be fixed in the next release 5.20 (june 2008). Best solution in my opinion is to make my own memcpy function ;) when using IAR 5.11 !
I finally know, that my problem is not related to problems with the toolchain.
I used the startup script cortexm3_macro.s for the RIDE7 toolchain from the ST FWLIB. This got me somehow in trouble. I managed to kick some of the content out and compile a working firmware with working string operations. If I know what specifically went wrong, I will post it.