First I use hardware to enter ISP mode and update my program successfully.
And then I use code "Chip_IAP_ReinvokeISP(BOOT_CAN)" to transfer the same hex file to update my program. When I use the hex generated by IAR v7.4, it works fine.
But when I transfer the hex generated by IAR v7.8. It will stuck at the same point every time.
Please look at the picture below.
In the blue box, you can see LPC1517 response every time when I write hex data to RAM.
In the green box, I know it will go wrong at the next transfer, so I read the Identification Number to make sure it is alive before the next transfer.
And after the next transfer marked by red line, it just no response anymore.
It happens every time at the same point.
Please help me to solve this trouble. Thanks a lot.
Hi Chih-yuan Yu,
As far as I understand, you write the first 256 bytes, check the vendor ID that is the response from the red line and after the device dies, right?
Also could you let me know the commands you're using to write in the RAM?
Did the hex files generated by both versions of IAR has the same length?
Best Regards,
Alexis Andalon
Hi nxf46116,
Actually, after the hex file of my program is generated, I merged it with another hex file which is from my co-worker, his hex is generated from IAR7.4.
The flash memory map is showed as follows,
The problem is, when the whole program (my program(IAR7.8) + certain function program(IAR7.4)) is existed in the MCU, then I use Chip_IAP_ReinvokeISP in My program to update any program, it failed. And it will success with my program build with IAR7.4. I wonder why.
Thanks for your reply!
One question about this:
The function in the location 0x0000 0000 jump after its execution to your application?
When a MCU wake up after a reset it will go to the location 0x0000 0000 to look for the vector table and the ISR vector.
Best Regards,
Alexis Andalon
Yes, the function will jump to my application.
Hi Chih-yuan Yu,
I don't think this is a matter of IAR versions. I'm suspecting that you don't move your application to the 0x0000 2400 in your linker file. You would need to do it if you want to shift your application. Please check the next link:
https://www.iar.com/support/tech-notes/general/creating-a-bootloader-for-cortex-m/
There explain how to download extra images.
Let me know if this helps you.
Best Regards,
Alexis Andalon
Hi Alexis Andalon,
Thanks for your reply.
I had change the linker config file already. In the hex file, I can see the address of my application is start at 2400 correctly.
I try "disable irq" before or after calling "reinvoke isp", but it still the same problem.
I call "reinvoke isp" in an interrupt function, could it be a problem?
Hi Chih-yuan Yu,
I would recommend to not use any IAP command in the interrupt vector. Also could you let me know what is the result from the IAP command?
This could let us know if its jumping to the ISP mode.
Best Regards,
Alexis Andalon