redscript / redlink commandline usage

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

redscript / redlink commandline usage

1,073 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IJeffray on Tue Jul 29 07:03:56 MST 2014
Having now developed solutions using LPCXpresso, we wish to batch download to RAM and execute, without involving the IDE.

It looks like 'redscript.exe' may be the correct thing to use here, but I can't find any documentation and not achieving much success with it.

The crt_emu_* tools are *not* appropriate, as we do not want to write to flash -- just to download to RAM.

Has anyone any guidance on this topic?
0 Kudos
10 Replies

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Fri Nov 13 05:19:32 MST 2015
Suggest you use LPCXpresso to debug a session, and then look in the "GDB traces" log to see what it does. You might also want to read the GDB manual to see what commands it offers....
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jason.webb on Fri Nov 13 05:07:10 MST 2015
Thank you. Using the double backslash gets me a bit further. Now how do I run the code to the UUT.

GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.1.20141128-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from C:\\AICH_Software\\ch_target_test\\Debug\CONFIG_TEST.axf...
done.
<7.7.2_379\\lpcxpresso\\bin\\crt_emu_cm_redlink -vendor=NXP -pLPC4320
Remote debugging using | C:\\nxp\\LPCXpresso_7.7.2_379\\lpcxpresso\\bin\\crt_emu
_cm_redlink -vendor=NXP -pLPC4320
Ni: LPCXpresso RedlinkMulti Driver v7.7 (Mar 31 2015 21:01:19 - crt_emu_cm_redli
nk build 317)
Nc: Emu(0): Conn&Reset. DpID: 2BA01477. CpuID: 410FC240. Info: (null)
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Nc: Flash support set up with no driver - Ef(44): Flash driver version is unknow
n.
Cf:v LPCXpressoPro Full License - Unlimited
Protocol error: qXfer:features:read (target-features) conflicting enabled respon
ses.
(gdb) load
You can't do that when your target is `exec'
(gdb)


Anyone have a LabView vi or TestStand seq that does this?
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LessThanZero on Thu Nov 12 15:10:44 MST 2015
if you use a back slash in your path, you need to use two like this:

"target extended-remote | C:\\nxp\\LPCXpresso_7.7.2_379\\lpcxpresso\\bin\\crt_emu_cm_redlink -vendor=NXP -pLPC4320 "

one back slash escapes the other.

Alternatively, use a forward slash in your path, or, start in the 'lpcxpresso/bin' folder and you can use a minimal path like "target extended-remote | ./crt_emu_cm_redlink -vendor=NXP -pLPC4320"

LessThanZero
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Wed Nov 11 02:27:28 MST 2015
please post the commands and the output from your GDB session - maybe we can then see what you are doing wrong!
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jason.webb on Wed Nov 11 01:45:57 MST 2015
I can run the "crt_emu_cm_redlink -vendor=NXP -pLPC4320" command from the command line but then if I try the "load" command in gdb I get a error, something along the lines of "no target set", and I cant run the axf file.
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Tue Nov 10 10:28:35 MST 2015
What happens if you just run
crt_emu_cm_redlink
From the command line (instead of running gdb)?
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jason.webb on Tue Nov 10 09:45:12 MST 2015
Found this post online and is exactly what I need to do. I have followed the procedure but when I enter the "target extended-remote | crt_emu_cm_redlink -vendor=NXP -pLPC4320" command, I get a "no such file or directory" error. I have tried the full path,  "target extended-remote | C:\nxp\LPCXpresso_7.7.2_379\lpcxpresso\bin\crt_emu_cm_redlink -vendor=NXP -pLPC4320 ", but still get the same error.

Ideas?

The axf file has been "read" into gdb and I do have the LPC4320.
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Jul 30 03:48:00 MST 2014
Ok, so you will basically need to use our previously mentioned option 1)

To start experimenting with this, from the LPCXpresso IDE, open a terminal / command line prompt from the status bar shortcuts:

Now disconnect then reconnect your LPC-Link2 and then boot it as described at:

http://www.lpcware.com/content/faq/lpcxpresso/booting-lpc-link2

Now change directory in the 'Debug" and start GDB using:
arm-none-eabi-gdb myimage.axf


(where myimage.axf is the name of your image).

Once gdb has started, use the following command to connect to the target:

target extended-remote | crt_emu_cm_redlink -vendor=NXP -pLPC4320


Then to download the code, use the command:
load


Then to start execution use the command:
c


More information on gdb commands can be found inside the LPCXpresso Help menu, or by searching the web.

Note that your requirement to access SDRAM will make things slightly more complex. You will probably need to write a gdb script to poke the MCU registers to set up the external memory controller appropriately. Or else run a simple application first, before downloading your main application, which sets the SDRAM up for you.

Regards,
LPCXpresso Support
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IJeffray on Wed Jul 30 01:49:52 MST 2014
Thanks for a quick response.

The product has no USB, no hard I/O of any kind, so download via JTAG really is the only option.

We currently use an LPC-Link 2 with LPCXpresso 7.x to download single images to RAM and execute them, which has been ok up to now, but ideally we want something automated and not using the IDE, for production line usage.  I've been struggling to determine which is the most recent/supported system to even begin investigating.

The solution should be able to download an image to the LPC4320 internal SRAM, and another binary to external SDRAM, then execute the code in internal SRAM.    (This will then encrypt and store firmware to flash and set up the boot ROM)

I'm not sure what other information is useful in determining what tool should be used?
0 Kudos

812 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jul 29 09:48:03 MST 2014
No, redscript is NOT the solution.

The answer depends on what part you are using and what you are trying to do. I can think of two solutions:

1. Using a Debug adapter (link1, link2, cmsis-dap), GDB and crt_emu_*

You can use command line GDB (arm-none-eabi-gdb) and the debug driver (crt_emu_*).  You can use a gdb script to download and run it

OR

2. If you are using a device that is bootable over USB, you can use dfu-util to download the image and run it. This is how we load firmware into the RAM of LPC-Link2

If you give us more information, we can provide further help and advice.
0 Kudos