From cf88bb605d8cb40f5000b6e95cd31345d58f86a7 Mon Sep 17 00:00:00 2001 From: Saqib Akram <144418717+sakrubx@users.noreply.github.com> Date: Thu, 4 Jul 2024 18:32:39 +0500 Subject: [PATCH] Cellular change only: support LEXI-R422 and LEXI-R52 (#1195) Support is provided for LEXI-R422, a small form-factor version of SARA-R422, and LEXI-R52, a small form-factor version of SARA-R52. The chief change in the LEXI variants is GPIO numbering/mapping and hence a new GPIO function is introduced, uCellGpioConfigSpecialFunction(), to take advantage of the additional flexibility. --- cell/api/u_cell_gpio.h | 84 ++++++++++++++- cell/api/u_cell_module_type.h | 2 + cell/api/u_cell_time.h | 48 ++++++--- cell/src/u_cell_cfg.c | 4 +- cell/src/u_cell_file.c | 4 +- cell/src/u_cell_gpio.c | 57 +++++++--- cell/src/u_cell_info.c | 2 + cell/src/u_cell_mqtt.c | 12 +-- cell/src/u_cell_mux.c | 2 +- cell/src/u_cell_net.c | 16 +-- cell/src/u_cell_private.c | 101 +++++++++++++++++- cell/src/u_cell_private.h | 29 +++-- cell/src/u_cell_pwr.c | 18 ++-- cell/src/u_cell_sock.c | 4 +- cell/src/u_cell_time.c | 48 +++++---- cell/test/README.md | 2 + cell/test/u_cell_cfg_test.c | 18 +++- cell/test/u_cell_gpio_test.c | 31 ++++-- cell/test/u_cell_mqtt_test.c | 14 +-- cell/test/u_cell_net_test.c | 2 +- cell/test/u_cell_pwr_test.c | 8 +- cell/test/u_cell_sec_tls_test.c | 12 +-- cell/test/u_cell_sock_test.c | 12 ++- cell/test/u_cell_time_test.c | 39 ++++--- example/security/psk_main.c | 7 +- port/platform/common/automation/DATABASE.md | 4 +- .../u-blox,ubxlib-device-cellular.yaml | 2 + 27 files changed, 443 insertions(+), 139 deletions(-) diff --git a/cell/api/u_cell_gpio.h b/cell/api/u_cell_gpio.h index 7eca1d24..dd1a7934 100644 --- a/cell/api/u_cell_gpio.h +++ b/cell/api/u_cell_gpio.h @@ -77,6 +77,7 @@ extern "C" { /** The GPIO names, which map to GPIO IDs. Note that not all * modules support all GPIOs. + * * For LEXI variants the GPIO mapping is a bit different. */ typedef enum { @@ -101,11 +102,53 @@ typedef enum { U_CELL_GPIO_LEXI_10 = 26 } uCellGpioName_t; +/** The special GPIO functions; not all special GPIO functions + * are supported by all modules and in some cases only certain + * pins are able to support certain special functions; refer to + * the interface manual of your module for details. + */ +typedef enum { + U_CELL_GPIO_SPECIAL_FUNCTION_NETWORK_STATUS_INDICATION = 2, + U_CELL_GPIO_SPECIAL_FUNCTION_EXTERNAL_GNSS_SUPPLY_ENABLE = 3, + U_CELL_GPIO_SPECIAL_FUNCTION_EXTERNAL_GNSS_DATA_READY = 4, + U_CELL_GPIO_SPECIAL_FUNCTION_EXTERNAL_GNSS_RTC_SHARING = 5, + U_CELL_GPIO_SPECIAL_FUNCTION_JAMMING_DETECTION_INDICATION = 6, + U_CELL_GPIO_SPECIAL_FUNCTION_SIM_CARD_DETECTION = 7, + U_CELL_GPIO_SPECIAL_FUNCTION_HEADSET_DETECTION = 8, + U_CELL_GPIO_SPECIAL_FUNCTION_GSM_TX_BURST_INDICATION = 9, + U_CELL_GPIO_SPECIAL_FUNCTION_MODULE_STATUS_INDICATION = 10, + U_CELL_GPIO_SPECIAL_FUNCTION_MODULE_OPERATING_MODE_INDICATION = 11, + U_CELL_GPIO_SPECIAL_FUNCTION_I2S_DIGITAL_AUDIO_INTERFACE = 12, + U_CELL_GPIO_SPECIAL_FUNCTION_SPI_SERIAL_INTERFACE = 13, + U_CELL_GPIO_SPECIAL_FUNCTION_MASTER_CLOCK_GENERATION = 14, + U_CELL_GPIO_SPECIAL_FUNCTION_UART_INTERFACE = 15, + U_CELL_GPIO_SPECIAL_FUNCTION_WIFI_ENABLE = 16, + U_CELL_GPIO_SPECIAL_FUNCTION_RING_INDICATOR = 17, + U_CELL_GPIO_SPECIAL_FUNCTION_LAST_GASP = 18, + U_CELL_GPIO_SPECIAL_FUNCTION_EXTERNAL_GNSS_ANTENNA_OR_LNA_CONTROL = 19, + U_CELL_GPIO_SPECIAL_FUNCTION_TIME_PULSE_GNSS = 20, + U_CELL_GPIO_SPECIAL_FUNCTION_TIME_PULSE_OUTPUT = 21, + U_CELL_GPIO_SPECIAL_FUNCTION_TIME_STAMP_OF_EXTERNAL_INTERRUPT = 22, + U_CELL_GPIO_SPECIAL_FUNCTION_FAST_POWER_OFF = 23, + U_CELL_GPIO_SPECIAL_FUNCTION_LWM2M_PULSE = 24, + U_CELL_GPIO_SPECIAL_FUNCTION_HARDWARE_FLOW_CONTROL = 25, + U_CELL_GPIO_SPECIAL_FUNCTION_ANTENNA_DYNAMIC_TUNING = 26, + U_CELL_GPIO_SPECIAL_FUNCTION_EXTERNAL_GNSS_TIME_PULSE_INPUT = 27, + U_CELL_GPIO_SPECIAL_FUNCTION_EXTERNAL_GNSS_TIME_STAMP_OF_EXTERNAL_INTERRUPT = 28, + U_CELL_GPIO_SPECIAL_FUNCTION_DTR_POWER_SAVING = 29, + U_CELL_GPIO_SPECIAL_FUNCTION_32_KHZ_OUTPUT = 30, + U_CELL_GPIO_SPECIAL_FUNCTION_SAFE_MEMORY_AND_POWER_OFF = 31, + U_CELL_GPIO_SPECIAL_FUNCTION_UPSV_CONTROL = 32, + U_CELL_GPIO_SPECIAL_FUNCTION_PAD_DISABLED = 255 +} uCellGpioSpecialFunction_t; + /* ---------------------------------------------------------------- * FUNCTIONS * -------------------------------------------------------------- */ -/** Configure a GPIO of a cellular module. +/** Configure a GPIO of a cellular module as an input, or an output + * with level 0 or 1. + * * VERY IMPORTANT: adopting the terminology of the u-blox AT commmand * manual, each cellular module pin may be referred to in three ways: * @@ -122,6 +165,9 @@ typedef enum { * (i.e. 16 etc., the ones which usually map to the physical pin * number) and that will also work fine. * + * Note: configuring a pin as a GPIO cancels any special function set up + * with uCellGpioConfigSpecialFunction(). + * * @param cellHandle the handle of the cellular instance. * @param gpioId the GPIO ID to set. * @param isOutput the direction, set to true for an output, false for @@ -133,7 +179,42 @@ typedef enum { int32_t uCellGpioConfig(uDeviceHandle_t cellHandle, uCellGpioName_t gpioId, bool isOutput, int32_t level); +/** Configure a GPIO of a cellular module to have a special function, i.e. + * not an application-controlled input/ouput but instead activated by the + * module itself when special things happen e.g. controlling or receiving + * input from an external GNSS chip, providing a time pulse output or + * time-stamping an input (SARA-R5/LEXI-R5 only) etc. + * + * VERY IMPORTANT: adopting the terminology of the u-blox AT commmand + * manual, each cellular module pin may be referred to in three ways: + * + * - pin number: the physical pin of the cellular module, + * - GPIO ID: the ID for that pin, which is usually THE SAME AS + * THE PIN NUMBER, + * - pin name: for instance "GPIO1" or "SDIO_CMD" etc. + * + * This API uses GPIO ID: do not confuse this with the number on + * the end of the pin name, i.e. "GPIO1" is NOT GPIO ID 1, it is GPIO + * ID 16! Hence the #uCellGpioName_t enum is used to allow you to + * pass in #U_CELL_GPIO_1, the value for which is 16. If you prefer + * to use plain integers in your code you can just pass in the GPIO IDs + * (i.e. 16 etc., the ones which usually map to the physical pin + * number) and that will also work fine. + * + * Note: to configure a pin as an input or output controlled by this MCU + * once more, call uCellGpioConfig(). + * + * @param cellHandle the handle of the cellular instance. + * @param gpioId the GPIO ID to set. + * @param specialFunction the special function to adopt. + * @return zero on success else negative error code. + */ +int32_t uCellGpioConfigSpecialFunction(uDeviceHandle_t cellHandle, + uCellGpioName_t gpioId, + uCellGpioSpecialFunction_t specialFunction); + /** Set the state of a GPIO of a cellular module. + * * VERY IMPORTANT: adopting the terminology of the u-blox AT commmand * manual, each cellular module pin may be referred to in three ways: * @@ -159,6 +240,7 @@ int32_t uCellGpioSet(uDeviceHandle_t cellHandle, uCellGpioName_t gpioId, int32_t level); /** Get the state of a GPIO of a cellular module. + * * VERY IMPORTANT: adopting the terminology of the u-blox AT commmand * manual, each cellular module pin may be referred to in three ways: * diff --git a/cell/api/u_cell_module_type.h b/cell/api/u_cell_module_type.h index 5c58ec98..0df5d5fb 100644 --- a/cell/api/u_cell_module_type.h +++ b/cell/api/u_cell_module_type.h @@ -92,6 +92,8 @@ typedef enum { U_CELL_MODULE_TYPE_LENA_R8 = 8, U_CELL_MODULE_TYPE_SARA_R52 = 9, U_CELL_MODULE_TYPE_LEXI_R10 = 10, + U_CELL_MODULE_TYPE_LEXI_R422 = 11, + U_CELL_MODULE_TYPE_LEXI_R52 = 12, // Add any new module types here, before U_CELL_MODULE_TYPE_ANY, assigning // them to specific values. // IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT: see note above. diff --git a/cell/api/u_cell_time.h b/cell/api/u_cell_time.h index 554dd32e..90ceff2f 100644 --- a/cell/api/u_cell_time.h +++ b/cell/api/u_cell_time.h @@ -42,7 +42,7 @@ * high accuracy. In other words, the functions are about * timING, using an arbitrary time-base, and NOT about absolute * clock/calender time. This API is only currently supported by - * SARA-R5 modules. + * LEXI-R5/SARA-R5 modules. * * These functions are thread-safe with the proviso that a cellular * instance should not be accessed before it has been added or after @@ -212,11 +212,23 @@ typedef struct { * FUNCTIONS: CELLTIME * -------------------------------------------------------------- */ -/** Enable CellTime, only supported on SARA-R5. CellTime is about +/** Enable CellTime, only supported on SARA-R5/LEXI-R5. CellTime is about * using the highly accurate cellular network for timing of hardware, * using an arbitrary time-base, it is NOT about absolute clock/calender * time (UTC or local). * + * IMPORTANT: in the case of SARA-R5 the pins of the cellular module + * used to signal time pulse output (in #U_CELL_TIME_MODE_PULSE or + * #U_CELL_TIME_MODE_ONE_SHOT mode), receive an EXT_INT input + * (in #U_CELL_TIME_MODE_EXT_INT_TIMESTAMP mode) or provide an external + * GNSS device connected to the cellular module with a time pulse + * input are fixed at pin number/GPIO ID 19 ("GPIO6"), + * pin number/GPIO ID 33 ("EXT_INT") and pin number.GPIO ID 46 + * ("SDIO_CMD") respectively. HOWEVER in the case of LEXI-R5 there + * is no fixed pin for these functions and hence it is up to the + * application to configure those pins, as required with calls to + * uCellGpioConfigSpecialFunction(). + * * If this function returns success it doesn't necessarily mean that * the requested CellTime operation has succeeded, since the operation * may take a while to complete: please monitor pCallback for progress @@ -228,23 +240,29 @@ typedef struct { * first. * * Any time pulse will appear on pin number/GPIO ID 19, pin name - * "GPIO6" of the cellular module. If the mode is - * #U_CELL_TIME_MODE_PULSE then for SARA-R5xx-00B the pulse width - * is fixed at 3 ms and the period 1 second while for SARA-R5xx-01B and - * later the pulse will be of duration #U_CELL_TIME_PULSE_WIDTH_MILLISECONDS - * and period #U_CELL_TIME_PULSE_PERIOD_SECONDS. If the mode is + * "GPIO6" of SARA-R5, or in the case of LEXI-R5 pin on a pin that + * the application selects using uCellGpioConfigSpecialFunction(). + * If the mode is #U_CELL_TIME_MODE_PULSE then for SARA-R5xx-00B the + * pulse width is fixed at 3 ms and the period 1 second while for + * SARA-R5xx-01B and later the pulse will be of duration + * #U_CELL_TIME_PULSE_WIDTH_MILLISECONDS and period + * #U_CELL_TIME_PULSE_PERIOD_SECONDS. If the mode is * #U_CELL_TIME_MODE_EXT_INT_TIMESTAMP then the input pin is - * the "EXT_INT" pin of the cellular module, pin number/GPIO ID 33. + * the "EXT_INT" pin of the cellular module, pin number/GPIO ID 33, or + * in the case of LEXI-R5 a pin that the application selects through + * calling uCellGpioConfigSpecialFunction(). * * If the GNSS device is external to the cellular module, two additional - * pins must be connected: pin number/GPIO ID 46, pin name "SDIO_CMD", - * must be connected to the GNSS device TIMEPULSE output and pin - * number/GPIO ID 25, pin name "GPIO4", must be conncted to the - * GNSS device EXTINT output. + * pins must be connected: pin number/GPIO ID 46, pin name "SDIO_CMD" + * (or if LEXI-R5 then a pin that the application selects through + * calling uCellGpioConfigSpecialFunction()), must be connected to the + * GNSS device TIMEPULSE output and pin number/GPIO ID 25, pin name "GPIO4", + * (or if LEXI-R5 then pin number/GPIO ID 17, still pin name "GPIO4" but + * for LEXI), must be conncted to the GNSS device EXTINT output. * - * If uCellGpioConfig() had previously been called to use the pins - * in question as user-controllable pins, this will override that - * setting. + * Where the pins are fixed, if uCellGpioConfigSpecialFunction() had previously been + * called to use the pins in question as user-controllable pins, this + * will override that setting. * * If the GNSS device available to the cellular module is already in * use for something else (e.g. used by the GNSS API or by Cell Locate) diff --git a/cell/src/u_cell_cfg.c b/cell/src/u_cell_cfg.c index bf78584e..30fda8d3 100644 --- a/cell/src/u_cell_cfg.c +++ b/cell/src/u_cell_cfg.c @@ -916,7 +916,7 @@ static int32_t setRatSaraRx(uCellPrivateInstance_t *pInstance, uAtClientHandle_t atHandle = pInstance->atHandle; int32_t cFunMode = -1; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { // For SARA-R5 the module has to be in state AT+CFUN=0 cFunMode = uCellPrivateCFunGet(pInstance); if (cFunMode != 0) { @@ -979,7 +979,7 @@ static int32_t setRatRankSaraRx(uCellPrivateInstance_t *pInstance, } } - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { // For SARA-R5 the module has to be in state AT+CFUN=0 cFunMode = uCellPrivateCFunGet(pInstance); if (cFunMode != 0) { diff --git a/cell/src/u_cell_file.c b/cell/src/u_cell_file.c index a1f45395..771e84b7 100644 --- a/cell/src/u_cell_file.c +++ b/cell/src/u_cell_file.c @@ -396,7 +396,7 @@ int32_t uCellFileRead(uDeviceHandle_t cellHandle, } uAtClientCommandStop(atHandle); // Grab the response - if (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // SARA-R4 only puts \n before the // response, not \r\n as it should uAtClientResponseStart(atHandle, "\n+URDFILE:"); @@ -553,7 +553,7 @@ int32_t uCellFileBlockRead(uDeviceHandle_t cellHandle, uAtClientWriteInt(atHandle, (int32_t) dataSize); uAtClientCommandStop(atHandle); // Grab the response - if (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // SARA-R4 only puts \n before the // response, not \r\n as it should uAtClientResponseStart(atHandle, "\n+URDBLOCK:"); diff --git a/cell/src/u_cell_gpio.c b/cell/src/u_cell_gpio.c index 635f248d..a5a021f8 100644 --- a/cell/src/u_cell_gpio.c +++ b/cell/src/u_cell_gpio.c @@ -68,6 +68,24 @@ * STATIC FUNCTIONS * -------------------------------------------------------------- */ +// Configure a GPIO. +static int32_t config(uAtClientHandle_t atHandle, uCellGpioName_t gpioId, + int32_t function, int32_t level) +{ + uAtClientLock(atHandle); + uAtClientCommandStart(atHandle, "AT+UGPIOC="); + // Write GPIO ID + uAtClientWriteInt(atHandle, (int32_t) gpioId); + // Write function + uAtClientWriteInt(atHandle, function); + if (level >= 0) { + // Write initial output value + uAtClientWriteInt(atHandle, level); + } + uAtClientCommandStopReadResponse(atHandle); + return uAtClientUnlock(atHandle); +} + /* ---------------------------------------------------------------- * PUBLIC FUNCTIONS * -------------------------------------------------------------- */ @@ -78,7 +96,6 @@ int32_t uCellGpioConfig(uDeviceHandle_t cellHandle, uCellGpioName_t gpioId, { int32_t errorCode = (int32_t) U_ERROR_COMMON_INVALID_PARAMETER; uCellPrivateInstance_t *pInstance; - uAtClientHandle_t atHandle; if (gUCellPrivateMutex != NULL) { @@ -86,20 +103,32 @@ int32_t uCellGpioConfig(uDeviceHandle_t cellHandle, uCellGpioName_t gpioId, pInstance = pUCellPrivateGetInstance(cellHandle); if ((pInstance != NULL) && ((int32_t) gpioId >= 0)) { - atHandle = pInstance->atHandle; + errorCode = config(pInstance->atHandle, gpioId, + isOutput ? 0 : 1, + isOutput ? level : -1); + } - uAtClientLock(atHandle); - uAtClientCommandStart(atHandle, "AT+UGPIOC="); - // Write GPIO ID. - uAtClientWriteInt(atHandle, (int32_t) gpioId); - // Write GPIO direction. - uAtClientWriteInt(atHandle, isOutput ? 0 : 1); - if (isOutput) { - // Write initial output value - uAtClientWriteInt(atHandle, level); - } - uAtClientCommandStopReadResponse(atHandle); - errorCode = uAtClientUnlock(atHandle); + U_PORT_MUTEX_UNLOCK(gUCellPrivateMutex); + } + + return errorCode; +} + +// Configure a pin of a cellular module to have a special function. +int32_t uCellGpioConfigSpecialFunction(uDeviceHandle_t cellHandle, + uCellGpioName_t gpioId, + uCellGpioSpecialFunction_t specialFunction) +{ + int32_t errorCode = (int32_t) U_ERROR_COMMON_INVALID_PARAMETER; + uCellPrivateInstance_t *pInstance; + + if (gUCellPrivateMutex != NULL) { + + U_PORT_MUTEX_LOCK(gUCellPrivateMutex); + + pInstance = pUCellPrivateGetInstance(cellHandle); + if ((pInstance != NULL) && ((int32_t) gpioId >= 0)) { + errorCode = config(pInstance->atHandle, gpioId, specialFunction, -1); } U_PORT_MUTEX_UNLOCK(gUCellPrivateMutex); diff --git a/cell/src/u_cell_info.c b/cell/src/u_cell_info.c index 9c9e9730..7cb20c1b 100644 --- a/cell/src/u_cell_info.c +++ b/cell/src/u_cell_info.c @@ -761,9 +761,11 @@ int32_t uCellInfoRefreshRadioParameters(uDeviceHandle_t cellHandle) switch (pInstance->pModule->moduleType) { case U_CELL_MODULE_TYPE_SARA_R5: case U_CELL_MODULE_TYPE_SARA_R52: + case U_CELL_MODULE_TYPE_LEXI_R52: errorCode = getRadioParamsUcged2SaraR5(atHandle, pRadioParameters); break; case U_CELL_MODULE_TYPE_SARA_R422: + case U_CELL_MODULE_TYPE_LEXI_R422: errorCode = getRadioParamsUcged2SaraR422(atHandle, pRadioParameters); break; case U_CELL_MODULE_TYPE_LARA_R6: diff --git a/cell/src/u_cell_mqtt.c b/cell/src/u_cell_mqtt.c index 69f60582..a8fe5b72 100644 --- a/cell/src/u_cell_mqtt.c +++ b/cell/src/u_cell_mqtt.c @@ -496,7 +496,7 @@ static void UUMQTTC_UUMQTTSNC_urc(uAtClientHandle_t atHandle, uAtClientReadString(atHandle, (char *) pUrcStatus->topicNameShort, sizeof(pUrcStatus->topicNameShort), false); } - if (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // On SARA-R4, 0 to 2 mean success if ((urcParam1 >= 0) && (urcParam1 <= 2) && (urcParam2 >= 0)) { @@ -803,7 +803,7 @@ static void UUMQTT_urc(uAtClientHandle_t atHandle, // Sort out if this is "+UUMQTTC:"/"+UUMQTTSNC:" // or "+UUMQTTx:" or [SARA-R4 only] "+UUMQTTCM:" if (uAtClientReadBytes(atHandle, bytes, sizeof(bytes), true) == sizeof(bytes)) { - if (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { if (bytes[0] == 'C') { // Either "+UUMQTTC" or "+UUMQTTCM" if (bytes[1] == 'M') { @@ -1983,7 +1983,7 @@ static int32_t readMessage(const uCellPrivateInstance_t *pInstance, U_CELL_PRIVATE_FEATURE_MQTT_SARA_R4_OLD_SYNTAX)) { U_ASSERT(pUrcMessage != NULL); // For the old-style SARA-R4 interface we need a URC capture - U_ASSERT(U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)); + U_ASSERT(U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)); pUrcMessage->messageRead = false; pUrcMessage->pTopicNameStr = pTopicNameStr; pUrcMessage->topicNameSizeBytes = (int32_t) topicNameSizeBytes; @@ -2220,12 +2220,12 @@ int32_t uCellMqttInit(uDeviceHandle_t cellHandle, const char *pBrokerNameStr, pContext->numTries = U_CELL_MQTT_RETRIES_DEFAULT + 1; pContext->mqttSn = mqttSn; pInstance->pMqttContext = pContext; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // SARA-R4 requires a pUrcMessage as well pContext->pUrcMessage = (uCellMqttUrcMessage_t *) pUPortMalloc(sizeof(*(pContext->pUrcMessage))); } if ((pContext->pUrcMessage != NULL) || - !U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + !U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { atHandle = pInstance->atHandle; // Deal with the broker name string // Allocate space to fiddle with the @@ -2525,7 +2525,7 @@ int32_t uCellMqttGetLocalPort(uDeviceHandle_t cellHandle) } } if ((errorCodeOrPort < 0) && - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // SARA-R4 doesn't respond with a port number if the // port number is just the default one. errorCodeOrPort = (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; diff --git a/cell/src/u_cell_mux.c b/cell/src/u_cell_mux.c index d6d3945d..c6a2c36e 100644 --- a/cell/src/u_cell_mux.c +++ b/cell/src/u_cell_mux.c @@ -1079,7 +1079,7 @@ static uint8_t getChannelGnss(const uCellPrivateInstance_t *pInstance) { uint8_t channel = (uint8_t) pInstance->pModule->defaultMuxChannelGnss; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { // For the SARA-R5 case the CMUX channel for GNSS is different // if we are exchanging AT commands on the AUX UART, which is // USIO variant 2. diff --git a/cell/src/u_cell_net.c b/cell/src/u_cell_net.c index 262c1f1d..9b90ec61 100644 --- a/cell/src/u_cell_net.c +++ b/cell/src/u_cell_net.c @@ -1085,7 +1085,7 @@ static int32_t getEmmRejectCause(const uCellPrivateInstance_t *pInstance) bool gotAnEmmCause = false; char buffer[32]; // Enough room for "EMM cause" - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + if (!U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // Return 0 if there's nothing to get errorCodeOrEmmCause = 0; deviceError.type = U_AT_CLIENT_DEVICE_ERROR_TYPE_NO_ERROR; @@ -1524,7 +1524,7 @@ static int32_t setAuthenticationMode(const uCellPrivateInstance_t *pInstance, if ((pUsername == NULL) && (pPassword == NULL)) { // No authentication is required authenticationMode = U_CELL_NET_AUTHENTICATION_MODE_NOT_SET; - if ((U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) || + if ((U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) || (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_SARA_U201) || (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LENA_R8)) { // For SARA-R5, SARA-U201 and LENA-R8 the user name @@ -1546,7 +1546,7 @@ static int32_t setAuthenticationMode(const uCellPrivateInstance_t *pInstance, uAtClientWriteInt(atHandle, contextId); uAtClientWriteInt(atHandle, authenticationMode); if ((pUsername != NULL) && (pPassword != NULL)) { - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) && + if (!U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) && (pInstance->pModule->moduleType != U_CELL_MODULE_TYPE_LARA_R6)) { uAtClientWriteString(atHandle, pUsername, true); uAtClientWriteString(atHandle, pPassword, true); @@ -1678,10 +1678,10 @@ static int32_t activateContext(const uCellPrivateInstance_t *pInstance, ((deviceError.type == U_AT_CLIENT_DEVICE_ERROR_TYPE_NO_ERROR) || (deviceError.type == U_AT_CLIENT_DEVICE_ERROR_TYPE_ERROR)); x--) { cgActCalled = false; - if (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) { + if (U_CELL_PRIVATE_MODULE_IS_R422(pInstance->pModule->moduleType)) { // Note: it seems a bit strange to do this first, // rather than just querying the +CGACT status, - // but a specific case has been found where SARA-R422 + // but a specific case has been found where SARA/LEXI-R422 // indicated that it was activated whereas in fact, // at least for the internal clients (so sockets, HTTP // and MQTT), it was not. Forcing with AT+CGACT=1,x has @@ -2025,7 +2025,7 @@ static int32_t handleExistingContext(uCellPrivateInstance_t *pInstance, // need to do something about it rat = uCellPrivateGetActiveRat(pInstance); if (U_CELL_PRIVATE_RAT_IS_EUTRAN(rat) || - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // If we're on EUTRAN or we're on SARA-R4, // can't/don't go to the "no PDP context" state. // Deregistration will sort it @@ -3050,7 +3050,7 @@ int32_t uCellNetDeactivate(uDeviceHandle_t cellHandle, if (uCellPrivateIsRegistered(pInstance)) { rat = uCellPrivateGetActiveRat(pInstance); if (U_CELL_PRIVATE_RAT_IS_EUTRAN(rat) || - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // Can't not have a PDP context, deregister entirely errorCode = disconnectNetwork(pInstance, pKeepGoingCallback); } else { @@ -3324,7 +3324,7 @@ int32_t uCellNetDeepScan(uDeviceHandle_t cellHandle, pInstance = pUCellPrivateGetInstance(cellHandle); if (pInstance != NULL) { errorCodeOrNumber = (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { // Make sure the radio is on for this cFunMode = uCellPrivateCFunOne(pInstance); atHandle = pInstance->atHandle; diff --git a/cell/src/u_cell_private.c b/cell/src/u_cell_private.c index 10c00648..0f6c4337 100644 --- a/cell/src/u_cell_private.c +++ b/cell/src/u_cell_private.c @@ -415,7 +415,7 @@ const uCellPrivateModule_t gUCellPrivateModuleList[] = { 15, /* AT+CFUN reboot command */ -1, /* PPP PDP context ID */ U_CELL_LOC_GNSS_SYSTEM_TYPES, /* GNSS system types for an attached GNSS chip */ - U_CELL_FILE_NAME_MAX_LENGTH /* Maximum file name length*/ + U_CELL_FILE_NAME_MAX_LENGTH /* Maximum file name length */ }, { U_CELL_MODULE_TYPE_LENA_R8, 2000 /* Pwr On pull ms */, 3100 /* Pwr off pull ms */, @@ -538,6 +538,103 @@ const uCellPrivateModule_t gUCellPrivateModuleList[] = { U_CELL_LOC_GNSS_SYSTEM_TYPES /* GNSS system types for an attached GNSS chip (GPS, SBAS, Galileo and QZSS) */, 63 /* Maximum file name length*/ }, + { + U_CELL_MODULE_TYPE_LEXI_R422, 300 /* Pwr On pull ms */, 2000 /* Pwr off pull ms */, + 5 /* Boot wait */, 30 /* Min awake */, 35 /* Pwr down wait */, 10 /* Reboot wait */, 10 /* AT timeout */, + // Note: "Cmd wait ms" is set to 100 for the other SARA-R4 series modules; + // testing has shown that 20 works for SARA-R422. + 20 /* Cmd wait ms */, 3000 /* Resp max wait ms */, 4 /* radioOffCfun */, 16500 /* resetHoldMilliseconds */, + 3 /* Simultaneous RATs */, + ((1ULL << (int32_t) U_CELL_NET_RAT_GSM_GPRS_EGPRS) | + (1ULL << (int32_t) U_CELL_NET_RAT_CATM1) | + (1ULL << (int32_t) U_CELL_NET_RAT_NB1)) /* RATs */, + ((1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MNO_PROFILE) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CSCON) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_ASYNC_SOCK_CLOSE) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SECURITY_TLS_IANA_NUMBERING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SECURITY_TLS_SERVER_NAME_INDICATION) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_BINARY_PUBLISH) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_WILL) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_KEEP_ALIVE) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_SECURITY) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CONTEXT_MAPPING_REQUIRED) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_FILE_SYSTEM_TAG) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_DEEP_SLEEP_URC) | + // LEXI-R422 _does_ support 3GPP power saving, however the tests fail at the + // moment because a second attempt to enter 3GPP power saving, after waking-up + // from sleep to do something, fails, hence the support is disabled until + // we determine why that is + //(1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_3GPP_POWER_SAVING) | + //(1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_3GPP_POWER_SAVING_PAGING_WINDOW_SET) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_EDRX) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTTSN) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTTSN_SECURITY) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_FOTA) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_UART_POWER_SAVING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CMUX) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CMUX_CHANNEL_CLOSE) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SNR_REPORTED) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_LWM2M) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_UCGED) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_HTTP) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_PPP) /* features */ + ), + 3, /* Default CMUX channel for GNSS */ + 15, /* AT+CFUN reboot command */ + -1, /* PPP PDP context ID */ + U_CELL_LOC_GNSS_SYSTEM_TYPES, /* GNSS system types for an attached GNSS chip */ + U_CELL_FILE_NAME_MAX_LENGTH /* Maximum file name length */ + }, + { + U_CELL_MODULE_TYPE_LEXI_R52, 150 /* Pwr On pull ms */, 2000 /* Pwr off pull ms */, + 6 /* Boot wait */, 10 /* Min awake */, 20 /* Pwr down wait */, 15 /* Reboot wait */, 10 /* AT timeout */, + 20 /* Cmd wait ms */, 3000 /* Resp max wait ms */, 4 /* radioOffCfun */, 150 /* resetHoldMilliseconds */, + 1 /* Simultaneous RATs */, + ((1ULL << (int32_t) U_CELL_NET_RAT_CATM1) | + (1ULL << (int32_t) U_CELL_NET_RAT_NB1)) /* RATs */, + ((1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MNO_PROFILE) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CSCON) | + /* There is no root of trust inside LEXI-R52 */ + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_DATA_COUNTERS) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SECURITY_TLS_IANA_NUMBERING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SECURITY_TLS_CIPHER_LIST) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SECURITY_TLS_SERVER_NAME_INDICATION) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_BINARY_PUBLISH) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_WILL) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_KEEP_ALIVE) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTT_SECURITY) | + /* Context mapping is not required on LEXI-R52 */ + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_AUTO_BAUDING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_AT_PROFILES) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SECURITY_ZTP) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_FILE_SYSTEM_TAG) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_DTR_POWER_SAVING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_DEEP_SLEEP_URC) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_3GPP_POWER_SAVING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_3GPP_POWER_SAVING_PAGING_WINDOW_SET) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_EDRX) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTTSN) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_MQTTSN_SECURITY) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CTS_CONTROL) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SOCK_SET_LOCAL_PORT) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_FOTA) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_UART_POWER_SAVING) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CMUX) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_SNR_REPORTED) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_AUTHENTICATION_MODE_AUTOMATIC) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_LWM2M) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_UCGED) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_HTTP) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_PPP) /* features */ + ), + 4, /* Default CMUX channel for GNSS */ + 16, /* AT+CFUN reboot command */ + -1, /* PPP PDP context ID */ + 0x127, /* GNSS system types for an attached GNSS chip (GPS, SBAS, Galileo and QZSS) */ + U_CELL_FILE_NAME_MAX_LENGTH /* Maximum file name length */ + }, // Add new module types here, before the U_CELL_MODULE_TYPE_ANY entry (since // the uCellModuleType_t value is used as an index into this array). { @@ -1367,7 +1464,7 @@ int32_t uCellPrivateSuspendUartPowerSaving(const uCellPrivateInstance_t *pInstan uAtClientResponseStart(atHandle, "+UPSV:"); *pMode = uAtClientReadInt(atHandle); *pTimeout = -1; - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) && + if (!U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) && ((*pMode == 1) || (*pMode == 4))) { // Only non-SARA-R4 modules have a timeout value and // only for AT+UPSV modes 1 and 4 diff --git a/cell/src/u_cell_private.h b/cell/src/u_cell_private.h index 676e18fd..c4d20c7f 100644 --- a/cell/src/u_cell_private.h +++ b/cell/src/u_cell_private.h @@ -76,14 +76,15 @@ extern "C" { # define U_CELL_PRIVATE_COPS_WAIT_TIME_SECONDS 30 #endif -/** Return true if the given module type is SARA-R4-xx. +/** Return true if the given module type is SARA/LEXI-R4-xx. */ -#define U_CELL_PRIVATE_MODULE_IS_SARA_R4(moduleType) \ +#define U_CELL_PRIVATE_MODULE_IS_R4(moduleType) \ (((moduleType) == U_CELL_MODULE_TYPE_SARA_R410M_02B) || \ ((moduleType) == U_CELL_MODULE_TYPE_SARA_R412M_02B) || \ ((moduleType) == U_CELL_MODULE_TYPE_SARA_R412M_03B) || \ ((moduleType) == U_CELL_MODULE_TYPE_SARA_R410M_03B) || \ - ((moduleType) == U_CELL_MODULE_TYPE_SARA_R422)) + ((moduleType) == U_CELL_MODULE_TYPE_SARA_R422) || \ + ((moduleType) == U_CELL_MODULE_TYPE_LEXI_R422)) /** Return true if the given module type is SARA-R41x-xx. */ @@ -93,11 +94,25 @@ extern "C" { ((moduleType) == U_CELL_MODULE_TYPE_SARA_R412M_03B) || \ ((moduleType) == U_CELL_MODULE_TYPE_SARA_R410M_03B)) -/** Return true if the given module type is SARA-R5xx. +/** Return true if the given module type is SARA/LEXI-R5xx. */ -#define U_CELL_PRIVATE_MODULE_IS_SARA_R5(moduleType) \ - (((moduleType) == U_CELL_MODULE_TYPE_SARA_R5) || \ - ((moduleType) == U_CELL_MODULE_TYPE_SARA_R52)) +#define U_CELL_PRIVATE_MODULE_IS_R5(moduleType) \ + (((moduleType) == U_CELL_MODULE_TYPE_SARA_R5) || \ + ((moduleType) == U_CELL_MODULE_TYPE_SARA_R52) || \ + ((moduleType) == U_CELL_MODULE_TYPE_LEXI_R52)) + +/** Return true if the given module type is SARA/LEXI-R422. + */ +#define U_CELL_PRIVATE_MODULE_IS_R422(moduleType) \ + (((moduleType) == U_CELL_MODULE_TYPE_SARA_R422) || \ + ((moduleType) == U_CELL_MODULE_TYPE_LEXI_R422)) + +/** Return true if the module is LEXI. + */ +#define U_CELL_PRIVATE_MODULE_IS_LEXI(moduleType) \ + (((moduleType) == U_CELL_MODULE_TYPE_LEXI_R10) || \ + ((moduleType) == U_CELL_MODULE_TYPE_LEXI_R422) || \ + ((moduleType) == U_CELL_MODULE_TYPE_LEXI_R52)) /** Return true if the supported RATS bitmap includes LTE. */ diff --git a/cell/src/u_cell_pwr.c b/cell/src/u_cell_pwr.c index 1fd84c79..7feaf55f 100644 --- a/cell/src/u_cell_pwr.c +++ b/cell/src/u_cell_pwr.c @@ -232,7 +232,9 @@ static const char *gpModuleNames[] = {"SARA-U2", "LARA-R6", "LENA-R8", "SARA-R52", - "LEXI-R10" + "LEXI-R10", + "LEXI-R422", + "LEXI-R52" }; /** The PWR_ON pin pulse durations, in milliseconds, to be @@ -938,7 +940,7 @@ static int32_t moduleConfigure(uCellPrivateInstance_t *pInstance, if (success && U_CELL_PRIVATE_HAS(pInstance->pModule, U_CELL_PRIVATE_FEATURE_UCGED) && - (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) || + (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) || (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LARA_R6) || (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LEXI_R10))) { // SARA-R4, LARA-R6, and LEXI-R10 only: switch on the right UCGED mode @@ -1011,7 +1013,7 @@ static int32_t moduleConfigure(uCellPrivateInstance_t *pInstance, } if (uAtClientWakeUpHandlerIsSet(atHandle) && - (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) || + (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) || pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LENA_R8)) { // SARA-R4 doesn't support modes 1, 2 or 3 but // does support the functionality of mode 1 @@ -1093,7 +1095,7 @@ static int32_t moduleConfigure(uCellPrivateInstance_t *pInstance, uCellPrivateSetDeepSleepState(pInstance); } if (success && - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // For SARA-R4, whether the E-DRX URC is on or not does not // survive a restart, so need to set it up again here success = (setEDrxUrc(pInstance) == 0); @@ -2566,7 +2568,7 @@ int32_t uCellPwrSetRequested3gppPowerSaving(uDeviceHandle_t cellHandle, errorCode = (int32_t) U_ERROR_COMMON_SUCCESS; // Before we start... if (onNotOff && - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { + U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType)) { // For SARA-R4, the default value of psm_ver will // cause the module to enter 3GPP sleep even // without the network's agreement. This is not @@ -2604,7 +2606,7 @@ int32_t uCellPwrSetRequested3gppPowerSaving(uDeviceHandle_t cellHandle, activeTimeSeconds, periodicWakeupSeconds); if (errorCode == 0) { - if (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) && + if (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) && ((onNotOff != onNotOffPrevious) || (activeTimeSeconds != activeTimeSecondsPrevious) || (periodicWakeupSeconds != periodicWakeupSecondsPrevious))) { @@ -2847,7 +2849,7 @@ int32_t uCellPwrSetRequestedEDrx(uDeviceHandle_t cellHandle, (!onNotOff || uAtClientWakeUpHandlerIsSet(atHandle))) { // SARA-R4 won't let E-DRX be configured when it is connected errorCode = (int32_t) U_CELL_ERROR_CONNECTED; - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) || + if (!U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) || !uCellPrivateIsRegistered(pInstance)) { errorCode = (int32_t) U_ERROR_COMMON_SUCCESS; // Before we start... @@ -2916,7 +2918,7 @@ int32_t uCellPwrSetRequestedEDrx(uDeviceHandle_t cellHandle, uAtClientCommandStopReadResponse(atHandle); errorCode = uAtClientUnlock(atHandle); if ((errorCode == 0) && - (U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) || + (U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) || pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LEXI_R10)) { pInstance->rebootIsRequired = true; } diff --git a/cell/src/u_cell_sock.c b/cell/src/u_cell_sock.c index 93d7f0f0..8fcb60a6 100644 --- a/cell/src/u_cell_sock.c +++ b/cell/src/u_cell_sock.c @@ -2012,8 +2012,8 @@ int32_t uCellSockGetHostByName(uDeviceHandle_t cellHandle, U_CELL_SOCK_DNS_SHOULD_RETRY_MS) || ((pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LENA_R8) && (tries < 2)))) { - if (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) { - // SARA-R422 can get upset if UDNSRN is sent very quickly + if (U_CELL_PRIVATE_MODULE_IS_R422(pInstance->pModule->moduleType)) { + // LEXI/SARA-R422 can get upset if UDNSRN is sent very quickly // after a connection is made so we add a short delay here while (!uTimeoutExpiredMs(pInstance->connectedAt, U_CELL_SOCK_SARA_R422_DNS_DELAY_MILLISECONDS)) { diff --git a/cell/src/u_cell_time.c b/cell/src/u_cell_time.c index aafb0429..3c059124 100644 --- a/cell/src/u_cell_time.c +++ b/cell/src/u_cell_time.c @@ -66,6 +66,7 @@ #include "u_cell_cfg.h" #include "u_cell_time.h" #include "u_cell_time_private.h" +#include "u_cell_gpio.h" /* ---------------------------------------------------------------- * COMPILE-TIME MACROS @@ -461,7 +462,7 @@ int32_t uCellTimeEnable(uDeviceHandle_t cellHandle, ((mode == U_CELL_TIME_MODE_PULSE) || (mode == U_CELL_TIME_MODE_ONE_SHOT) || (mode == U_CELL_TIME_MODE_EXT_INT_TIMESTAMP))) { errorCode = (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { errorCode = (int32_t) U_ERROR_COMMON_NO_MEMORY; pContext = (uCellTimePrivateContext_t *) pInstance->pCellTimeContext; if (pContext == NULL) { @@ -486,26 +487,35 @@ int32_t uCellTimeEnable(uDeviceHandle_t cellHandle, errorCode = (int32_t) U_ERROR_COMMON_SUCCESS; // If required by the mode, configure the module's GPIOs atHandle = pInstance->atHandle; - if ((mode == U_CELL_TIME_MODE_PULSE) || (mode == U_CELL_TIME_MODE_ONE_SHOT)) { - // GPIO ID 19 ("GPIO6") needs to have special function - // "Time pulse output" (22) - errorCode = gpioConfig(atHandle, 19, 22); - } else if (mode == U_CELL_TIME_MODE_EXT_INT_TIMESTAMP) { - // GPIO ID 33 ("EXT_INT") needs to have special function - // "Time stamp of external interrupt" (23) - errorCode = gpioConfig(atHandle, 33, 23); + if (pInstance->pModule->moduleType != U_CELL_MODULE_TYPE_LEXI_R52) { + if ((mode == U_CELL_TIME_MODE_PULSE) || (mode == U_CELL_TIME_MODE_ONE_SHOT)) { + // For SARA-R5 GPIO ID 19 ("GPIO6") needs to have special function + // "Time pulse output" (22) + errorCode = gpioConfig(atHandle, U_CELL_GPIO_NUMBER_TO_GPIO_ID(6), 22); + } else if (mode == U_CELL_TIME_MODE_EXT_INT_TIMESTAMP) { + // For SARA-R5 GPIO ID 33 ("EXT_INT"), needs to have special function + // "Time stamp of external interrupt" (23) + errorCode = gpioConfig(atHandle, 33, 23); + } } if ((errorCode == 0) && !cellTimeOnly && !uCellPrivateGnssInsideCell(pInstance)) { // If we may use GNSS and the GNSS chip is external // to the cellular module then the pins that provide // timing need to be configured - // GPIO ID 46 ("SDIO_CMD"), special function - // "External GNSS time pulse input" (28) - errorCode = gpioConfig(atHandle, 46, 28); + if (pInstance->pModule->moduleType != U_CELL_MODULE_TYPE_LEXI_R52) { + // For SARA-R5 GPIO ID 46 ("SDIO_CMD"), special function "External + // GNSS time pulse input" (28) + errorCode = gpioConfig(atHandle, 46, 28); + } if (errorCode == 0) { - // GPIO ID 25 ("GPIO4"), special function - // "External GNSS time stamp of external interrupt" (29) - errorCode = gpioConfig(atHandle, 25, 29); + // For SARA-R5 GPIO ID 25 ("GPIO4"), for LEXI-R5 GPIO ID 17 + // (still "GPIO4"), special function "External GNSS time stamp + // of external interrupt" (29) + if (pInstance->pModule->moduleType == U_CELL_MODULE_TYPE_LEXI_R52) { + errorCode = gpioConfig(atHandle, U_CELL_GPIO_NUMBER_TO_GPIO_ID_LEXI(4), 29); + } else { + errorCode = gpioConfig(atHandle, U_CELL_GPIO_NUMBER_TO_GPIO_ID(4), 29); + } } } if (errorCode == 0) { @@ -580,7 +590,7 @@ int32_t uCellTimeDisable(uDeviceHandle_t cellHandle) pInstance = pUCellPrivateGetInstance(cellHandle); if (pInstance != NULL) { errorCode = (int32_t) U_ERROR_COMMON_SUCCESS; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { atHandle = pInstance->atHandle; pContext = (uCellTimePrivateContext_t *) pInstance->pCellTimeContext; if (pContext != NULL) { @@ -642,7 +652,7 @@ int32_t uCellTimeSetCallback(uDeviceHandle_t cellHandle, errorCode = (int32_t) U_ERROR_COMMON_SUCCESS; } else { errorCode = (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { errorCode = (int32_t) U_ERROR_COMMON_NO_MEMORY; if (pContext == NULL) { // This may be called before uCellTimeEnable() so need @@ -699,7 +709,7 @@ int32_t uCellTimeSyncCellEnable(uDeviceHandle_t cellHandle, pInstance = pUCellPrivateGetInstance(cellHandle); if ((pInstance != NULL) && (pCell != NULL)) { errorCode = (int32_t) U_ERROR_COMMON_NOT_SUPPORTED; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { errorCode = (int32_t) U_ERROR_COMMON_NO_MEMORY; pContext = (uCellTimeCellSyncPrivateContext_t *) pInstance->pCellTimeCellSyncContext; if (pContext == NULL) { @@ -783,7 +793,7 @@ int32_t uCellTimeSyncCellDisable(uDeviceHandle_t cellHandle) pInstance = pUCellPrivateGetInstance(cellHandle); if (pInstance != NULL) { errorCode = (int32_t) U_ERROR_COMMON_SUCCESS; - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pInstance->pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pInstance->pModule->moduleType)) { pContext = (uCellTimeCellSyncPrivateContext_t *) pInstance->pCellTimeCellSyncContext; if (pContext != NULL) { atHandle = pInstance->atHandle; diff --git a/cell/test/README.md b/cell/test/README.md index bece19a4..cd463ad3 100644 --- a/cell/test/README.md +++ b/cell/test/README.md @@ -8,7 +8,9 @@ The module FW versions that these tests are run on are as follows: - SARA-R412M-03B: none - no automated testing is performed on SARA-R412M-03B. - SARA-R5: 02.05,A00.01 and 03.15,A00.01. - SARA-R52: 05.10,A00.01. +- LEXI-R52: 05.11.A00.01. - SARA-R422: 00.12,A00.00. +- LEXI-R422: 01.25,A01.06. - LARA-R6: 00.13,A00.01 and 04.19,A00.01. - LENA-R8: 02.00,A01.40. - LEXI-R10: 01.04,A00.01. diff --git a/cell/test/u_cell_cfg_test.c b/cell/test/u_cell_cfg_test.c index 7b9e4ea8..f272984d 100644 --- a/cell/test/u_cell_cfg_test.c +++ b/cell/test/u_cell_cfg_test.c @@ -136,10 +136,14 @@ * VARIABLES * -------------------------------------------------------------- */ +#ifndef U_CELL_CFG_TEST_CELL_DISABLE_MNO_PROFILE + /** Used for keepGoingCallback() timeout. */ static uTimeoutStop_t gTimeoutStop; +#endif + /** The GNSS profile bit map. */ static int32_t gGnssProfileBitMapOriginal = -1; @@ -152,6 +156,8 @@ static uCellTestPrivate_t gHandles = U_CELL_TEST_PRIVATE_DEFAULTS; * STATIC FUNCTIONS * -------------------------------------------------------------- */ +#ifndef U_CELL_CFG_TEST_CELL_DISABLE_MNO_PROFILE + // Callback function for the cellular connection process static bool keepGoingCallback(uDeviceHandle_t unused) { @@ -167,6 +173,8 @@ static bool keepGoingCallback(uDeviceHandle_t unused) return keepGoing; } +#endif + // Read, change and check band mask for the given RAT static void testBandMask(uDeviceHandle_t cellHandle, uCellNetRat_t rat, @@ -224,7 +232,7 @@ static void testBandMask(uDeviceHandle_t cellHandle, #endif U_PORT_TEST_ASSERT(!uCellPwrRebootIsRequired(cellHandle)); // For SARA-R5 we can only read it back if it is the current RAT - if ((!U_CELL_PRIVATE_MODULE_IS_SARA_R5(moduleType)) || + if ((!U_CELL_PRIVATE_MODULE_IS_R5(moduleType)) || (uCellCfgGetRatRank(cellHandle, rat) == 0)) { U_TEST_PRINT_LINE("reading new band mask for %s...", pRatString); @@ -718,6 +726,8 @@ U_PORT_TEST_FUNCTION("[cellCfg]", "cellCfgSetGetRatRank") U_PORT_TEST_ASSERT(resourceCount <= 0); } +#ifndef U_CELL_CFG_TEST_CELL_DISABLE_MNO_PROFILE + /** Test getting/setting MNO profile. */ U_PORT_TEST_FUNCTION("[cellCfg]", "cellCfgGetSetMnoProfile") @@ -772,8 +782,8 @@ U_PORT_TEST_FUNCTION("[cellCfg]", "cellCfgGetSetMnoProfile") mnoProfile = 100; } } else { - if (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) { - // SARA-R422 doesn't support setting MNO profile 0 + if (U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType)) { + // LEXI/SARA-R422 doesn't support setting MNO profile 0 // so in this case use 90 (global) mnoProfile = 90; } else { @@ -823,6 +833,8 @@ U_PORT_TEST_FUNCTION("[cellCfg]", "cellCfgGetSetMnoProfile") U_PORT_TEST_ASSERT(resourceCount <= 0); } +#endif // #ifndef U_CELL_CFG_TEST_CELL_DISABLE_MNO_PROFILE + /** Test UDCONF. */ U_PORT_TEST_FUNCTION("[cellCfg]", "cellCfgUdconf") diff --git a/cell/test/u_cell_gpio_test.c b/cell/test/u_cell_gpio_test.c index 3b5c9dec..beca7636 100644 --- a/cell/test/u_cell_gpio_test.c +++ b/cell/test/u_cell_gpio_test.c @@ -82,11 +82,17 @@ #define U_TEST_PRINT_LINE(format, ...) uPortLog(U_TEST_PREFIX format "\n", ##__VA_ARGS__) #ifndef U_CFG_TEST_GPIO_NAME -/** The GPIO ID to use when testing. +/** The GPIO ID to use when testing, SARA version. */ # define U_CFG_TEST_GPIO_NAME U_CELL_GPIO_NUMBER_TO_GPIO_ID(1) #endif +#ifndef U_CFG_TEST_GPIO_NAME_LEXI +/** The GPIO ID to use when testing, LEXI version. + */ +# define U_CFG_TEST_GPIO_NAME_LEXI U_CELL_GPIO_NUMBER_TO_GPIO_ID_LEXI(1) +#endif + /* ---------------------------------------------------------------- * TYPES * -------------------------------------------------------------- */ @@ -120,6 +126,7 @@ U_PORT_TEST_FUNCTION("[cellGpio]", "cellGpioBasic") int32_t resourceCount; int32_t x; int32_t y; + int32_t gpioName = U_CFG_TEST_GPIO_NAME; // In case a previous test failed uCellTestPrivateCleanup(&gHandles); @@ -138,24 +145,28 @@ U_PORT_TEST_FUNCTION("[cellGpio]", "cellGpioBasic") //lint -esym(613, pInstance) Suppress possible use of NULL pointer // for pInstance from now on + if (U_CELL_PRIVATE_MODULE_IS_LEXI(pInstance->pModule->moduleType)) { + gpioName = U_CFG_TEST_GPIO_NAME_LEXI; + } + U_TEST_PRINT_LINE("setting GPIO ID %d to an output and 1.", - U_CFG_TEST_GPIO_NAME); - U_PORT_TEST_ASSERT(uCellGpioConfig(cellHandle, U_CFG_TEST_GPIO_NAME, + gpioName); + U_PORT_TEST_ASSERT(uCellGpioConfig(cellHandle, (uCellGpioName_t) gpioName, true, 1) == 0); // Allow GPIO reads to be disabled as they don't work on LENA-R8 - x = uCellGpioGet(cellHandle, U_CFG_TEST_GPIO_NAME); - U_TEST_PRINT_LINE("GPIO ID %d is %d.", U_CFG_TEST_GPIO_NAME, x); + x = uCellGpioGet(cellHandle, (uCellGpioName_t) gpioName); + U_TEST_PRINT_LINE("GPIO ID %d is %d.", gpioName, x); U_PORT_TEST_ASSERT(x == 1); - U_TEST_PRINT_LINE("setting GPIO ID %d to 0.", U_CFG_TEST_GPIO_NAME); - U_PORT_TEST_ASSERT(uCellGpioSet(cellHandle, U_CFG_TEST_GPIO_NAME, 0) == 0); - x = uCellGpioGet(cellHandle, U_CFG_TEST_GPIO_NAME); - U_TEST_PRINT_LINE("GPIO ID %d is %d.", U_CFG_TEST_GPIO_NAME, x); + U_TEST_PRINT_LINE("setting GPIO ID %d to 0.", gpioName); + U_PORT_TEST_ASSERT(uCellGpioSet(cellHandle, (uCellGpioName_t) gpioName, 0) == 0); + x = uCellGpioGet(cellHandle, (uCellGpioName_t) gpioName); + U_TEST_PRINT_LINE("GPIO ID %d is %d.", gpioName, x); U_PORT_TEST_ASSERT(x == 0); // For toggling the CTS pin we need to know that it is not // already in use for flow control and this command is also not // supported on SARA-R4, LARA-R6 or LEXI-R10 - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType) && + if (!U_CELL_PRIVATE_MODULE_IS_R4(pInstance->pModule->moduleType) && (pInstance->pModule->moduleType != U_CELL_MODULE_TYPE_LARA_R6) && (pInstance->pModule->moduleType != U_CELL_MODULE_TYPE_LEXI_R10) && !uCellInfoIsCtsFlowControlEnabled(cellHandle)) { diff --git a/cell/test/u_cell_mqtt_test.c b/cell/test/u_cell_mqtt_test.c index 205b98ce..db1d61a4 100644 --- a/cell/test/u_cell_mqtt_test.c +++ b/cell/test/u_cell_mqtt_test.c @@ -244,8 +244,8 @@ U_PORT_TEST_FUNCTION("[cellMqtt]", "cellMqtt") U_PORT_TEST_ASSERT(x == 0); if (U_CELL_PRIVATE_HAS(pModule, U_CELL_PRIVATE_FEATURE_MQTT_SECURITY) && - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pModule->moduleType) && - (pModule->moduleType != U_CELL_MODULE_TYPE_SARA_R422) && + U_CELL_PRIVATE_MODULE_IS_R4(pModule->moduleType) && + !U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType) && (pModule->moduleType != U_CELL_MODULE_TYPE_SARA_R412M_02B)) { // If the module does not permit us to switch off TLS security once it // has been switched on (which is the case for SARA-R10M-02B and @@ -328,8 +328,8 @@ U_PORT_TEST_FUNCTION("[cellMqtt]", "cellMqtt") // Set/get security U_TEST_PRINT_LINE("testing getting/setting security..."); if (uCellMqttIsSecured(cellHandle, NULL)) { - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pModule->moduleType) || - (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422)) { + if (!U_CELL_PRIVATE_MODULE_IS_R4(pModule->moduleType) || + U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType)) { // On SARA-R4 modules (excepting SARA-R422) TLS security cannot // be disabled once it is enabled without power-cycling the module. U_PORT_TEST_ASSERT(uCellMqttSetSecurityOff(cellHandle) == 0); @@ -356,8 +356,8 @@ U_PORT_TEST_FUNCTION("[cellMqtt]", "cellMqtt") } } - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pModule->moduleType) || - (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422)) { + if (!U_CELL_PRIVATE_MODULE_IS_R4(pModule->moduleType) || + U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType)) { // Switch security off again before we continue U_PORT_TEST_ASSERT(uCellMqttSetSecurityOff(cellHandle) == 0); y = uCellMqttIsSecured(cellHandle, &x); @@ -460,7 +460,7 @@ U_PORT_TEST_FUNCTION("[cellMqtt]", "cellMqtt") U_PORT_TEST_ASSERT(uCellNetDisconnect(cellHandle, NULL) == 0); - if (!U_CELL_PRIVATE_MODULE_IS_SARA_R4(pModule->moduleType)) { + if (!U_CELL_PRIVATE_MODULE_IS_R4(pModule->moduleType)) { // Initialise the MQTT client again: this should return // success but do nothing, so the client ID should be // unchanged, even though we have given one. diff --git a/cell/test/u_cell_net_test.c b/cell/test/u_cell_net_test.c index 28009796..e851280b 100644 --- a/cell/test/u_cell_net_test.c +++ b/cell/test/u_cell_net_test.c @@ -765,7 +765,7 @@ U_PORT_TEST_FUNCTION("[cellNet]", "cellNetScanRegActDeact") U_TEST_PRINT_LINE("deactivating context..."); U_PORT_TEST_ASSERT(uCellNetDeactivate(cellHandle, NULL) == 0); if (U_CELL_PRIVATE_RAT_IS_EUTRAN(rat) || - U_CELL_PRIVATE_MODULE_IS_SARA_R4(pModule->moduleType)) { + U_CELL_PRIVATE_MODULE_IS_R4(pModule->moduleType)) { // If we were originally on LTE, or if this is a SARA-R4 // we will now be deregistered, so register again gTimeoutStop.timeoutStart = uTimeoutStart(); diff --git a/cell/test/u_cell_pwr_test.c b/cell/test/u_cell_pwr_test.c index cd39fb4d..b6c196bb 100644 --- a/cell/test/u_cell_pwr_test.c +++ b/cell/test/u_cell_pwr_test.c @@ -1280,8 +1280,8 @@ U_PORT_TEST_FUNCTION("[cellPwr]", "cellPwrSaving3gpp") U_PORT_TEST_ASSERT((rat == U_CELL_NET_RAT_LTE) || (rat == U_CELL_NET_RAT_CATM1) || (rat == U_CELL_NET_RAT_NB1)); - if (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) { - // SARA-R422 does not re-enter 3GPP power saving unless there has been + if (U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType)) { + // LEXI/SARA-R422 does not re-enter 3GPP power saving unless there has been // an RRC connection/disconnection, so do a DNS lookup to stimulate that U_PORT_TEST_ASSERT(uCellSockGetHostByName(cellHandle, U_SOCK_TEST_ECHO_TCP_SERVER_DOMAIN_NAME, @@ -1322,8 +1322,8 @@ U_PORT_TEST_FUNCTION("[cellPwr]", "cellPwrSaving3gpp") U_PORT_TEST_ASSERT((rat == U_CELL_NET_RAT_LTE) || (rat == U_CELL_NET_RAT_CATM1) || (rat == U_CELL_NET_RAT_NB1)); - if (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) { - // SARA-R422 does not re-enter 3GPP power saving unless there has been + if (U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType)) { + // LEXI/SARA-R422 does not re-enter 3GPP power saving unless there has been // an RRC connection/disconnection, so do a DNS lookup to stimulate that U_PORT_TEST_ASSERT(uCellSockGetHostByName(cellHandle, U_SOCK_TEST_ECHO_TCP_SERVER_DOMAIN_NAME, diff --git a/cell/test/u_cell_sec_tls_test.c b/cell/test/u_cell_sec_tls_test.c index 1821ba23..3d09298e 100644 --- a/cell/test/u_cell_sec_tls_test.c +++ b/cell/test/u_cell_sec_tls_test.c @@ -200,8 +200,8 @@ U_PORT_TEST_FUNCTION("[cellSecTls]", "cellSecTlsSettings") U_PORT_TEST_ASSERT((uCellSecTlsVersionGet(pContext) == 0) || (uCellSecTlsVersionGet(pContext) == 12)); // SARA-R5, SARA-R422, LARA-R6 and LEXI-R10 have the default of root CA checking - if ((U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) || - (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) || + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType) || + U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType) || (pModule->moduleType == U_CELL_MODULE_TYPE_LARA_R6) || (pModule->moduleType == U_CELL_MODULE_TYPE_LEXI_R10)) { U_PORT_TEST_ASSERT(uCellSecTlsCertificateCheckGet(pContext, NULL, 0) == @@ -451,12 +451,12 @@ U_PORT_TEST_FUNCTION("[cellSecTls]", "cellSecTlsSettings") } U_TEST_PRINT_LINE("%d cipher(s) found.", y); U_PORT_TEST_ASSERT(y == numCiphers); - // SARA-R5 and SARA-R422 have the default of 1.2 + // SARA/LEXI-R5 and SARA-R422 have the default of 1.2 U_PORT_TEST_ASSERT((uCellSecTlsVersionGet(pContext) == 0) || (uCellSecTlsVersionGet(pContext) == 12)); - // SARA-R5, SARA-R422, LARA-R6 and LEXI-R10 have the default of root CA checking - if ((U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) || - (pModule->moduleType == U_CELL_MODULE_TYPE_SARA_R422) || + // SARA/LEXI-R5, SARA/LEXI-R422, LARA-R6 and LEXI-R10 have the default of root CA checking + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType) || + U_CELL_PRIVATE_MODULE_IS_R422(pModule->moduleType) || (pModule->moduleType == U_CELL_MODULE_TYPE_LARA_R6) || (pModule->moduleType == U_CELL_MODULE_TYPE_LEXI_R10)) { U_PORT_TEST_ASSERT(uCellSecTlsCertificateCheckGet(pContext, NULL, 0) == diff --git a/cell/test/u_cell_sock_test.c b/cell/test/u_cell_sock_test.c index 0e38872b..60e9a906 100644 --- a/cell/test/u_cell_sock_test.c +++ b/cell/test/u_cell_sock_test.c @@ -280,8 +280,9 @@ void changeLinger(void *p) static uCellSockTestOption_t gSupportedOptions[] = { { (1UL << U_CELL_MODULE_TYPE_SARA_R422) | /* Not SARA-R422 or LARA-R6 and on */ - (1UL << U_CELL_MODULE_TYPE_LARA_R6) | /* LENA-R8 the read response is empty */ - (1UL << U_CELL_MODULE_TYPE_LENA_R8), + (1UL << U_CELL_MODULE_TYPE_LEXI_R422) | + (1UL << U_CELL_MODULE_TYPE_LARA_R6) | + (1UL << U_CELL_MODULE_TYPE_LENA_R8), /* LENA-R8 the read response is empty */ U_SOCK_OPT_LEVEL_SOCK, U_SOCK_OPT_REUSEADDR, sizeof(int32_t), compareInt32, changeMod2 }, { @@ -294,6 +295,7 @@ static uCellSockTestOption_t gSupportedOptions[] = { (1UL << U_CELL_MODULE_TYPE_SARA_R412M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R410M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R422) | + (1UL << U_CELL_MODULE_TYPE_LEXI_R422) | (1UL << U_CELL_MODULE_TYPE_LARA_R6) | (1UL << U_CELL_MODULE_TYPE_LENA_R8), U_SOCK_OPT_LEVEL_SOCK, U_SOCK_OPT_BROADCAST, sizeof(int32_t), compareInt32, changeMod2 @@ -304,6 +306,7 @@ static uCellSockTestOption_t gSupportedOptions[] = { (1UL << U_CELL_MODULE_TYPE_SARA_R412M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R410M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R422) | + (1UL << U_CELL_MODULE_TYPE_LEXI_R422) | (1UL << U_CELL_MODULE_TYPE_LENA_R8) | (1UL << U_CELL_MODULE_TYPE_LEXI_R10), U_SOCK_OPT_LEVEL_SOCK, U_SOCK_OPT_REUSEPORT, sizeof(int32_t), compareInt32, changeMod2 @@ -319,8 +322,10 @@ static uCellSockTestOption_t gSupportedOptions[] = { (1UL << U_CELL_MODULE_TYPE_SARA_R412M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R410M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R422) | + (1UL << U_CELL_MODULE_TYPE_LEXI_R422) | (1UL << U_CELL_MODULE_TYPE_SARA_R5) | (1UL << U_CELL_MODULE_TYPE_SARA_R52) | + (1UL << U_CELL_MODULE_TYPE_LEXI_R52) | (1UL << U_CELL_MODULE_TYPE_LARA_R6) | (1UL << U_CELL_MODULE_TYPE_LENA_R8) | (1UL << U_CELL_MODULE_TYPE_LEXI_R10), @@ -345,7 +350,8 @@ static uCellSockTestOption_t gSupportedOptions[] = { (1UL << U_CELL_MODULE_TYPE_SARA_R412M_02B) | (1UL << U_CELL_MODULE_TYPE_SARA_R412M_03B) | (1UL << U_CELL_MODULE_TYPE_SARA_R410M_03B) | - (1UL << U_CELL_MODULE_TYPE_SARA_R422), + (1UL << U_CELL_MODULE_TYPE_SARA_R422) | + (1UL << U_CELL_MODULE_TYPE_LEXI_R422), U_SOCK_OPT_LEVEL_TCP, U_SOCK_OPT_TCP_KEEPIDLE, sizeof(int32_t), compareInt32, changeInt32Positive }, }; diff --git a/cell/test/u_cell_time_test.c b/cell/test/u_cell_time_test.c index d118fd5f..6569c7a2 100644 --- a/cell/test/u_cell_time_test.c +++ b/cell/test/u_cell_time_test.c @@ -409,7 +409,8 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") U_PORT_TEST_ASSERT(uCellTimeEnable(cellHandle, U_CELL_TIME_MODE_BEST_EFFORT, true, 0, NULL, NULL) < 0); - // Now pulse mode, where "GPIO4" of the module should be toggled + // Now pulse mode, where "GPIO4" (pin 19) of a SARA module should be toggled, + // for a LEXI module we choose "GPIO5" (pin 18) since pin 19 doesn't exist there U_TEST_PRINT_LINE("testing CellTime pulse mode..."); gEventCallback = INT_MIN; memset(&gEvent, 0xFF, sizeof(gEvent)); @@ -421,7 +422,7 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") for (size_t x = 0; (y == 0) && !gEvent.synchronised && (x < U_CELL_TIME_TEST_RETRIES + 1); x++) { y = uCellTimeEnable(cellHandle, U_CELL_TIME_MODE_PULSE, true, 0, eventCallback, &gEventCallback); - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { U_PORT_TEST_ASSERT(y == 0); while (!gEvent.synchronised && !uTimeoutExpiredMs(gTimeoutStop.timeoutStart, @@ -433,9 +434,13 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") U_PORT_TEST_ASSERT(gEventCallback == 0); printAndCheckEvent(&gEvent, true); #if defined (U_CFG_TEST_PIN_CELL_GPIO4) && (U_CFG_TEST_PIN_CELL_GPIO4 >= 0) - U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the \"GPIO4\" pin of SARA-R5.", + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the time pulse output pin of the module.", U_CFG_TEST_PIN_CELL_GPIO4); // TODO test that toggling occurred +#elif defined (U_CFG_TEST_PIN_CELL_TIME_PULSE) && (U_CFG_TEST_PIN_CELL_TIME_PULSE >= 0) + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the time pulse output pin of the module.", + U_CFG_TEST_PIN_CELL_TIME_PULSE); + // TODO test that toggling occurred #endif } U_PORT_TEST_ASSERT(uCellTimeDisable(cellHandle) == 0); @@ -460,7 +465,7 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") for (size_t x = 0; (y == 0) && !gEvent.synchronised && (x < U_CELL_TIME_TEST_RETRIES + 1); x++) { y = uCellTimeEnable(cellHandle, U_CELL_TIME_MODE_ONE_SHOT, true, 0, eventCallback, &gEventCallback); - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { U_PORT_TEST_ASSERT(y == 0); while (!gEvent.synchronised && !uTimeoutExpiredMs(gTimeoutStop.timeoutStart, @@ -472,9 +477,13 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") U_PORT_TEST_ASSERT(gEventCallback == 0); printAndCheckEvent(&gEvent, true); #if defined (U_CFG_TEST_PIN_CELL_GPIO4) && (U_CFG_TEST_PIN_CELL_GPIO4 >= 0) - U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the \"GPIO4\" pin of SARA-R5.", + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the time pulse output pin of the module.", U_CFG_TEST_PIN_CELL_GPIO4); // TODO test that toggling occurred +#elif defined (U_CFG_TEST_PIN_CELL_TIME_PULSE) && (U_CFG_TEST_PIN_CELL_TIME_PULSE >= 0) + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the time pulse output pin of the module.", + U_CFG_TEST_PIN_CELL_TIME_PULSE); + // TODO test that toggling occurred #endif } U_PORT_TEST_ASSERT(uCellTimeDisable(cellHandle) == 0); @@ -493,7 +502,7 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") // Give this a few goes as sync can fail randomly for (size_t x = 0; (y == 0) && !gEvent.synchronised && (x < U_CELL_TIME_TEST_RETRIES + 1); x++) { y = uCellTimeSetCallback(cellHandle, timeCallback, &gTimeCallback); - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { U_PORT_TEST_ASSERT(y == 0); gEventCallback = INT_MIN; memset(&gEvent, 0xFF, sizeof(gEvent)); @@ -523,9 +532,13 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") U_PORT_TEST_ASSERT(gTimeCallback == 0); printAndCheckTime(&gTime); #if defined (U_CFG_TEST_PIN_CELL_GPIO4) && (U_CFG_TEST_PIN_CELL_GPIO4 >= 0) - U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the \"GPIO4\" pin of SARA-R5.", + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the time pulse output pin of the module.", U_CFG_TEST_PIN_CELL_GPIO4); // TODO test that toggling occurred +#elif defined (U_CFG_TEST_PIN_CELL_TIME_PULSE) && (U_CFG_TEST_PIN_CELL_TIME_PULSE >= 0) + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the time pulse output pin of the module.", + U_CFG_TEST_PIN_CELL_TIME_PULSE); + // TODO test that toggling occurred #endif } U_PORT_TEST_ASSERT(uCellTimeDisable(cellHandle) == 0); @@ -535,18 +548,18 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") } U_PORT_TEST_ASSERT((y < 0) || (gEvent.synchronised)); - // Remove the time callback: should always work, even for non-SARA-R5 modules + // Remove the time callback: should always work, even for non-R5 modules U_PORT_TEST_ASSERT(uCellTimeSetCallback(cellHandle, NULL, NULL) == 0); #if defined(U_CFG_TEST_PIN_CELL_EXT_INT) && (U_CFG_TEST_PIN_CELL_EXT_INT >= 0) // Add the callback again and test the external-timestamping mode U_TEST_PRINT_LINE("testing CellTime external time-stamp mode..."); - U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the EXT_INT pin of SARA-R5.", + U_TEST_PRINT_LINE("pin %d of this MCU must be connected to the EXT_INT pin of the module.", U_CFG_TEST_PIN_CELL_EXT_INT); gTimeCallback = INT_MIN; memset(&gTime, 0xFF, sizeof(gTime)); y = uCellTimeSetCallback(cellHandle, timeCallback, &gTimeCallback); - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { U_PORT_TEST_ASSERT(y == 0); gEventCallback = INT_MIN; memset(&gEvent, 0xFF, sizeof(gEvent)); @@ -591,7 +604,7 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") // Do a deep scan, first with no callback U_TEST_PRINT_LINE("performing a deep scan, no callback provided."); y = uCellNetDeepScan(cellHandle, NULL, NULL); - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { U_TEST_PRINT_LINE("%d cell(s) found.", y); U_PORT_TEST_ASSERT(y >= 0); } else { @@ -599,7 +612,7 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") U_PORT_TEST_ASSERT(y < 0); } - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { // ...and again with a callback, but abort immediately U_TEST_PRINT_LINE("adding a callback but aborting the deep scan."); gCellInfoCallback = INT_MIN; @@ -611,7 +624,7 @@ U_PORT_TEST_FUNCTION("[cellTime]", "cellTimeBasic") clearCellInfoList(&gpCellInfoList); } - if (U_CELL_PRIVATE_MODULE_IS_SARA_R5(pModule->moduleType)) { + if (U_CELL_PRIVATE_MODULE_IS_R5(pModule->moduleType)) { // Now do it properly U_TEST_PRINT_LINE("performing a deep scan, with a callback and no abort this time with a " "timeout of %d seconds and finding at least one cell.", U_CELL_TIME_TEST_DEEP_SCAN_TIMEOUT_SECONDS); diff --git a/example/security/psk_main.c b/example/security/psk_main.c index 1f3efec2..7605cf63 100644 --- a/example/security/psk_main.c +++ b/example/security/psk_main.c @@ -44,11 +44,12 @@ * -------------------------------------------------------------- */ // For u-blox internal testing only -// Note: SARA-R422 sometimes returns "+CME ERROR: SEC busy" to security +// Note: LEXI/SARA-R422 sometimes returns "+CME ERROR: SEC busy" to security // operations when it has just powered-on, which is the case when we're // running this example during regression testing, hence don't check -// the outcome for SARA-R422. -#if defined(U_PORT_TEST_ASSERT) && (U_CFG_TEST_CELL_MODULE_TYPE != U_CELL_MODULE_TYPE_SARA_R422) +// the outcome for LEXI/SARA-R422. +#if defined(U_PORT_TEST_ASSERT) && (U_CFG_TEST_CELL_MODULE_TYPE != U_CELL_MODULE_TYPE_SARA_R422) && \ + (U_CFG_TEST_CELL_MODULE_TYPE != U_CELL_MODULE_TYPE_LEXI_R422) # define EXAMPLE_FINAL_STATE(x) U_PORT_TEST_ASSERT(x); #else # define EXAMPLE_FINAL_STATE(x) diff --git a/port/platform/common/automation/DATABASE.md b/port/platform/common/automation/DATABASE.md index 6166764e..54b25676 100644 --- a/port/platform/common/automation/DATABASE.md +++ b/port/platform/common/automation/DATABASE.md @@ -50,7 +50,7 @@ The table below defines the instances of test hardware available on the `ubxlib` | 13.1.0| Nordic DK board (NRF52840) + EVK | NRF52840 | nrf52840dk_nrf52840 | Zephyr | | M10 | port at_client ubx_protocol gnss spartn | gnss | U_CFG_APP_GNSS_I2C=1 U_CFG_TEST_PIN_GNSS_RESET_N=29 U_CFG_TEST_UART_B=0 U_DEBUG_UTILS_DUMP_THREADS | | 13.1.1| Nordic DK board (NRF52840) + EVK | NRF52840 | nrf52840dk_nrf52840 | Zephyr | | | port at_client ubx_protocol spartn | short_range | U_CFG_TEST_UART_B=0 U_DEBUG_UTILS_DUMP_THREADS | | 13.1.2| Nordic DK board (NRF52840) + EVK, DT cfg | NRF52840 | ubx_evkninab3_nrf52840 | Zephyr | | | port | | U_CFG_APP_FILTER=zephyrPort. U_CFG_PPP_ENABLE U_CFG_TEST_UART_A=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 | -| 14 | STM32F407 Discovery + EVK, Cat M1 | STM32F4 | | STM32Cube | | SARA_R422 M9 | port device network sock security cell mqtt_client http_client gnss location || CMSIS_V2 U_CFG_TEST_CELL_PWR_DISABLE U_CFG_TEST_GNSS_ASSIST_NOW U_GNSS_MGA_TEST_HAS_FLASH U_LOCATION_TEST_DISABLE U_CFG_1V8_SIM_WORKAROUND HSE_VALUE=8000000U U_CFG_APP_GNSS_SPI=2 U_CFG_APP_PIN_GNSS_SPI_MOSI=0x1F U_CFG_APP_PIN_GNSS_SPI_MISO=0x1E U_CFG_APP_PIN_GNSS_SPI_CLK=0x1D U_CFG_APP_PIN_GNSS_SPI_SELECT=0x1C U_CFG_TEST_PIN_GNSS_RESET_N=0x40 U_CFG_TEST_PIN_C=0x3F U_CFG_APP_GNSS_UART=-1 U_CFG_APP_PIN_GNSS_ENABLE_POWER=-1 U_CFG_TEST_UART_A=-1 U_CFG_APP_PIN_C030_ENABLE_3V3=-1 U_CFG_APP_PIN_CELL_RESET=-1 U_CFG_APP_CELL_UART=3 U_CFG_APP_PIN_CELL_TXD=0x38 U_CFG_APP_PIN_CELL_RXD=0x39 U_CFG_APP_PIN_CELL_RTS=-1 U_CFG_APP_PIN_CELL_CTS=-1 U_DEBUG_UTILS_DUMP_THREADS | +| 14 | STM32F407 Discovery + EVK, Cat M1 | STM32F4 | | STM32Cube | | LEXI_R422 M9 | port device network sock security cell mqtt_client http_client gnss location || CMSIS_V2 U_CELL_CFG_TEST_CELL_DISABLE_MNO_PROFILE U_CFG_TEST_CELL_PWR_DISABLE U_CFG_TEST_GNSS_ASSIST_NOW U_GNSS_MGA_TEST_HAS_FLASH U_LOCATION_TEST_DISABLE U_CFG_1V8_SIM_WORKAROUND HSE_VALUE=8000000U U_CFG_APP_GNSS_SPI=2 U_CFG_APP_PIN_GNSS_SPI_MOSI=0x1F U_CFG_APP_PIN_GNSS_SPI_MISO=0x1E U_CFG_APP_PIN_GNSS_SPI_CLK=0x1D U_CFG_APP_PIN_GNSS_SPI_SELECT=0x1C U_CFG_TEST_PIN_GNSS_RESET_N=0x40 U_CFG_TEST_PIN_C=0x3F U_CFG_APP_GNSS_UART=-1 U_CFG_APP_PIN_GNSS_ENABLE_POWER=-1 U_CFG_TEST_UART_A=-1 U_CFG_APP_PIN_C030_ENABLE_3V3=-1 U_CFG_APP_PIN_CELL_RESET=-1 U_CFG_APP_CELL_UART=3 U_CFG_APP_PIN_CELL_TXD=0x38 U_CFG_APP_PIN_CELL_RXD=0x39 U_CFG_APP_PIN_CELL_RTS=-1 U_CFG_APP_PIN_CELL_CTS=-1 U_DEBUG_UTILS_DUMP_THREADS | | 15.1 | Nordic DK board (NRF52840) + EVK | NRF52840 | nrf52840dk_nrf52840 | Zephyr | | M9 | port device network ble short_range gnss | | U_CFG_TEST_UART_A=-1 U_CFG_APP_GNSS_SPI=3 U_CFG_APP_PIN_GNSS_SPI_SELECT=29 U_CFG_TEST_PIN_GNSS_RESET_N=37 U_GNSS_MGA_TEST_HAS_FLASH U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_DEBUG_UTILS_DUMP_THREADS | | 16 | STM32F407 Discovery | STM32F4 | | STM32Cube | | M10 | port ubx_protocol gnss spartn geofence | gnss | U_CFG_GEOFENCE HSE_VALUE=8000000U U_PORT_TEST_DISABLE_I2C U_GNSS_MGA_TEST_DISABLE_DATABASE U_CFG_APP_GNSS_I2C=1 U_CFG_TEST_PIN_GNSS_RESET_N=0x40 U_CFG_APP_GNSS_UART=-1 U_CFG_APP_PIN_GNSS_ENABLE_POWER=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_CFG_APP_PIN_C030_ENABLE_3V3=-1 U_CFG_APP_PIN_CELL_RESET=-1 U_DEBUG_UTILS_DUMP_THREADS | | 17.1.0| Nordic NRF5340 DK board | NRF5340 | nrf5340dk_nrf5340_cpuapp | Zephyr | | M9 | port device network ble short_range lib_common ubx_protocol gnss spartn || U_CFG_APP_GNSS_SPI=2 U_CFG_APP_SPI_MAX_SEGMENT_SIZE=32 U_CFG_APP_PIN_GNSS_SPI_SELECT=46 U_CFG_TEST_PIN_GNSS_RESET_N=37 U_GNSS_MGA_TEST_HAS_FLASH U_CFG_BLE_MODULE_INTERNAL U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_BLE_TEST_CFG_REMOTE_SPS_PERIPHERAL=2462ABB6EAC6p U_CFG_APP_SHORT_RANGE_ROLE=1 U_DEBUG_UTILS_DUMP_THREADS | @@ -69,7 +69,7 @@ The table below defines the instances of test hardware available on the `ubxlib` | 27 | ESP32S3-DevKitC | ESP32S3 | | ESP-IDF | | M9 | port ubx_protocol gnss spartn | | U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_CFG_APP_GNSS_I2C=0 U_CFG_TEST_PIN_GNSS_RESET_N=40 U_GNSS_MGA_TEST_ASSIST_NOW_AUTONOMOUS_NOT_SUPPORTED U_CFG_TEST_PIN_A=1 U_CFG_TEST_PIN_B=9 U_CFG_TEST_PIN_C=38 U_CFG_TEST_PIN_UART_A_CTS=11 U_CFG_TEST_PIN_UART_A_RTS=47 U_CFG_TEST_PIN_UART_A_RXD=10 U_CFG_TEST_PIN_UART_A_TXD=48 U_CFG_APP_PIN_GNSS_SDA=18 U_CFG_APP_PIN_GNSS_SCL=17 U_CFG_MUTEX_DEBUG U_DEBUG_UTILS_DUMP_THREADS | | 28 | Linux + EVK, Cat M1, uConnect | LINUX64 | | Linux | | SARA_R5 M9 NINA_W15 | port device network sock ble wifi cell short_range security mqtt_client http_client ubx_protocol gnss spartn location geofence |cell short_range gnss geodesic | U_CFG_PPP_ENABLE U_CFG_GEOFENCE U_CFG_HEAP_MONITOR U_ASSERT_HOOK_FUNCTION_TEST_RETURN U_CFG_TEST_USE_VALGRIND U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CFG_APP_UART_PREFIX=/dev/ttyAMA U_CFG_APP_CELL_UART=0 U_CFG_APP_PIN_CELL_PWR_ON=25 U_CELL_PWR_ON_PIN_DRIVE_MODE=U_PORT_GPIO_DRIVE_MODE_NORMAL U_CFG_APP_SHORT_RANGE_UART=1 U_CFG_APP_PIN_SHORT_RANGE_RESET_TO_DEFAULTS=26 U_CFG_APP_PIN_SHORT_RANGE_CTS=0 U_CFG_APP_PIN_SHORT_RANGE_RTS=0 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_CFG_TEST_GNSS_SPI_SELECT_INDEX=0 U_CFG_APP_GNSS_SPI=0 U_CFG_APP_GNSS_I2C=8 U_CFG_TEST_PIN_GNSS_RESET_N=19 U_GNSS_MGA_TEST_HAS_FLASH U_CFG_TEST_UART_PREFIX=/tmp/ttyv U_CFG_TEST_UART_A=0 U_CFG_TEST_UART_B=1 U_AT_CLIENT_TEST_AT_TIMEOUT_TOLERANCE_MS=1000 U_CFG_TEST_PIN_A=17 U_CFG_TEST_PIN_B=27 U_CFG_TEST_PIN_C=22 U_CFG_MUTEX_DEBUG | | 29 | HPG C214 board (NINA-W1), live network | ESP32 | | ESP-IDF | | LENA_R8 M9 | port device network sock cell security mqtt_client gnss location || U_CFG_PPP_ENABLE U_HTTP_CLIENT_DISABLE_TEST U_CELL_GPIO_DISABLE_TEST U_MQTT_CLIENT_TEST_NO_NULL_SEND U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_GNSS_MGA_TEST_ASSIST_NOW_AUTONOMOUS_NOT_SUPPORTED U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CFG_MONITOR_DTR_RTS_OFF U_CELL_TEST_NO_INVALID_APN U_CELL_TEST_CFG_BANDMASK1=0x0000000000080084ULL U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_LTE U_CFG_APP_PIN_CELL_ENABLE_POWER=-1 U_CFG_APP_PIN_CELL_PWR_ON=0x801a U_CFG_APP_PIN_CELL_RESET=33 U_CELL_RESET_PIN_DRIVE_MODE=U_PORT_GPIO_DRIVE_MODE_NORMAL U_CFG_APP_PIN_CELL_VINT=0x8025 U_CFG_APP_PIN_CELL_DTR=15 U_CFG_APP_PIN_CELL_TXD=25 U_CFG_APP_PIN_CELL_RXD=34 U_CFG_APP_PIN_CELL_RTS=27 U_CFG_APP_PIN_CELL_CTS=36 U_CFG_APP_GNSS_I2C=0 U_GNSS_TEST_I2C_ADDRESS_EXTRA=0x43 U_CFG_APP_CELL_PIN_GNSS_POWER=-1 U_CFG_APP_CELL_PIN_GNSS_DATA_READY=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS | -| 30 | STM32F407 Discovery, NORA-W3, SARA-R520 EVK| STM32F4 | | STM32Cube | | SARA_R52 M10 NORA_W36 | port device network sock cell ble wifi short_range gnss security mqtt_client http_client location | cell gnss short_range short_range_gen2 | CMSIS_V2 HSE_VALUE=8000000U U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_CFG_APP_GNSS_UART=-1 U_CFG_LOC_TEST_CHANGE_SYSTEM_TYPES_DISABLE U_CFG_APP_PIN_C030_ENABLE_3V3=-1 U_CFG_APP_PIN_CELL_RESET=-1 U_CFG_APP_CELL_UART=2 U_CFG_APP_PIN_CELL_TXD=0x03 U_CFG_APP_PIN_CELL_RXD=0x02 U_CFG_APP_PIN_CELL_RTS=-1 U_CFG_APP_PIN_CELL_CTS=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_BLE_TEST_CFG_REMOTE_SPS_PERIPHERAL=2462ABB6EAC6p U_CFG_APP_SHORT_RANGE_ROLE=3 U_CFG_APP_SHORT_RANGE_UART2=6 U_CFG_APP_PIN_SHORT_RANGE_TXD2=0x26 U_CFG_APP_PIN_SHORT_RANGE_RXD2=0x27 U_DEBUG_UTILS_DUMP_THREADS U_CFG_TEST_GNSS_TRANSPORT_AT_DISABLE | +| 30 | STM32F407 Discovery, NORA-W3, SARA-R520 EVK| STM32F4 | | STM32Cube | | LEXI_R52 NORA_W36 | port device network sock cell ble wifi short_range security mqtt_client http_client location | cell gnss short_range short_range_gen2 | CMSIS_V2 HSE_VALUE=8000000U U_CFG_LOC_TEST_CHANGE_SYSTEM_TYPES_DISABLE U_CFG_APP_PIN_C030_ENABLE_3V3=-1 U_CFG_APP_PIN_CELL_RESET=-1 U_CFG_APP_CELL_UART=2 U_CFG_APP_PIN_CELL_TXD=0x03 U_CFG_APP_PIN_CELL_RXD=0x02 U_CFG_APP_PIN_CELL_RTS=-1 U_CFG_APP_PIN_CELL_CTS=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_TEST_UART_A=-1 U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_BLE_TEST_CFG_REMOTE_SPS_PERIPHERAL=2462ABB6EAC6p U_CFG_APP_SHORT_RANGE_ROLE=3 U_CFG_APP_SHORT_RANGE_UART2=6 U_CFG_APP_PIN_SHORT_RANGE_TXD2=0x26 U_CFG_APP_PIN_SHORT_RANGE_RXD2=0x27 U_DEBUG_UTILS_DUMP_THREADS | | 31 | STM32F7, Nucleo-F767ZI, LARA-R6, live net | STM32 | nucleo_f767zi | Zephyr | | LARA_R6 | port device network sock cell security mqtt_client http_client location || U_ZEPHYR_PORT_UART_ASYNC U_CFG_TEST_DISABLE_MUX U_CFG_TEST_CELL_PWR_DISABLE U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CELL_TEST_CFG_BANDMASK1=0x0000000000080084ULL U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_LTE U_CELL_TEST_CFG_MNO_PROFILE=90 U_DEBUG_UTILS_DUMP_THREADS | | 32 | STM32U5, Nucleo-U575ZI-q | STM32 | nucleo_u575zi_q | Zephyr | | SARA_U201 M9 ODIN_W2 | port device network sock cell ble wifi short_range gnss security http_client location ubx_protocol spartn || U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CELL_NET_TEST_RAT=U_CELL_NET_RAT_GSM_GPRS_EGPRS U_CELL_TEST_CFG_APN=iot.1nce.net U_CELL_CFG_APN_DEFAULT=iot.1nce.net U_CFG_TEST_TRANSPORT_SECURITY_DISABLE U_CELL_CFG_TEST_USE_FIXED_TIME_SECONDS U_CELL_TEST_NO_INVALID_APN U_CFG_CELL_DISABLE_UART_POWER_SAVING U_CFG_APP_GNSS_I2C=1 U_CFG_APP_I2C_MAX_SEGMENT_SIZE=255 U_GNSS_MGA_TEST_HAS_FLASH U_CFG_TEST_GNSS_POWER_SAVING_NOT_SUPPORTED U_GNSS_MGA_TEST_ASSIST_NOW_AUTONOMOUS_NOT_SUPPORTED U_CFG_TEST_PIN_GNSS_RESET_N=0x5D U_CFG_APP_SHORT_RANGE_UART=3 U_CFG_TEST_BLE_DISABLE_SPS U_CFG_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS | | 33 | ESP32-DevKitC + EVK, live network | ESP32 | | ESP-IDF | | LEXI_R10 | port device network sock cell security mqtt_client http_client || U_CFG_TEST_UART_A=-1 U_CFG_TEST_PIN_A=-1 U_CFG_TEST_PIN_B=-1 U_CFG_TEST_PIN_C=-1 U_CFG_APP_PIN_CELL_VINT=-1 U_CFG_APP_PIN_CELL_ENABLE_POWER=-1 U_CFG_APP_CELL_PIN_GNSS_POWER=-1 U_CFG_APP_CELL_PIN_GNSS_DATA_READY=-1 U_CELL_TEST_CFG_BANDMASK1=0x80800d5ULL U_CELL_TEST_CFG_ALT_BANDMASK1=0x10ULL U_CELL_PWR_GNSS_PROFILE_BITS_EXTRA=-1 U_CFG_LOC_TEST_CHANGE_SYSTEM_TYPES_DISABLE U_CELL_MUX_ENABLE_DEBUG U_CELL_MUX_ENABLE_USER_TX_DEBUG U_CELL_MUX_ENABLE_USER_RX_DEBUG U_CELL_MUX_HEX_DEBUG U_DEBUG_UTILS_DUMP_THREADS U_CELL_TEST_CFG_MNO_PROFILE=90 U_CELL_TEST_NO_INVALID_APN U_HTTP_CLIENT_TEST_MAX_NUM=1 U_HTTP_SHORT_RANGE_CLIENT_TEST_MAX_NUM=2 | diff --git a/port/platform/zephyr/dts/bindings/u-blox,ubxlib-device-cellular.yaml b/port/platform/zephyr/dts/bindings/u-blox,ubxlib-device-cellular.yaml index 0d0d8b2e..98a5c4a9 100644 --- a/port/platform/zephyr/dts/bindings/u-blox,ubxlib-device-cellular.yaml +++ b/port/platform/zephyr/dts/bindings/u-blox,ubxlib-device-cellular.yaml @@ -34,6 +34,8 @@ properties: - "U_CELL_MODULE_TYPE_LENA_R8" - "U_CELL_MODULE_TYPE_SARA_R52" - "U_CELL_MODULE_TYPE_LEXI_R10" + - "U_CELL_MODULE_TYPE_LEXI_R422" + - "U_CELL_MODULE_TYPE_LEXI_R52" # Add any new module types here, before U_CELL_MODULE_TYPE_ANY - "U_CELL_MODULE_TYPE_ANY" # pinEnablePower