Content originally posted in LPCWare by cyberstudio on Mon Jan 03 04:25:21 MST 2011
Tried the autoisp sample and it kind-of-worked for me. I got it to recognize the '?' character but afterwards it begins to do strange things, such as becoming unresponsive shortly afterwards. This was with a LPC1114 but I do not know if it makes any difference.
My own app was also able to enter bootloader successfully using the ReinvokeISP() call, but the biggest chunk I was able to write to flash, once in bootloader, was 1K. After some tracing I found that I could not use the 'W' command to write to RAM above address 0x10001100 (approx), or it would kill the bootloader and hang. I suspected there may have been a conflict between the stack and the RAM memory used to hold the data being copied to flash, but I couldn't figure out how the stack could get so low for my small app.
What I do not understand at all was why we are setting the main stack pointer to 0x1fff0000? That was where the boot ROM is. Why not point to the top of RAM instead? (However, setting MSP to the beginning to boot ROM does work, but setting it to top of RAM doesn't.)
Any help would be greatly appreciated.