LPC1114 with SWD Loader Error: Unknown Target Device
Using CW 2.0.5 and latest lpc11xx support package. Olimex USB-OCD-Tiny and Rowley SWD Adapter. Debugger connects fine, receive the Unknown Target Device error after the 'Preparing target for user application'. LPC1114 has been specified in the project and this is a new project setup specifically for this target.
-
This indicates that the device you are targeting has a part ID that is not known by the FLASH loader program.
Run the following code (you will need to use a RAM build configuration so CrossWorks will download into RAM rather than FLASH and therefore not use a loader) and let us know the part ID that is returned:
#include <__cross_studio_io.h>
#include <liblpc1000.h>
int
main(void)
{
uint32_t partID;
liblpc1000_iap_command(IAP_CMD_READ_PART_ID, 0, 0, 0 ,0, &partID, 0, 0, 0);
debug_printf("part ID: 0x%08X\n", partID);
return 0;
} -
I've uploaded an modified loader to http://www.rowleydownload.co.uk/tmp/Loader_lpc1100.elf - can you try replacing the existing loader with this file and see if it solves the problem? To find the existing loader, click File > Open Directory In File Explorer > Open Targets Directory... and then look in the LPC1000/Release directory.
-
I'm having a similar problem and I'm hoping to get some assistance with a solution.
I just received an IAR KickStart Kit for LPC1788 and am trying to use it with CrossStudio. The JTAG device is the Segger J-Link and I have CrossStudio set up to point to the DLL. It seems to be OK with regard to that. I've installed the IAR LPC1788 KickStart Board Support Package as well as the other required packages. If I look in the CrossWorks for ARM->packages->targets directory I can see the IAR_LPC1788_KickStart folder containing 2 .c files and a project templates xml file. Yet when I try to run the debugger, I get this same "Loader error: unknown target device" error after "Preparing target for user application" step is completed. What am I missing?
-
Bill, make sure you are using the latest version of the LPC1000 CPU support package (1.28) and that you have a project loaded that specifically targets an LPC1788 (for example, one of the sample projects we ship in the IAR LPC1788 KickStart Board Support Package). If you believe this to be the case, what is the result of the running the code described above?
-
Hi Jon,
Yes, I checked, and I am using version 1.28 of the LPC1000 CPU support package. I have not been able to experiment with one of the sample projects because I cannot even get them to build. It seems like files are missing and/or paths to source code are incorrect. For example, I loaded the "Platform Tests" solution, which contains 10 projects (Accelerometer, Button, LED, etc) and tried to build the "LED - Blink All" project. I got a build error which stated:
cc1: fatal error: C:/Users/Bill/AppData/Local/Rowley Associates Limited/CrossWorks for ARM/packages/samples/source/example_led_blink_all.c: No such file or directory
If I go to the samples directory in the above path, there is no "source" subdirectory. There is only an IAR_LPC1788_KickStart folder. When I do a search of the Rowley Associates Limited folder for this example_led_blink_all.c file it is not found anywhere.
To add more detail to my previous post, I should say that I started out by modifying an existing solution/project for the LPC1766 in order to create my new solution/project for the LPC1788. I then went into the project properties and modified them to use the LPC1788 instead, and perhaps I missed a few items that were not so obvious.
One of my coworkers suggested that my problem may be due to an incorrect loader file, and suggested that I should copy the contents of Loader_lpc177x_8x.elf into Loader_rpc.elf. I tried that and it did work. I no longer get the "Loader error: unknown target device" error, but my code execution now stops at line 157 of crt0_thumbs.s, which seems to be a Rowley supplied file:
/* Call constructors */
ldr r0, =__ctors_start__ <--- Line 157
ldr r1, =__ctors_end__
ctor_loop:
cmp r0, r1
beq ctor_end
ldr r2, [r0]
add r0, #4
push {r0-r1}
blx r2
pop {r0-r1}
b ctor_loop
ctor_end:This is where I am stuck this morning. . . . .
Regards,
Bill
-
Bill,
Which version of CrossWorks are you using? The platform library, is only available on V3. Try one of the simpler projects, for example click Tools > Show Installed Packages, click on the IAR LPC1788 KickStart Board Support Package link then click LPC1788 KickStart Samples Solution to open the example solution.
Copying the loader file is not a good idea, it sounds very much like you're using a project intended for a different device which isn't going to work.
Regards,
Jon
-
Hi Jon,
I'm using version 2.1.1. Yeah, I know, pretty old, but the company I work for does not have a license for the newer version of the tool.
Your suggestion to navigate through the "Show Installed Packages" to select a sample project worked. I was opening them by clicking on the hzp files in the file folder and that was not working. I was able to build, load, and run the debugio project and saw "Hello World".
I agree, in hindsight, that modifying an old LPC1766 solution to be an LPC1788 solution was not the correct approach as there are many items that were being missed. Is there some very basic sample solution for the LPC1788 that I can use as a starting point, and then port all of my LPC1766 solution/projects/code/support files into it?
Regards,
Bill
Please sign in to leave a comment.
Comments
12 comments