This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port API addition and cellular feature for ESP-IDF/Zephyr: PPP-level …
…integration. (#1067) See ADDITIONAL NOTES at the end of this commit message for information on other, consequential, changes included in this commit. This commit introduces the concept of a PPP interface to ubxlib, only for the ESP-IDF and Zephyr platforms (see note about Zephyr below) and with a cellular transport. It allows the native application protocols of these platforms to be used with cellular. This is currently only supported with SARA-R5 and SARA-R422 cellular modules. U_CFG_PPP_ENABLE must be defined when building ubxlib to enable PPP. Of course, for this to integrate with the platform there will be additional build requirements related to the platform itself (enabling the right components of the platform etc.): see the README.md in the ESP-IDF and Zephyr platform directories for details. Examples are added to the sockets example set showing how to use native ESP-IDF/Zephyr sockets with PPP. The PPP interface is defined as a new port API, which includes a default implementation that does nothing so that no existing ports are adversely affected by it. This port API is, internally, called from the cellular code, such that when the cellular network is up the PPP interface of the port layer is automatically activated, connecting into the PPP layer at the bottom of the IP stack of the platform (and uNetworkInterfaceUp() will return an error if it does not). NOTE TO ZEPHYR USERS: There is an issue in Zephyr PPP, discussed here zephyrproject-rtos/zephyr#67627, which means that Zephyr does not shut the PPP link down properly, leaving the module connected, so it will not connect again next time around unless the module is power cycled or rebooted. A workaround for the problem is included in this commit, so everything works fine, _except_ that when a cellular connection is disconnected Zephyr must be allowed 20 seconds for its side of the PPP connection to time out; this delay is included within the ubxlib code. If you do not want this delay (e.g. because you are going to switch the cellular module off anyway, or because your application is not going to connect again for at least 20 seconds) then you can remove it by defining U_CFG_PPP_ZEPHYR_TERMINATE_WAIT_DISABLE. Once the Zephyr issue is fixed and the fix is available in a version of Zephyr that forms a part of nRFConnect SDK the delay will be removed. ADDITIONAL NOTES: - CMUX is now fixed to have separate mutexes for Tx and Rx paths; a single mutex was fine as a simplification when relatively low-bandwidth applications were in play but it is no longer good enough with bi-directional, higher speed, PPP traffic, - additional debug has been added to the CMUX: see U_CELL_MUX_ENABLE_USER_TX_DEBUG and U_CELL_MUX_HEX_DEBUG (as well as the existing U_CELL_MUX_ENABLE_USER_TX_DEBUG) in u_cell_mux.c, - in the "runner" build for nRF5SDK we have moved 1 kbytes from main task stack to heap, otherwise our test requirements that at least 5 kbytes of heap and 5 kbytes of main task stack remain for the user application were not being met; obviously you will have tuned these values for your application in any case, - we notice that the stack size requirements for ESP-IDF tasks, even ones apparently unrelated to IP, increase somewhat when the IP stack is compiled-in; beware!
- Loading branch information