How to force a recompilation of MbedOS?

Hello,

I did change some header file within the MbedOS source tree by means of applying some patch. In particular
~/.arduino15/packages/arduino/hardware/mbed_giga/4.2.1/cores/arduino/mbed/connectivity/drivers/emac/COMPONENT_WHD/interface/WhdSTAInterface.h

Obviously, the Arduino IDE does not detect this change and therefore does not rebuild MbedOS when compiling the sketch.

So how can I trigger the rebuild of MbedOS then? Perhaps executing some make within one of the MbedOS source directories?

One way is probably also a complete reinstallation of the IDE, but that's not very nice....

Thanks in advance for hints,
Mario

Hi @digitalforce.

You can follow the instructions here:

https://github.com/arduino/arduinocore-mbed#mbed-os-to-arduino-script

No, that wouldn't accomplish anything. Mbed OS is not built from source when you install Arduino IDE, nor is it done automatically at any other time on your system.

The Arduino developers precompile Mbed OS and distribute the precompiled binaries as part of the "Arduino Mbed OS Giga Boards" platform installation.

Hello @ptillisch ,

thanks for clarifying this. I see....

I got quite ahead with this. Apart from installation of additional tools as described here:
https://os.mbed.com/docs/mbed-os/v6.16/build-tools/index.html#compiler-versions

I did the following:

  • create a directory for the build process
  • place mbed-os-to-arduino script there
  • execute "mkdir -p variants/PORTENTA_H7_M7/{libs,conf}" there
  • execute "./mbed-os-to-arduino PORTENTA_H7_M7:PORTENTA_H7_M7" there

The last command checks out the Mbed OS sources into /tmp/mbed-os-program/ and starts the compilation. However, at some point I'm receiving this:

> Compile [ 52.0%]: ws_bbr_api.c
> Compile [ 52.0%]: ws_bootstrap_ffn.c
> [mbed] ERROR: "/usr/bin/python3" returned error.
>        Code: 1
>        Path: "/tmp/mbed-os-program"
>        Command: "/usr/bin/python3 -u /tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m PORTENTA_H7_M7 --source . --build ./BUILD/PORTENTA_H7_M7/GCC_ARM -v"
> ---
>  done.
> Generating defines... done.
> Generating includes... copying to destination... cp: with --parents, the destination must be a directory
> Try 'cp --help' for more information.
> cp: with --parents, the destination must be a directory
> Try 'cp --help' for more information.

This reported issue with cp repeats lots of time.
What can that be?

I'm running this stuff under Ubuntu 22.04.3 LTS - in case this is relevant.

In order to provide an update on that....

An attempt to build Mbed-OS for instance with
./mbed-os-to-arduino ARDUINO_NANO33BLE:ARDUINO_NANO33BLE
is failing in the same way (just to test some other configuration).

The mbed-os-to-arduino script is furthermore providing the following warning in an early stage:


Compiling Mbed Application...[mbed] WARNING: Missing Python modules were not auto-installed.
The Mbed OS tools in this program require the following Python modules: urllib3, pyyaml, future, requests, cryptography
You can install all missing modules by running "pip install -r requirements.txt" in "/tmp/mbed-os-program/mbed-os"
On Posix systems (Linux, etc) you might have to switch to superuser account or use "sudo"

I did execute the given command line in the given directory as root, which did install something indeed. However, the issue remains the same.

Yet another update....

I came across that discussion: Building debug libmbed.a

I can't follow all the details there, but I did give this alternative procedure a chance that is described there (post #28).

It worked...

It is also possible to specify GIGA:GIGA as configuration, which was not possible before for me.

Within the subdirectory variants/GIGA/libs/ I'm finding libmbed.a, which I'll try to move into the IDE somehow, resp. replace the original one.

Ok, and a final one for today :slight_smile:

It seemed intuitive for me to not just replace the libmbed.a file, but the whole GIGA subdirectory in ~/.arduino15/packages/arduino/hardware/mbed_giga/4.2.1/variants
with the GIGA subdirectory found in the build-directory under the variants subdirectory.

I did re-build the sketch resp. the Arduino application through the IDE. An - voila - the issue of the Mbed-OS I was faced with is gone :slight_smile:

That's all....

congrats. In my experience the only file (other than the lib) that needs copying is mbed_config.h

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.