This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: Error while running Pre-build command from bat script

Part Number: CC2640R2F

Hello,

I am trying to run the pre-build command of simple_peripheral project from the bat script. The command is following:

"$XDCROOT$/xs" --xdcpath="$XDCPATH$" iar.tools.configuro -c "$TOOLKIT_DIR$" --cc "$COMPILER_PATH$" --device "$DEVICE$" --compileOptions $COMPILER_ARGS_ROOT_QUOTED$ --linkOptions $LINKER_ARGS_QUOTED$ --profile release --projFile "$PROJ_PATH$" --cfgArgs NO_ROM=1,OAD_IMG_B=1

When i run the command directly from the pre-build option of the IAR it works fine. I have attached the build log .

But when i try to run the command using bat script is following:

SET PROJECT_ROOT=%1

SET XDCROOT=%2

SET XDCPATH=%3

SET TOOLKIT_DIR=%4

SET COMPILER_PATH=%5

SET DEVICE=%6

SET COMPILER_ARGS_ROOT_QUOTED=%7

SET LINKER_ARGS_QUOTED=%8

SET PROJ_PATH=%9

%XDCROOT% --xdcpath=%XDCPATH% iar.tools.configuro -c %TOOLKIT_DIR% --cc %COMPILER_PATH% --device %DEVICE% --compileOptions %COMPILER_ARGS_ROOT_QUOTED% --linkOptions %LINKER_ARGS_QUOTED% --profile release --projFile %PROJ_PATH% --cfgArgs NO_ROM=1,OAD_IMG_B=1

I passed all the custom variables as argument to batch script. The command to run the script is following:

$PROJ_PATH$\pre-build.bat "$PROJECT_ROOT$" "$XDCROOT$" "$XDCPATH$" "$TOOLKIT_DIR$" "$COMPILER_PATH$" "$DEVICE$" $COMPILER_ARGS_ROOT_QUOTED$ $LINKER_ARGS_QUOTED$ "$PROJ_PATH$"

But command is not executing when i had a deep look into the problem i came to know that when XDC make the command it does not insert the --linkOptions. That makes it to fail.

I have attached the build logs while running directly from the pre-build and running from the script. 

Can you please tell me how i can make script to recognize the --linkOptions?