Closed Alex-EEE closed 6 years ago
@Alex-EEE That's going to try to scan the current directory twice... You many want to just run the export from the directory above instead.
That being said, I don't know why you would be getting that error, unless you deleted the .mbed
file from the tools directory.
@Alex-EEE You seem to have left off the mcu argument. I assume that you had the -m
argument present, as it got passed argument parsing.
The command works when I run it "normally" (from the root of the mbed program) with no source switch. I was able to do mbed test -compile --source .. and pull in TESTS folders from the parent of my mbed program, so I thought maybe export would work as well. But perhaps export will be unhappy looking at folders that are not structured as mbed programs? -MCU: I have it set in my global properties.
@Alex-EEE
folders that are not structured as mbed programs
I suppose that this is possible, but unlikely.
The error your seeing is quite odd, It's complaining about not being able to open a particular file, which exists.
I also expect that to work.
@Alex-EEE You may be able to work around this issue by putting a .mbed
file in the C:\files\mbed\sandbox\framework
directory.
So that let the export finish, BUT, it put the project file into ".." (makes sense), but it actually populated all the relative paths inside project file AS IF the project file was still in the root mbed directory ( the directory where I invoked mbed export ). I moved the project file to there and now all the relative links work.
Couple more questions:
How does mbed CLI "detect" if a folder is "an mbed program" That is, what does it "not see" when this happens:
PS C:\files\mbed\sandbox\framework> mbed export
[mbed] WARNING: Could not find mbed program in current path "C:\files\mbed\sandbox\framework".
What does .mbed contain? I see it indicates the target, what does key ROOT indicate?
the .mbed
file
project local settings, including the ROOT
element indicating the root of the project.
Workaround:
We are building an application which can be simulated under Windows/Linux. Mbed-os is only one part of the source tree and we need to build it using a Makefile as part of the "application project' loadcells and not within the instead of using the mbed-cli environment. Project structure: Root | projects
If multiple --source options are used the generated makefiles are placed in the first --source location mbed export -i gcc_arm -m NUCLEO_L432KC --profile debug --source mbed-os --source projects\loadcells
Hi @ArjanSmit
I think that's enough information to let me know what's going wrong here. I'll see what I can do about this today. I think it may be a quick fix.
@Alex-EEE I think you may want to check out #626
@theotherjimmy thanks! @ArjanSmit you could also consider " --source .. "
(FYI, I work with ArjanSmith on this project, #626 won't solve this problem) @theotherjimmy @Alex-EEE "--source .." won't work because it would include the "simulation" sources.
I've looked a bit more into this, and I came to the conclusion that "--source" in the "export" function is just broken. Simple example, file structure:
mbed-os/
projects/projectA/main.cpp
projects/projectB/main.cpp
Then, executing mbed-cli export -i make_gcc_arm --source projects/projectA --source mbed-os
in the root of this structure will result in a Makefile being made at:
projects/projectA/Makefile
However, this Makefile has paths that are relative to the location where mbed-cli is run, example:
SOURCES = mbed-os/* \
projects/projectA/main.cpp
I would expect:
SOURCES = ../../mbed-os/ \
main.cpp
Short version
So, short version, mbed-cli export
generates paths relative to the current working directory, but stores the resulting export in the first source path. At which point at least the Makefile export no longer works (and thus the eclipse also fails)
FYI, running mbed-cli compile --source projects/projectA --source mbed-os
does work correctly, making me think that this is proper use of --source. And that just the export is broken.
@daid I'm considering it a bug that mbed export
does not correctly respect multiple --source
parameters. I'm looking into resolving that today.
@Alex-EEE @ArjanSmit @daid I got to it. It was easier than I thought! check out https://github.com/ARMmbed/mbed-os/pull/6143
Hi,
I'm trying to export while also including source files in the parent directory of my mbed program. The following fails: