8 years, 11 months ago.

compiling cmsis dap using Keil for creating LPC11Uxx_LPC1768_if

I am using LPC1768 mbed board, and trying to compile and run the interface firmware from https://github.com/mbedmicro/CMSIS-DAP I am using Keil ARM MDK with the legacy packages http://www2.keil.com/mdk5/legacy as mentioned in the thread https://developer.mbed.org/questions/2318/How-to-Build-HDK-Firmware/

But I've not been able to run the binary successfully yet.

1) Because I only have eval version Keil, I had to use atleast -O2 level optimization to bring the code size under 32K and succcessfully generate the binary. So, have anyone tried -O2 and the resulting binary for interface firmware worked ?

2) Also the mbed website says the interface cpu is LPC11U24. https://developer.mbed.org/handbook/Firmware-LPC1768-LPC11U24. However the source code has only LPC11U35 and k20dx128. And I tried the former. Could that be the reason why the interface firmware binary did not work? I tried to select "LPC11U24" from the Device list in project Options tab. However this did not make any difference.

3) I then tried to concatenate the bootloader too following steps in https://developer.mbed.org/handbook/cmsis-dap-interface-firmware ( although I saw a post that said it is not required since ROM has bootloader at https://developer.mbed.org/questions/4682/cmsis-dap-project-problems-generating-fi/ ) But I got stuck at this error below. I thought "Image" was the final concatenated file, but I am getting the error that it is missing ??

concat.py

$ python concat.py -i LPC11U35 -t LPC1768 [WARNING] Using default settings. Define your settings in the file private_settings.py Generating image for (if: LPC11U35, target: LPC1768) Bootloader: /cygdrive/c/Users/root/Downloads/CMSIS-DAP-master/bootloader/mdk/lpc11u35/Obj/lpc11u35_bootloader.axf Interface : /cygdrive/c/Users/root/Downloads/CMSIS-DAP-master/interface/mdk/lpc11u35/Obj/lpc11u35_lpc1768_if_mbed_bootloader.axf Image : /cygdrive/c/Users/root/Downloads/CMSIS-DAP-master/tools/tmp/if_lpc11u35__target_lpc1768.bin Traceback (most recent call last): File "concat.py", line 69, in <module> gen_binary(bootloader_elf, TMP_BOOTLOADER_BIN_PATH, is_lpc(options.interface)) File "/cygdrive/c/Users/root/Downloads/CMSIS-DAP-master/tools/utils.py", line 36, in gen_binary run_cmd([FROMELF, '--bin', '--output=%s' % output, input]) File "/cygdrive/c/Users/root/Downloads/CMSIS-DAP-master/tools/utils.py", line 25, in run_cmd p = Popen(command, stdout=PIPE, stderr=PIPE, cwd=wd) File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

3) Anyway, I tried to copy the LPC11U35_LPC1768_if.bin ( as this poster was able to do, https://developer.mbed.org/questions/4682/cmsis-dap-project-problems-generating-fi/) file to the flash and then power cycled the board. But, , the application for LPC1768 did not get loaded and run.

4) Then I tried to download from Keil ( cmsis_dap selected from Debug dialog and also unchecked SWJ ) and I got the error:

Keil

Processing completed, no Errors. After Build - User command #2: fromelf --bin -o "C:\Users\root\Downloads\CMSIS-DAP-master\interface\mdk\lpc11u35\Obj\lpc11u35_lpc1768\lpc11u35_lpc1768_if.bin" "C:\Users\root\Downloads\CMSIS-DAP-master\interface\mdk\lpc11u35\Obj\lpc11u35_lpc1768\lpc11u35_lpc1768_if.axf" ".\Obj\lpc11u35_lpc1768\lpc11u35_lpc1768_if.axf" - 0 Error(s), 13 Warning(s). Build Time Elapsed: 00:00:14 Load "C:
Users
root
Downloads
CMSIS-DAP-master
interface
mdk
lpc11u35
Obj
lpc11u35_lpc1768
lpc11u35_lpc1768_if.axf" Cannot access Memory (@ 0x40048000, Write, Acc Size: 4 Byte) Cannot access Memory Error: Flash Download failed - Target DLL has been cancelled

So apparently, I have exhausted all options that I could find on the internet and now at a real dead end. What are the mistakes that I could be making- what needs to be fixed ?

thanks

Additional info : The interface firmware binary dowloaded from https://developer.mbed.org/handbook/Firmware-LPC1768-LPC11U24 works well on my board. I can download and run/debug any program on LPC1768 target cpu using keil.

However compiling the cmsis dap interface firmware and running that on the mbed , is not working.

posted by newbie here 20 May 2015
Be the first to answer this question.