0
\$\begingroup\$

Every time I create a new mbed-os project, (mbed new ...) I end up with a 1GB folder. This seems a tad bit excessive. How can I reuse the mbed-os folder so that every call to mbed new just uses the same repo?

\$\endgroup\$
3
  • \$\begingroup\$ I don't know what mbed new does, but it sounds like it's intentionally putting a whole SDK and a lot of runtime stuff in a directory, as storage is cheap and time lost to incompatibilities through changes done for one project or through update is not. You can find all read-only components of your folder, run sha1sum on them, compare that to the sums from another mbed directory, and replace copies with so-called hardlinks, if what you're doing is on a POSIX-compatible file system. Honestly, in an age of 512 GB SSDs below 50€, each GB you save is worth < 10 ct. What's the price of your time? \$\endgroup\$ Mar 20, 2021 at 18:26
  • \$\begingroup\$ (I'm very serious about the cost of SSDs; if you're running low on space on your development laptop, USB3 adapters for SATA and even M.2 NVMe SSDs are a thing, and honestly, good USB thumb drives have become a thing, too) \$\endgroup\$ Mar 20, 2021 at 18:34
  • 2
    \$\begingroup\$ I’m voting to close this question because the question relates to software, not to electronic design \$\endgroup\$ Apr 3, 2021 at 8:15

1 Answer 1

2
\$\begingroup\$

Turns out you can use mbed new --create-only, and then symbolically link mbed-os to the project folder.

\$\endgroup\$
2
  • \$\begingroup\$ That's of course an easy solution, +1! \$\endgroup\$ Mar 20, 2021 at 18:53
  • 1
    \$\begingroup\$ @marcus not only that, if you don't want to compile mbed OS itself(it takes a good while for me) every time you make a new project, you can just create a new .h file and rename your main function to mymain() and then in the main.cpp file just include that .h file and call mymain(), kind of like Arduino. At the moment, if you change debug/release mode, it will still recompile and delete the previous build instead of using different folders so I advise creating two such projects. \$\endgroup\$ Jun 18, 2021 at 12:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.