Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Can I build libmbed.a myself? #66

Closed
leomonan opened this issue Apr 17, 2020 · 5 comments
Closed

Can I build libmbed.a myself? #66

leomonan opened this issue Apr 17, 2020 · 5 comments
Labels
question Further information is requested

Comments

@leomonan
Copy link

I want to add some debug code inside “class Thread”, but I find this class may be implemented in

ARDUINO_NANO33BLE/libs/libmbed.a
Can I find a way to get the libmbed.a's source code and build it locally?

@facchinm
Copy link
Member

Hi @leomonan ,
you can just run ./mbed-os-to-arduino -r /path/of/you/mbed-os/local/clone ARDUINO_NANO33BLE:ARDUINO_NANO33BLE from the root of this repository.
The script runs on Linux and probably on macOS (you may need to apply this patch).
I just noticed that the instructions in README are out of date and I'm going to amend them.

@facchinm facchinm added the question Further information is requested label Apr 17, 2020
@leomonan
Copy link
Author

leomonan commented May 28, 2020

Hi @facchinm
Sorry, I tried but got "mbed: command not found" error, I can't find mbed function in this script.
could you please give me some help?

$ ./mbed-os-to-arduino -r local/clone ARDUINO_NANO33BLE:ARDUINO_NANO33BLE
MBED_CLEAN=0
MBED_UPDATE=0
APPLY_PATCHES=0
LOCAL_REPO=local/clone
REMOTE_BRANCH=
MBED_CORE_LOCATION=/home/monan/workspaces/ArduinoCore-nRF528x-mbedos

VARIANT=ARDUINO_NANO33BLE BOARD=ARDUINO_NANO33BLE
Checking for prerequisites... done.
Creating MbedOS Application..../mbed-os-to-arduino: line 25: mbed: command not found

@facchinm
Copy link
Member

You need to install mbed cli as a prerequisite (https://os.mbed.com/docs/mbed-os/v5.15/tools/manual-installation.html) , I need to amend the documentation to point it out.

@trungnq97
Copy link

Hi @facchinm
I run the below command in /workspace/.platformio/packages/framework-arduino-nrf52-mbedos

./mbed-os-to-arduino ARDUINO_NANO33BLE:ARDUINO_NANO33BLE

and get the error below. Do you know what could be the issue? Thank you in advance.

MBED_CLEAN=0
MBED_UPDATE=0
APPLY_PATCHES=0
LOCAL_REPO=
REMOTE_BRANCH=
MBED_CORE_LOCATION=/workspace/.platformio/packages/framework-arduino-nrf52-mbedos

VARIANT=ARDUINO_NANO33BLE BOARD=ARDUINO_NANO33BLE
Checking for prerequisites... done.
Creating MbedOS Application... done.
Checking out preferred 'mbed-os' version... done.
Setting up Mbed Application...[mbed] Working path "/tmp/mbed-os-program" (program)
[mbed] ARDUINO_NANO33BLE now set as default target in program "mbed-os-program"
[mbed] Working path "/tmp/mbed-os-program" (program)
[mbed] GCC_ARM now set as default toolchain in program "mbed-os-program"
 done.
Compiling Mbed Application...Compile [ 49.1%]: thread_management_api.c
[mbed] ERROR: "/home/trung/.platformio/penv/bin/python" returned error.
       Code: 1
       Path: "/tmp/mbed-os-program"
       Command: "/home/trung/.platformio/penv/bin/python -u /tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m ARDUINO_NANO33BLE --source . --source ./mbed-os/features/unsupported/dsp/ --build ./BUILD/ARDUINO_NANO33BLE/GCC_ARM -v"

@leomonan
Copy link
Author

@trungnq97 this my caused by a compile error(did you modified the source code youself?), you can find the error by run the build command separately:
/home/trung/.platformio/penv/bin/python -u /tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m ARDUINO_NANO33BLE --source . --source ./mbed-os/features/unsupported/dsp/ --build ./BUILD/ARDUINO_NANO33BLE/GCC_ARM -v

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants