diff --git a/cell/api/u_cell_cfg.h b/cell/api/u_cell_cfg.h index cc0ff406..2289c1f0 100644 --- a/cell/api/u_cell_cfg.h +++ b/cell/api/u_cell_cfg.h @@ -378,17 +378,17 @@ int32_t uCellCfgGetUdconf(uDeviceHandle_t cellHandle, int32_t param1, * * @param cellHandle the handle of the cellular instance. * @param fsRestoreType the file system factory restore type. Valid options - * are 0, 1 and 2. - * 0: no factory restore. - * 1: Check datasheet, if this option is - * supported by your module. + * are 0, 1 and 2: + * 0: no factory restore, + * 1: check AT interface manual to see if this + * option is supported by your module, * 2: all files stored in FS deleted. * @param nvmRestoreType the file system factory restore type. Valid options - * are 0, 1 and 2. - * 0: no factory restore. - * 1: NVM flash sectors erased. - * 2: Check datasheet, if this option is - * supported by your module. + * are 0, 1 and 2: + * 0: no factory restore, + * 1: NVM flash sectors erased, + * 2: check AT interface manual to see if this + * option is supported by your module. * @return zero on success or negative error code on * failure. */ @@ -406,6 +406,9 @@ int32_t uCellCfgFactoryReset(uDeviceHandle_t cellHandle, int32_t fsRestoreType, * with a call to uCellCfgSetAutoBaudOff() in the case of SARA-R5 * and SARA-U201. * + * Note: DTR must be low in order for a greeting message to be + * emitted. + * * @param cellHandle the handle of the cellular instance. * @param[in] pStr the null-terminated greeting message; use NULL * to remove an existing greeting message. @@ -423,6 +426,9 @@ int32_t uCellCfgSetGreeting(uDeviceHandle_t cellHandle, const char *pStr); * pin has been set using uCellPwrSetDtrPowerSavingPin()) then the * greeting message is NOT emitted by the module at a reboot. * + * Note: DTR must be low in order for a greeting message to be + * emitted. + * * Obviously for this to be useful it is important that the greeting * message is unique; you may consider using #U_CELL_CFG_GREETING. * diff --git a/cell/api/u_cell_net.h b/cell/api/u_cell_net.h index 6f3ca03d..269bfe3f 100644 --- a/cell/api/u_cell_net.h +++ b/cell/api/u_cell_net.h @@ -770,6 +770,9 @@ uCellNetStatus_t uCellNetGetNetworkStatus(uDeviceHandle_t cellHandle, * service then this function will likely return the reason for * that denial (e.g. 11 for "PLMN not allowed"), rather than zero. * + * Note: SARA-U201 always returns error 148, "SM activation error", + * even after a connection has succeeded. + * * @param cellHandle the handle of the cellular instance. * @return on success the last EMM cause from the network, * see appendix A.3 of the AT commands manual, diff --git a/cell/src/u_cell_apn_db.h b/cell/src/u_cell_apn_db.h index 64eca521..6dbbf629 100644 --- a/cell/src/u_cell_apn_db.h +++ b/cell/src/u_cell_apn_db.h @@ -42,6 +42,12 @@ extern "C" { * COMPILE-TIME MACROS * -------------------------------------------------------------- */ +#ifndef U_CELL_CFG_APN_DEFAULT +/** A default APN to be applied when none is specified. + */ +# define U_CELL_CFG_APN_DEFAULT internet +#endif + /** Helper to generate the APN string. */ //lint -emacro((786), _APN) Suppress use of null @@ -71,7 +77,7 @@ typedef struct { /** Default APN settings used by many networks. */ -static const char *const pApnDefault = _APN("internet",,); +static const char *const pApnDefault = _APN(U_PORT_STRINGIFY_QUOTED(U_CELL_CFG_APN_DEFAULT),,); /** List of special APNs for different network operators. * diff --git a/cell/src/u_cell_cfg.c b/cell/src/u_cell_cfg.c index 3f6a4f61..901e3795 100644 --- a/cell/src/u_cell_cfg.c +++ b/cell/src/u_cell_cfg.c @@ -481,7 +481,7 @@ static int32_t getRatRankSaraU2(uCellPrivateInstance_t *pInstance, errorCodeOrRank = (int32_t) U_CELL_ERROR_NOT_FOUND; // If the first mode is 1, dual mode, then there MUST be a second // number which indicates the preference - // If the RAT being asked for is 2G or 3G then if it in this + // If the RAT being asked for is 2G or 3G then if it is in this // second number it is at rank 0, else it must by implication // be at rank 1 if ((rat == U_CELL_NET_RAT_GSM_GPRS_EGPRS) || (rat == U_CELL_NET_RAT_UTRAN)) { @@ -583,30 +583,47 @@ static int32_t setRatRankSaraU2(uCellPrivateInstance_t *pInstance, if ((modes[0] >= 0) && (modes[1] >= 0)) { // ...and we already have dual mode... if (rank == 0) { - // ...and we are setting the first rank, - // then set the preference in the second number - modes[1] = cellRatToModuleRat(pInstance->pModule->moduleType, rat); - validOperation = true; - } else if (rank == 1) { - // ...otherwise if we are setting the second - // rank then we want to set the OPPOSITE of - // the desired RAT in the second number. - // In other words, to put 2G at rank 1, we - // need to set 3G as our preferred RAT. - if (rat == U_CELL_NET_RAT_GSM_GPRS_EGPRS) { - modes[1] = cellRatToModuleRat(pInstance->pModule->moduleType, - U_CELL_NET_RAT_UTRAN); + // ...and we are setting the top rank... + if (rat != uCellPrivateModuleRatToCellRat(pInstance->pModule->moduleType, modes[1])) { + // ...then if we are setting the RAT to the + // same as the current dual-mode non-preferred + // RAT, switch to single-mode and that RAT. + modes[0] = cellRatToModuleRat(pInstance->pModule->moduleType, rat); + modes[1] = -1; validOperation = true; - } else if (rat == U_CELL_NET_RAT_UTRAN) { - modes[1] = cellRatToModuleRat(pInstance->pModule->moduleType, - U_CELL_NET_RAT_GSM_GPRS_EGPRS); + } else { + // ...else leave things as they are. + validOperation = true; + } + } else if (rank == 1) { + // ...and we are setting the second rank... + if (rat == uCellPrivateModuleRatToCellRat(pInstance->pModule->moduleType, modes[1])) { + // ...and the RAT we are setting is also the first rank, + // then switch to single mode with that RAT. + modes[0] = cellRatToModuleRat(pInstance->pModule->moduleType, rat); + modes[1] = -1; validOperation = true; + } else { + // ...otherwise if we are setting the second + // rank then we want to set the OPPOSITE of + // the desired RAT in the preferred RAT position. + // In other words, to put 2G in second rank, we + // need to set 3G as our preferred RAT. + if (rat == U_CELL_NET_RAT_GSM_GPRS_EGPRS) { + modes[1] = cellRatToModuleRat(pInstance->pModule->moduleType, + U_CELL_NET_RAT_UTRAN); + validOperation = true; + } else if (rat == U_CELL_NET_RAT_UTRAN) { + modes[1] = cellRatToModuleRat(pInstance->pModule->moduleType, + U_CELL_NET_RAT_GSM_GPRS_EGPRS); + validOperation = true; + } } } } else if ((modes[0] >= 0) && (modes[1] < 0)) { // ...and we are in single mode... if (rank == 0) { - // ...then if we are setting rank 0 just set it + // ...then if we are setting rank 0 just set it. modes[0] = cellRatToModuleRat(pInstance->pModule->moduleType, rat); validOperation = true; } else if (rank == 1) { @@ -628,7 +645,7 @@ static int32_t setRatRankSaraU2(uCellPrivateInstance_t *pInstance, validOperation = true; } } else { - // ...else leave things as they are + // ...else leave things as they are. validOperation = true; } } @@ -642,7 +659,7 @@ static int32_t setRatRankSaraU2(uCellPrivateInstance_t *pInstance, // If are removing the top-most rank // then we set the single mode to be // the opposite of the currently - // preferred RAT + // preferred RAT. if (uCellPrivateModuleRatToCellRat(pInstance->pModule->moduleType, modes[1]) == U_CELL_NET_RAT_GSM_GPRS_EGPRS) { modes[0] = cellRatToModuleRat(pInstance->pModule->moduleType, diff --git a/cell/src/u_cell_net.c b/cell/src/u_cell_net.c index 9692fc6d..2f1c87c2 100644 --- a/cell/src/u_cell_net.c +++ b/cell/src/u_cell_net.c @@ -875,9 +875,9 @@ static int32_t setAutomaticMode(const uCellPrivateInstance_t *pInstance) // has actually accepted the command, // despite what it says uAtClientLock(atHandle); - uAtClientTimeoutSet(atHandle, 1000); uAtClientCommandStart(atHandle, "AT+COPS=0"); uAtClientCommandStop(atHandle); + uAtClientTimeoutSet(atHandle, 1000); x = -1; while ((x != 0) && keepGoingLocalCb(pInstance) && (deviceError.type == @@ -935,7 +935,7 @@ static int32_t storeNextScanItem(uCellPrivateInstance_t *pInstance, // (,,,[,] // However, there can be gunk on the end of the AT+COPS=? // response string, for instance the "test" response: - // ,(0-6),(0-2) + // ,,(0-6),(0-2) // ...may appear there, so check for errors; // the and fields must be present, the // rest could be absent or zero length strings. @@ -2968,10 +2968,10 @@ int32_t uCellNetScanGetFirst(uDeviceHandle_t cellHandle, // "test" response to the AT+COPS=? command, // i.e.: +COPS: ,,(0-6),(0-2) // If we get the "test" response instead - // readBytes will be 12 whereas for the + // readBytes will be 13 whereas for the // intended response of: // (,,,[,]) - // it will be at longer than that hence we set + // it will be longer than that hence we set // a threshold for readBytes of > 12 characters. pInstance->startTimeMs = uPortGetTickTimeMs(); for (size_t x = U_CELL_NET_SCAN_RETRIES + 1; @@ -3026,7 +3026,7 @@ int32_t uCellNetScanGetFirst(uDeviceHandle_t cellHandle, // "test" response or a device error gotAnswer = true; } - if (bytesRead > 12) { + if (bytesRead > 13) { // Got a real answer: process it in // chunks delimited by ")" for (pStr = strtok_r(pBuffer, ")", &pSaved); diff --git a/cell/src/u_cell_ppp.c b/cell/src/u_cell_ppp.c index 38036de8..8aa6f31e 100644 --- a/cell/src/u_cell_ppp.c +++ b/cell/src/u_cell_ppp.c @@ -312,6 +312,9 @@ static void closePpp(uCellPrivateInstance_t *pInstance, // and it was us who started it uCellMuxPrivateDisable(pInstance); } + // Some modules (e.g. SARA-U201) need a little rest just here + // or the next AT command may stall + uPortTaskBlock(250); // Re-enable UART sleep if we had switched it off if (pContext->uartSleepWakeOnDataWasEnabled) { uCellPwrPrivateEnableUartSleep(pInstance); diff --git a/cell/src/u_cell_private.c b/cell/src/u_cell_private.c index 29d38511..0108e683 100644 --- a/cell/src/u_cell_private.c +++ b/cell/src/u_cell_private.c @@ -113,12 +113,11 @@ const uCellPrivateModule_t gUCellPrivateModuleList[] = { (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_UART_POWER_SAVING) | - // CMUX is supported here but we do not test it hence it is not marked as supported + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_CMUX) | (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_UCGED) | (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_AUTHENTICATION_MODE_AUTOMATIC) | - (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_HTTP) /* features */ - // PPP is supported by the module but we do not test its integration with - // ubxlib and hence it is not marked as supported + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_HTTP) | + (1ULL << (int32_t) U_CELL_PRIVATE_FEATURE_PPP) /* features */ ), 6, /* Default CMUX channel for GNSS */ 15 /* AT+CFUN reboot command */ diff --git a/cell/src/u_cell_pwr.c b/cell/src/u_cell_pwr.c index ec9e2c84..cb884eeb 100644 --- a/cell/src/u_cell_pwr.c +++ b/cell/src/u_cell_pwr.c @@ -1063,12 +1063,15 @@ static int32_t moduleConfigure(uCellPrivateInstance_t *pInstance, UUPSMR_urc, pInstance); } } - // Update the sleep parameters; note that we ask for the - // requested 3GPP power saving state here, rather than the - // assigned, since it might not be assigned by the network - // at this point but can come along later - uCellPwrPrivateGet3gppPowerSaving(pInstance, false, NULL, NULL, NULL); - uCellPrivateSetDeepSleepState(pInstance); + if (U_CELL_PRIVATE_HAS(pInstance->pModule, + U_CELL_PRIVATE_FEATURE_3GPP_POWER_SAVING)) { + // Update the sleep parameters; note that we ask for the + // requested 3GPP power saving state here, rather than the + // assigned, since it might not be assigned by the network + // at this point but can come along later + uCellPwrPrivateGet3gppPowerSaving(pInstance, false, NULL, NULL, NULL); + uCellPrivateSetDeepSleepState(pInstance); + } if (success && U_CELL_PRIVATE_MODULE_IS_SARA_R4(pInstance->pModule->moduleType)) { // For SARA-R4, whether the E-DRX URC is on or not does not diff --git a/cell/test/README.md b/cell/test/README.md index 93d42260..116372fa 100644 --- a/cell/test/README.md +++ b/cell/test/README.md @@ -1,7 +1,7 @@ # Module FW Versions The module FW versions that these tests are run on are as follows: -- SARA-U201: none - no automated testing is performed on SARA-U201. +- SARA-U201: 23.60,A01.06. - SARA-R410M-02B: M0.11.01,A.02.17. - SARA-R410M-03B: none - no automated testing is performed on SARA-R410M-03B. - SARA-R412M-02B: M0.11.01,A.02.17. diff --git a/common/security/test/u_security_tls_test.c b/common/security/test/u_security_tls_test.c index 363b10a6..f20933c8 100644 --- a/common/security/test/u_security_tls_test.c +++ b/common/security/test/u_security_tls_test.c @@ -22,9 +22,11 @@ /** @file * @brief Test for the u-blox TLS security API: these should pass on all - * platforms. + * platforms that support transport security. */ +#ifndef U_CFG_TEST_TRANSPORT_SECURITY_DISABLE + #ifdef U_CFG_OVERRIDE # include "u_cfg_override.h" // For a customer's configuration override #endif @@ -695,4 +697,6 @@ U_PORT_TEST_FUNCTION("[securityTls]", "securityTlsCleanUp") uTestUtilResourceCheck(U_TEST_PREFIX, NULL, true); } +#endif // #ifndef U_CFG_TEST_TRANSPORT_SECURITY_DISABLE + // End of file diff --git a/example/sockets/main_dtls.c b/example/sockets/main_dtls.c index 5a93ea18..9667656c 100644 --- a/example/sockets/main_dtls.c +++ b/example/sockets/main_dtls.c @@ -82,7 +82,7 @@ // for the module is likely different to that of the MCU: check // the data sheet for the module to determine the mapping. -#ifdef U_CFG_TEST_CELL_MODULE_TYPE +#if defined(U_CFG_TEST_CELL_MODULE_TYPE) && !defined(U_CFG_TEST_TRANSPORT_SECURITY_DISABLE) // DEVICE i.e. module/chip configuration: in this case a cellular // module connected via UART static const uDeviceCfg_t gDeviceCfg = { @@ -422,7 +422,7 @@ U_PORT_TEST_FUNCTION("[example]", "exampleSocketsDtls") uPortLog("Done.\n"); -#ifdef U_CFG_TEST_CELL_MODULE_TYPE +#if defined(U_CFG_TEST_CELL_MODULE_TYPE) && !defined(U_CFG_TEST_TRANSPORT_SECURITY_DISABLE) // For u-blox internal testing only EXAMPLE_FINAL_STATE((txSize == 0) && (rxSize == sizeof(message))); #endif diff --git a/example/sockets/main_tls.c b/example/sockets/main_tls.c index 2574d8dc..5ba6ec05 100644 --- a/example/sockets/main_tls.c +++ b/example/sockets/main_tls.c @@ -82,7 +82,7 @@ // for the module is likely different to that of the MCU: check // the data sheet for the module to determine the mapping. -#ifdef U_CFG_TEST_CELL_MODULE_TYPE +#if defined(U_CFG_TEST_CELL_MODULE_TYPE) && !defined(U_CFG_TEST_TRANSPORT_SECURITY_DISABLE) // DEVICE i.e. module/chip configuration: in this case a cellular // module connected via UART static const uDeviceCfg_t gDeviceCfg = { @@ -422,7 +422,7 @@ U_PORT_TEST_FUNCTION("[example]", "exampleSocketsTls") uPortLog("Done.\n"); -#ifdef U_CFG_TEST_CELL_MODULE_TYPE +#if defined(U_CFG_TEST_CELL_MODULE_TYPE) && !defined(U_CFG_TEST_TRANSPORT_SECURITY_DISABLE) // For u-blox internal testing only EXAMPLE_FINAL_STATE((txSize == 0) && (rxSize == sizeof(message))); #endif diff --git a/port/platform/common/automation/DATABASE.md b/port/platform/common/automation/DATABASE.md index 1d7efb73..b2ad7256 100644 --- a/port/platform/common/automation/DATABASE.md +++ b/port/platform/common/automation/DATABASE.md @@ -68,7 +68,7 @@ The table below defines the instances of test hardware available on the `ubxlib` | 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_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, live network | STM32F4 | | STM32Cube | | LARA_R6 NORA_W36 | port device network sock ble wifi cell short_range security mqtt_client http_client location | cell short_range short_range_gen2 | CMSIS_V2 U_CFG_TEST_CELL_PWR_DISABLE HSE_VALUE=8000000U 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_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_DEBUG_UTILS_DUMP_THREADS U_BLE_TEST_CFG_REMOTE_SPS_CENTRAL=2462ABB6CC42p U_BLE_TEST_CFG_REMOTE_SPS_PERIPHERAL=2462ABB6EAC6p U_CFG_APP_SHORT_RANGE_ROLE=3 | | 31 | STM32F7, Nucleo-F767ZI | STM32 | nucleo_f767zi | Zephyr | | | port | | U_DEBUG_UTILS_DUMP_THREADS | -| 32 | STM32U5, Nucleo-U575ZI-q | STM32 | nucleo_u575zi_q | Zephyr | | M9 | port ubx_protocol gnss spartn | | 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_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS | +| 32 | STM32U5, Nucleo-U575ZI-q | STM32 | nucleo_u575zi_q | Zephyr | | SARA_U201 M9 | port device network sock cell security http_client location gnss ubx_protocol gnss 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_TEST_UART_A=-1 U_DEBUG_UTILS_DUMP_THREADS | Notes: - the \#defines listed are *overrides* on the default values that are defined in the code or additional to those defined in the code; they are not a complete list, diff --git a/port/platform/common/automation/SETUP.md b/port/platform/common/automation/SETUP.md index b97f0826..99f885ff 100644 --- a/port/platform/common/automation/SETUP.md +++ b/port/platform/common/automation/SETUP.md @@ -628,7 +628,7 @@ If the server has no DNS entry on the public internet (required for some tests) ### Cellular And Short Range Network Test Peers A Nutaq cellular network box is required for cellular Cat-M1 coverage; set up of this is out of scope of this document: provided an RF link gets to the relevant test instances and the Nutaq has public internet access, that is all that is required. To be clear, the Nutaq box does _not_ have to be on the same network as the `ubxlib` test system (though it can be if desired). -Some cellular test instances (e.g. instance 25 and 29) may use the live network for their cellular test peer, rather than the Nutaq box (e.g. because the RAT that they use is not supported by the Nutaq box, which is the case for 2G, 3G, LTE non-Cat-M1 and LTE non-NB1). Some live networks (e.g. O2/Telefonica in the UK) apply extremely annoying attach/detach rate limitations, and a UE may be banned for a attaching/detaching too often, certainly the case for one running our test regime. To stop this buggering everything up, you should initially control the module in question directly, do a manual selection of a network which does not apply attach/detach rate limitations (e.g. Vodafone or 3 in the UK, where `AT+COPS=1,2,"23415` would, for example, select Vodafone in the UK), then switch back to automatic mode (`AT+COPS=0`), and maybe also add the same network to the preferred list (e.g. `AT+CPOL=1,2,"23415",1,1,1,1` would add Vodafone UK to the top of the list): this should hopefully stick the module to that network. +Some cellular test instances (e.g. instance 25 and 29) may use the live network for their cellular test peer, rather than the Nutaq box (e.g. because the RAT that they use is not supported by the Nutaq box, which is the case for 2G, 3G, LTE non-Cat-M1 and LTE non-NB1). Some live networks (e.g. O2/Telefonica in the UK) apply extremely annoying attach/detach rate limitations, and a UE may be banned for a attaching/detaching too often, certainly the case for one running our test regime. To stop this buggering everything up, you should initially control the module in question directly, do a manual selection of a network which does not apply attach/detach rate limitations (e.g. Vodafone or 3 in the UK, where `AT+COPS=1,2,"23415"` would, for example, select Vodafone in the UK), then switch back to automatic mode (`AT+COPS=0`), and maybe also add the same network to the preferred list (e.g. `AT+CPOL=1,2,"23415",1,1,1,1` would add Vodafone UK to the top of the list): this should hopefully stick the module to that network. Some short-range test instances require BLE test peers; these just need to be [configured](https://wiki.u-blox.com/bin/view/ShortRange/NewPlatforms), MAC addressses in [DATABASE.md](DATABASE.md) and then plugged into power from the shared resource Ethernet-based relay boxes so that they are powered up at the start of testing and powered down again afterwards. diff --git a/port/platform/zephyr/cfg/u_cfg_app_platform_specific.h b/port/platform/zephyr/cfg/u_cfg_app_platform_specific.h index f675acf8..de1631ea 100644 --- a/port/platform/zephyr/cfg/u_cfg_app_platform_specific.h +++ b/port/platform/zephyr/cfg/u_cfg_app_platform_specific.h @@ -148,6 +148,11 @@ * with a cellular module. */ # define U_CFG_APP_CELL_UART 6 +# elif defined(CONFIG_BOARD_NUCLEO_U575ZI_Q) +/** UART HW block to use inside STM32U575ZI when communicating + * with a cellular module. + */ +# define U_CFG_APP_CELL_UART 2 # else /** The UARTE HW block to use inside the NRF52 chip or on Linux * when communicating with a cellular module. diff --git a/port/platform/zephyr/runner_stm32/boards/nucleo_u575zi_q.overlay b/port/platform/zephyr/runner_stm32/boards/nucleo_u575zi_q.overlay index bc2e1730..d49a86ba 100644 --- a/port/platform/zephyr/runner_stm32/boards/nucleo_u575zi_q.overlay +++ b/port/platform/zephyr/runner_stm32/boards/nucleo_u575zi_q.overlay @@ -1,5 +1,31 @@ / { // This portion in the "root" of the device tree + // The UARTs on this board exposed through the default + // .dts file are called USARTs (i.e. with an S inserted), + // and LPUARTs, hence we need to use aliases in order + // for ubxlib to be able to find them as UARTs + aliases { + ubxlib-uart2 = &usart2; // For cellular module + // Don't need an alias for USART3 as that's the console + // and ubxlib doesn't need to open it + }; + + cfg-device-cellular { + compatible = "u-blox,ubxlib-device-cellular"; + status = "okay"; + transport-type = "uart2"; + // Note: allow the cellular module type to be determined automatically + pin-pwr-on = <0x5e>; // Arduino header pin D4, or pin F14 in STM32 port numbering + network = <&label_cfg_network_cellular>; + }; + + label_cfg_network_cellular: cfg-network-cellular { + compatible = "u-blox,ubxlib-network-cellular"; + status = "okay"; + apn = "iot.1nce.net"; + timeout-seconds = <240>; + }; + // A GNSS device connected to I2C1 cfg-device-gnss { compatible = "u-blox,ubxlib-device-gnss"; @@ -36,12 +62,18 @@ // Guidance from table 136 of reference manual // RM0456 and // https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/bindings/dma/st%2Cstm32u5-dma.yaml -// Also, make console logging use DMA for speed +&usart2 { + dmas = <&gpdma1 0 27 STM32_DMA_PERIPH_TX + &gpdma1 1 26 STM32_DMA_PERIPH_RX>; + dma-names = "tx", "rx"; +}; +&gpdma1 { + status = "okay"; +}; + +// Also make console logging use DMA for speed &usart3 { dmas = <&gpdma1 0 29 STM32_DMA_PERIPH_TX &gpdma1 1 28 STM32_DMA_PERIPH_RX>; dma-names = "tx", "rx"; }; -&gpdma1 { - status = "okay"; -}; \ No newline at end of file