nxp-mcuxpresso / vscode-for-mcux

Support for NXP Visual Studio Code for MCUXpresso Extension project.
17 stars 1 forks source link

Linker issue during project import #25

Closed real-tintin closed 10 months ago

real-tintin commented 10 months ago

Hi,

I'm trying to import a MCUXpresso project. The project originates from a NXP development kit. When importing, I get the following error message:

Error: There are no valid build configurations for this MCUXpresso IDE project: The 'ASMOP1BO0N21' build configuration will be excluded from conversion since the linker script file could not be found into the 'ASMOP1BO0N21' directory. The 'Type 2BP' build configuration will be excluded from conversion since the linker script file could not be found into the 'Type 2BP' directory.

I'm new to MCUXpresso. I have tried to fiddle about with the project settings .cproject - updated the linker path/location as it seems to be "out of scope" (located in a top dir). But without success.

When importing, what structure/location of linker scripts is assumed?

Appreciate any help

DragosMiloiuNXP commented 10 months ago

Hi @real-tintin,

The location of the linker files is automatically determined by reading the .cproject file.

Please make sure to build your project first in order for the MCUXpresso IDE to generate the linker files. For more details see: https://github.com/nxp-mcuxpresso/vscode-for-mcux/wiki/MCUXpresso-IDE-Project-Converter

real-tintin commented 10 months ago

Thanks for the swift feedback @DragosMiloiuNXP.

I managed to solve the linker script issue. I had to manually update the .cproject file (and move some out of source linker scripts - maybe this project is not setup as expected...).

I changed

<option id="com.crt.advproject.link.cpp.script.1351734055" name="Linker script" superClass="com.crt.advproject.link.cpp.script" useByScannerDiscovery="false" value="QN9090_UWB_TAG_FW.ld" valueType="string"/>
<option id="com.crt.advproject.link.cpp.scriptdir.417651430" name="Script path" superClass="com.crt.advproject.link.cpp.scriptdir" useByScannerDiscovery="false" value="../../../boards/QN9090_UWB_TAG_FW.ld" valueType="string"/>

to

<option id="com.crt.advproject.link.cpp.script.1351734055" name="Linker script" superClass="com.crt.advproject.link.cpp.script" useByScannerDiscovery="false" value="ld/QN9090_UWB_TAG_FW.ld" valueType="string"/>
<option id="com.crt.advproject.link.cpp.scriptdir.417651430" name="Script path" superClass="com.crt.advproject.link.cpp.scriptdir" useByScannerDiscovery="false" value="ld/" valueType="string"/>

Notice that I had to explicitly point out the script dir in com.crt.advproject.link.cpp.script, updating com.crt.advproject.link.cpp.scriptdir didn't do anything for me.

I then stumbled upon some other issues. But got some could error logs to support me. Closing this.

cristitep-nxp commented 10 months ago

Hi @real-tintin,

Looking a bit on your situation. Just for our curiosity: the scriptdir might have values in case you do not use "Managed Linker Script" MCUXpresso IDE utility (which is the one responsible to automatically generate ld files). Was this your case? Did you unchecked the Managed Linker Script? FYI: We did not consider indeed this option on our IDE->VSCode project converter, we will fix this.

Thanks!

real-tintin commented 10 months ago

Hi @real-tintin,

Looking a bit on your situation. Just for our curiosity: the scriptdir might have values in case you do not use "Managed Linker Script" MCUXpresso IDE utility (which is the one responsible to automatically generate ld files). Was this your case? Did you unchecked the Managed Linker Script? FYI: We did not consider indeed this option on our IDE->VSCode project converter, we will fix this.

Thanks!

I haven't set anything w.r.t to linker scripts in the IDE. The project originates from a NXP dev kit, I have done minor changes to it.

Sounds good, glad that it helped you as well.