Hello I program lpc1768 by bootloader;Now I want to work with jtag or jlink but I cant. I heard that if I program the micro by bootloader then I can't program it with jtag or jlink unless I erase it with flash magic. Is it right?what's the reason? Thanks in advance
It depends on your software.
If the boot loader was programmed with the code-protect activated, then you need to fully erase the chip using Flash Magic.
Same if your boot loader contains any bug that changes clocks or turns off the JTAG interface - that is a reason why it is often good to have an intentional delay at start of program before starting to do interesting things with the hardware - just so the JTAG adapter can connect and stop the program before any bug locks up the hardware.
My guess is that you must use Flash Magic because of code protection.
thanks my friend I use keil uvision 4.6 and I wrote NO_CRP in Asm tab in target option Do you have any schematic of flash magic circuit ? Thanks in advance
Flash Magic connects directly to the UART0 (of course with proper RS-232 level shifters).
Have you checked the chapter about ISP in the processor manual?