Can’t seem to program a target with J-Link

Colleagues,

Apologies for the newbie question, it’s my first attempt with IAR tools. I have a board with LPC2368. When I connect J-Link and run JLink.exe, it identifies one JTAG device and says that it’s ARM7. It suggests that wiring of JTAG is correct. When I try to download a simple program from Embedded Bench into the chip, it doesn’t verify and I get warnings:

Verify error at address 0x00000093, target byte: 0xFF, byte in file: 0x4B
Verify error at address 0x00000094, target byte: 0xFF, byte in file: 0x9C

Could you help me identify causes of this problem?

Cheers,

  • Nick

I use J-link with IAR’s C. It’s integrated with their IDE.

There’s a memory config file that lists the start/end for flash and RAM. I wonder if this could be incorrect for how you’re using J-Link?

Update

In the Project → Options - > Debugger I didn’t have the “Use flash loader(s)” box checked. I’ve checked it. The list of flash loaders now says “….(default)”. My target is set to LPC2368. When I run the debugger, it tries to download to the target and generates a different error:

Fatal error: Write memory error @ address 0xE01FC10C, word access: Memory access timeout.

Probably the initial error got fixed. But there’s something else not quite right.

  • Nick

Check that you have the correct pllup/down ( can’t remember which offhand -check the on-chip debug section of the UM) on the RTCK pin ( J-link doesn’t use it but the MCU uses it to enable debug functions, and I think it can do flaky things if left floating.

Also check you have the latest J-Link drivers from Segger.com

You definitely want ‘use flash loader’ enabled - I think default is OK but may depend on version.

If in doubt, try loading one of the IAR example workspaces as this will have everything set up right, and theer are quite a few things that need setting right…

I use the Segger (black) J-Link as well as the rebranded yellow IAR J-Link box with IAR tools. With the J-Link - I do NOT set the Flash Loader - it will error with it, BUT, you must have the processor type properly set in the Project Options → Select LPC2368 from the processor pulldown list (do not just say “ARM7 family”). I am using this right now for work on an LPC2103 project and it works great, and you get flash breakpoints for free - at least with the LPC21xx family - I expect any LPC2000 serieis as well.

Do run the latest Segger installation and let it update the DLL that it finds in the IAR subdirectory.

I’ve also found that if the device descriction file (.ddf) isn’t correct things will act funky, as the tool’s memory map info isn’t correct (which will also happen if the processor isn’t properly selected). We’ve discovered some “tricks” with the macro files as well. As suggested, if you can get a sample project to work you can use that as a template.