LPC1517 C_CAN ISP No response

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1517 C_CAN ISP No response

1,062 Views
alan_cy_yu
Contributor II

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. 

pastedImage_2.png

It happens every time at the same point.

Please help me to solve this trouble. Thanks a lot.

Labels (1)
7 Replies

816 Views
Alexis_A
NXP TechSupport
NXP TechSupport

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

816 Views
alan_cy_yu
Contributor II

Hi nxf46116‌,

  1. I write 1024 bytes each time before copy to flash. And yes, I check the ID before and after the device dies.
  2. After enter ISP mode, the steps showed as follows:
    • UnLock Page
    • Prepare sectors for Write (Sector0~15)
    • Erase Sectors (Sector0~15)
    • RAM Write Address. The address is 0x0200 0300.
    • Program Area (Index 0x1F50, 01). Start to write hex data. → Die in this step. It dies in the 8xxth byte. 
  3. The hex files generated different versions of IAR has different length.

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, 

pastedImage_1.png

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!

0 Kudos

816 Views
Alexis_A
NXP TechSupport
NXP TechSupport

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

816 Views
alan_cy_yu
Contributor II

Yes, the function will jump to my application.

0 Kudos

816 Views
Alexis_A
NXP TechSupport
NXP TechSupport

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

0 Kudos

816 Views
alan_cy_yu
Contributor II

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?

 

0 Kudos

816 Views
Alexis_A
NXP TechSupport
NXP TechSupport

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

0 Kudos