OpenOCD programming flash mistake

Hi,

I modified the OpenOCD version 98 to make it support SST flash, but I met a problem when programming this flash. It seems that someone has met this problem before.

When the size of the binary file is less than about 4K, the OpenOCD works very well, but for binary files with size larger than 4K, though the tool says it wrote the binary file into the flash successfully. However, actually it did not. As when the program executes, some mistakes occur. I have use the serial port to download the program into flash, and the program is OK.

Does anyone know what’s the problem?

Thanks,

Kevin

Hello,

This was something that took me more than two days to figure out what was happening on a LPC2148…

You are erasing only the first sector of your flash and when you write your code (which is more than 4Κ) a part is written on a non erased flash.

This produces undefined instructions… That’s your problem.

So, when you are erasing your flash specify the last sector to be more than 0.

i.e. ‘flash erase 0 0 7’ will do your job.

Regards,

Triantafillos