Compiling error [Solved]

Hi
I have installed a fresh MbedStudio on arch linux
Mbed blinky - new version is working great on FRDM-KL25Z

I imported a usb-midi project from new mbed documentation
https://os.mbed.com/docs/mbed-os/v6.16/apis/usbmidi.html
I get error:

Using toolchain ARMC6 profile {‘ENV’: {‘ARMLMD_LICENSE_FILE’: ‘8224@10.100.166.33:8224@10.100.120.118’}, ‘PATHS’: {‘ARMC6_PATH’: ‘/opt/ARMCompiler6.15.13/bin/’, ‘ARM_PATH’: ‘/opt/armcc5_06_u6/’}, ‘common’: [‘-c’, ‘–gnu’, ‘-O3’, ‘-Otime’, ‘–split_sections’, ‘–apcs=interwork’], ‘cxx’: [‘–cpp’, ‘–no_rtti’], ‘COMPILE_C_AS_CPP’: False, ‘NEW_SCAN_RESOURCES’: True}
scan /tmp/chroots/ch-55c10fbc-3242-4d49-8765-be9a14c8944e/src
scan /tmp/chroots/ch-55c10fbc-3242-4d49-8765-be9a14c8944e/extras/mbed-os.lib
Library name ‘rtos’ is not unique (defined in ‘/tmp/chroots/ch-55c10fbc-3242-4d49-8765-be9a14c8944e/extras/mbed-os.lib/cmsis/device/rtos/mbed_lib.json’ and ‘/tmp/chroots/ch-55c10fbc-3242-4d49-8765-be9a14c8944e/src/mbed-os/cmsis/device/rtos/mbed_lib.json’)
Internal error.
Build failed
Build failed

The failed library is changing at every build.

What can I do?
Tom

It almost looks like you have two copies of mbed-os in your project?

hehe yes - however blinky works on two boards (nucleo and frdm)
I think it’s something in USBMIDI library - have you tried to compile one of the examples?

Hello,

to be honest I do not understand your argument about

State of the binky example has nothing together with another project that was probably badly imported.
Please be so kind see below the result of successful compilation after import. Same result was also with updated MbedOS library to latest.

Link: mbed-os-snippet-usbmidi
[Warning] @0,0: L3912W: Option 'legacyalign' is deprecated.
Elf2Bin: mbed-os-snippet-usbmidi
| Module               |         .text |     .data |        .bss |
|----------------------|---------------|-----------|-------------|
| [lib]\c_p.l          |     5596(-66) |    16(+0) |     348(+0) |
| [lib]\libcppabi_p.l  |        44(+0) |     0(+0) |       0(+0) |
| anon$$obj.o          |        32(+0) |     0(+0) |    1024(+0) |
| main.o               |      296(+24) |     0(+0) |    1336(+0) |
| mbed-os\cmsis        | 10496(+10496) | 168(+168) | 6610(+6610) |
| mbed-os\components   |       0(-152) |     0(+0) |       0(+0) |
| mbed-os\connectivity |     403(+403) |     0(+0) |       0(+0) |
| mbed-os\drivers      |     9150(+22) |     0(+0) |       2(+0) |
| mbed-os\features     |       0(-177) |     0(+0) |       0(+0) |
| mbed-os\hal          |    586(-1416) |     0(-4) |      2(-65) |
| mbed-os\platform     |    7519(-192) |    64(+0) |     341(+0) |
| mbed-os\rtos         |   660(-10458) |   0(-168) |    0(-6626) |
| mbed-os\targets      |    2238(-812) |     4(+0) |      12(-7) |
| Subtotals            |  37020(-2328) |   252(-4) |   9675(-88) |
Total Static RAM memory (data + bss): 9927(-92) bytes
Total Flash memory (text + data): 37272(-2332) bytes
Image: BUILD/KL25Z/ARMC6\mbed-os-snippet-usbmidi.bin

BR, Jan

Thanks a lot, Jan
I keep working on it and I will post results
Tom

So, I created new project. Then, I replaced content of main.cpp file with usbmidi example.
It compiled without any issues.
When I try to use Import into Keil Studio button, the compilation fails.
Thank for giving me hope, guys :slight_smile:
Tom

Ok, I also tried this with KeilStudio and after import I saw same wrong behavior like you wrote.
However the example is delivered with very old MbedOS version - 6.0.0 - RC01. The RC means Release Candidate and that really not good version for use I think. As soon as I updated the Mbed OS library to 6.17 everything seems to be OK

BR, Jan

1 Like

Thanks a lot - now I understand what happened!
Tom