Improving compile time

I’m developing on windows for a STM32F407 and am having problems regarding compile time. mbed will often rebuild all sources, including stuff that I do not even use in my project (cellular, lora, …). It’s even worse when using the debugger, when starting a debug session everything is recompiled twice. I’m seeing the same issue on 2 different machines.
I have tried excluding unused things with a .mbedignore file in my project’s root directory but it does not have any effect. Is it possible to improve compile time somehow?


Kind of duplicate of this topic and this one about MBED 6 compile time.

To get .mbedignore properly apply to your project, you have to either copy directly to the mbed framework folder used by PIO, or use this external script (which seems to be the best solution right now).

Another solution is to use bare metal profile adding this file to your PIO project.

1 Like

Using the bare metal profile was enough to cut compile time down to a few seconds.

    "requires": ["bare-metal"]

Thank you for pointing out the other options, I’ll keep them in mind.

1 Like