LinkServer Script LOAD function

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

LinkServer Script LOAD function

884 Views
mjosborne1
Contributor III

From the MCUXpresso IDE "LinkServer Scripts" section:

LOAD "FILENAME": Loads a script from the current, absolute, or relative directory

Can someone please provide an example of using this without absolute paths?

What is the current directory from this functions perspective?

i.e. the .project file location? build output location?

Absolute path works for me but that's not what I need, and the error I get when trying to specify a relative path is: "Error: Bad file given to LOAD command", but no information as to where it is trying to access...

Thanks

0 Kudos
3 Replies

840 Views
ErichStyger
Senior Contributor V

Hi @mjosborne1 ,

What I have used so far in my projects is placing the script files in <ide>\binaries\Scripts or at the project root directory (where the .project is located).

So to me the LinkServer scripting is taking these two folders in a kind of pre-search order.

It finds the files there if it is specified without a path in it, e.g. "test.scp", but I have not been able to use a relative path from there.

Interestingly, if I use "./test.scp", it finds the file in the location of the IDE executable path (<ide path>\ide).

I need to have some more tests and report back if I find something new.

Erich

0 Kudos

713 Views
mjosborne1
Contributor III

Hi @ErichStyger ,

thank you for looking into this.

I tried using LOAD when the scripts are in <ide>\binaries\Scripts and also the project root directory; I can't get it to work without specifying the absolute path. 

In my attempt to get a non-absolute path working I'm just doing: 

100 LOAD "Init_SDRAM.scp"

Are there any System Environment or MCUX Build variables that I might be missing?

Thanks again for the help

0 Kudos

544 Views
ErichStyger
Senior Contributor V

Hi @mjosborne1 ,

I did some digging around scripting (see as well my article about it: https://mcuoneclipse.com/2023/07/25/linkserver-scripting-and-how-to-recover-mcus-with-a-script/ ).

My conclusion is that currently LOAD cannot be executed in scripts itself, and if used in interactive mode, it only allows using an absolute path (which is strange somehow).

As for loading a script outside the script, you have to start the path with a '\' or '/'. See above article.

If I find out more, I'll post it for sure.

0 Kudos