Open chrissnow opened 4 months ago
Hello,
maybe mbed-cellular has to be add to top lvl CMakeLists.txt
Change from this
target_link_libraries(main mbed-os)
to this
target_link_libraries(main mbed-os mbed-cellular)
@chrissnow Hello, are you using the latest Mbed CE? In ATHandler.cpp, line 1193 should be:
rtos::ThisThread::sleep_until(_last_response_stop + _at_send_delay);
But the code in your compiler output shows:
rtos::ThisThread::sleep_until(_last_response_stop.time_since_epoch() + _at_send_delay);
@wdx04 I'm on the latest commit? https://github.com/mbed-ce/mbed-os/blob/eb0012983a23c67b2de4a9854c69931d665df4ff/connectivity/cellular/source/framework/device/ATHandler.cpp#L1193C3-L1193C77
Yes, this is the latest commit. But maybe you have multiple copies of mbed-os and this is not the one you are using? The compiler output shows you are using this file: RETRACTED/cell_test/mbed-os/connectivity/cellular/source/framework/device/ATHandler.cpp. You may open the file with an editor and verify that it matches the latest version, line 1193.
I think I had meddled at the point I took the logs to try and get it working.
back to normal and you get
mbed-os/connectivity/cellular/source/framework/device/ATHandler.cpp:1193: undefined reference to `rtos::ThisThread::sleep_until(std::chrono::time_point<mbed::internal::OsClock, std::chrono::duration<long long, std::ratio<1ll, 1000ll> > >)'
OK I can reproduce this on my end by using any cellular APIs in an application. To be honest, I do not believe anyone has tried to use these features of Mbed CE since the build system changeover. OK lemme take a look...
Ah OK I see the issue. This ultimately comes from a rather odd decision by ARM (tho, maybe made worse by Mbed CE) to support building both baremetal Mbed and Mbed OS in the same configured project, rather than having users pick one or the other at configure time. This leads to weirdness: libraries like mbed-cellular
are compiled against mbed-baremetal
, but linked against mbed-os
. In this case, the problem is that rtos::Kernel::duration
changes its underlying type between baremetal and OS, so the function it expects to find no longer exists.
As a workaround, for now, try dropping the following into your CMakeLists.txt after add_subdirectory(mbed-os):
target_link_libraries(mbed-cellular PUBLIC mbed-rtos-flags)
That will cause mbed-cellular to be compiled against the RTOS, fixing the link error. This workaround, plus #307, allowed me to link an app with mbed-cellular!
@multiplemonomials Apologies it's taken so long to test all of this, were close now!
The project links fine now and AT commands are passing correctly however NSAPI_PPP_AVAILABLE is not true despite MBED_CONF_LWIP_PPP_ENABLED being true in mbed-target-config.h
#define MBED_CONF_PPP_ENABLED 0
#define MBED_CONF_LWIP_PPP_ENABLED 1
#define NSAPI_PPP_AVAILABLE (MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED)
This means PPP doesn't come up during connect in here. mbed-os\connectivity\cellular\source\framework\AT\AT_CellularContext.cpp
It's like mbed-target-config.h isnt being included for the cellular stack.
Hmm, could you elaborate on how you know that PPP doesn't come up? If you put a #warning inside one of the
#if NSAPI_PPP_AVAILABLE
blocks, does it print during compilation?
Interesting, VSCode doesn't think it's defined but it is
Time to dig deeper as to why PPP doesn't come up after the CONNECT response
Fixed it :-) I forgot I had to patch the EC2X driver to work with the EG915. Once I have tested it a bit further I will sort a PR for a EG915 driver.
We are looking at porting an existing project that uses cellular over to mbed-ce but there seems to be a compile error and I cant figure out why given the types seem to match.
https://github.com/mbed-ce/mbed-os/blob/71cb8129af5803b3268eadbe56e20e10a42183aa/connectivity/cellular/source/framework/device/ATHandler.cpp#L1193
The project was originally based on https://github.com/ARMmbed/mbed-os-example-cellular
Anything that makes use of the ATHandler Class is likely to fail to build.
Likely unrelated but we are using a NUCLEO_WB55RG