@hkayan some update to share with you, I tried to build the libmbed.a from the source based on the public repo of the mbed-os core, and it worked well w/o any issues. Here are some details. Compile mbed-os from source This is useful if the user wants to custom the mbed-os and apply the changes to Arduino core. Prerequisites python 3.x: as a reference, I used 3.9.6 mbed CLI (1.x): as a reference, I used 1.10.5 Step 1 - Clone the repos Clone the ArduinoCore-mbed mkdir -p ~/Arduino/hardware/arduino cd ~/Arduino/hardware/arduino git clone https://github.com/arduino/ArduinoCore-mbed.git cd ArduinoCore-mbed Clone the Arduino-API repo mkdir -p ~/Arduino cd ~/Arduino git clone git@github.com:arduino/ArduinoCore-API git clone git@github.com:arduino/ArduinoCore-API cd ~/Arduino/hardware/arduino/ArduinoCore-mbed/cores/arduino ln -sf ~/Arduino/ArduinoCore-API/api . Clone mbed-os repo export mbed_os_repo=~/prj/mbed-os mkdir -p ~/prj cd ~/prj git clone https://github.com/ARMmbed/mbed-os.git Step 2 - mbed-os-to-arduino [optional] This step is optional and can be tried when something goes wrong in the build process. change the "set -ef" to "set -xf" in file mbed-to-arduino Step 3 - Preparation export arduino_core=~/Arduino/hardware/arduino/ArduinoCore-mbed cd $arduino_core ./mbed-os-to-arduino -a -r $mbed_os_repo NICLA:NICLA Note: in this step, the script tries to apply some patches to the mbed-os repo, and this might cause some trivial failures (errors such as patches that cannot be applied), and this kind of errors could be ignored. Step 4 - Make Configuration Changes if needed edit the file ./variants/NICLA/conf/mbed_app.json Changes such as stack size etc could be changed. This would affect the libmbed.a generated Step 5 - Build the core (including the libmbed.a) ./mbed-os-to-arduino -r $mbed_os_repo NICLA:NICLA Step 6 - Check result The script should say: "exit 0" at the end of the process, otherwise some errors have occured and should be fixed accordingly. Check the build environement (mbed CLI, python version etc) zg@ZG-TC:~/Arduino/hardware/arduino/ArduinoCore-mbed$ ls -lha variants/NICLA/libs/ total 5.3M drwxrwxr-x 2 zg zg 4.0K Oct 24 20:09 . drwxrwxr-x 4 zg zg 4.0K Oct 24 20:19 .. -rw-rw-r-- 1 zg zg 5.3M Oct 24 20:19 libmbed.a
... View more