In the next step, I configured my little project for FRDM K64F board with ARM_GCC toolchain:
mbed-tools configure -m K64F -t GCC_ARM
and attempted to compile the code:
mbed-tools compile -m K64F -t GCC_ARM
Unluckily, the compilation failed with the error:
…/…/…/…/main.cpp:6:10: fatal error: EthernetInterface.h: No such file or directory
6 | #include “EthernetInterface.h”
Is there anything else I need to take care of?
Remark:
I noticed the mbed-tools complained about missing modules “prettytable”,“intelhex”,“jinja2”,“python3”, but did not abort the execution. Well, prettytable and intelhex are actually available, but I guess / hope that this is not related to the issue.
Hi MACRUM,
many thanks - but, I need to write that the compilation again failed. But this time it seems to be an error in the mbed-os sources:
./../../../mbed-os/connectivity/nanostack/sal-stack-nanostack/source/Security/protocols/gkh_sec_prot/supp_gkh_sec_prot.c: In function 'supp_gkh_sec_prot_message_get':
../../../../mbed-os/connectivity/nanostack/sal-stack-nanostack/source/Security/protocols/gkh_sec_prot/supp_gkh_sec_prot.c:180:57: error: expected ')' before 'PRId64'
180 | tr_error("GKH: invalid replay counter %"PRId64, eapol_pdu->msg.key.replay_counter);
If I download the referenced example, I face a similar failure:
In file included from ../../../../mbed-os/connectivity/libraries/nanostack-libservice/./mbed-client-libservice/ns_trace.h:32,
from ../../../../mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_management_api.c:38:
../../../../mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_management_api.c: In function 'thread_management_set_commissioning_data_timestamp':
../../../../mbed-os/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread/thread_management_api.c:401:63: error: expected ')' before 'PRIu64'
401 | tr_debug("thread management set commissioning timestamp %"PRIu64, time);
| ^~~~~~
If you or anyone else has an idea how to proceed with these issues, this would be highly appreciated!
Best regards
cdelfs
At least I found a workaround which does not make me happy, but it works.
I added some definitions in the CMakeLists.txt file in the root directory:
For C++ files, I added: add_compile_definitions(__STDC_FORMAT_MACROS)
For C files, I added add_compile_definitions(PRIx64="llx") add_compile_definitions(PRId64="lld") add_compile_definitions(PRIi64="lli") add_compile_definitions(PRIu64="llu")
Well, the definitions for C anyway also affect the C++ compilation, so the definition for C++ is in the end superflous.
Hi MACRUM,
many thanks for your hint with the compiler version. I can confirm: this was the reason!!
So far, I used the arm-none-eabi-gcc which was directly installable via apt-get/aptitude (on my Ubuntu 20.04 LTS). I was aware that Ubuntu is not a “front runner” when keeping up with most recent SW versions of the available packages, but I did not expect that the compiler was not usable for mbed.
Here my previous version :
the issue went away and I could - without further hacks in the CMakeLists.txt file - compile the example program!
I also updated the mbed-tools (from 7.14 .0 to 7.18.0), needed to keep my Python version (3.8.5) and left my recent cmake install untouched (3.20.2). But these differences were not decisive.
I checked the release notes for the most recent mbed-os release and also found
In the mbed OS 6.11.0 release. we are testing the following toolchains:
ARM compiler 6.15.0
GCC_ARM 9-2019-q4-major
which confirms that the standard Ubuntu compiler version is not appropriate - even though the version seems to be similar to the version used by mbed/you (both based on 2019-q4) .
Again, many thanks MACRUM for providing the hint!
Best regads
cdelfs