Skip to content

Commit

Permalink
Anjay-freertos-client 23.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Kucmasz committed Nov 22, 2023
1 parent b27a42c commit e9a2caf
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Projects/**/STM32CubeIDE/crypto.txt
Projects/**/STM32CubeIDE/postbuild.sh
__pycache__/
/.metadata/
!OEM_KEY_COMPANY1_key_AES_CBC.bin
!OEM_KEY_COMPANY1_key_AES_GCM.bin
11 changes: 11 additions & 0 deletions Application/Inc/anjay/anjay_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,17 @@
* in the open source version.
*/
/* #undef ANJAY_WITH_MODULE_OSCORE */

/**
* If enable Anjay doesn't handle composite operation (read, observe and write).
* Its use makes sense for LWM2M v1.1 upwards.
*
* This flag can be used to reduce the size of the resulting code.
*
* If active, anjay will respond with message code 5.01 Not Implemented to any
* composite type request.
*/
/* #undef ANJAY_WITHOUT_COMPOSITE_OPERATIONS */
/**@}*/

#endif // ANJAY_CONFIG_H
10 changes: 10 additions & 0 deletions Application/Inc/avsystem/commons/avs_commons_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@
*/
/* #undef AVS_COMMONS_WITH_MBEDTLS_PSA_ENGINE_PROTECTED_STORAGE */

/**
* Enables use of the <c>psa_generate_random()</c> function as the default
* random number generator when using the Mbed TLS crypto backend, instead of
* CTR-DRBG seeded by the Mbed TLS entropy pool.
*
* It's meaningful only when @ref AVS_COMMONS_WITH_MBEDTLS is enabled. However,
* it is independent from the above PSA engine settings.
*/
/* #undef AVS_COMMONS_WITH_MBEDTLS_PSA_RNG */

/**
* Is the <c>dlsym()</c> function available?
*
Expand Down
2 changes: 1 addition & 1 deletion Application/Inc/default_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#else // USE_SIM_BOOTSTRAP
#define DEFAULT_USE_SIM_BOOTSTRAP "n"
#endif // USE_SIM_BOOTSTRAP
#define FIRMWARE_VERSION "23.09"
#define FIRMWARE_VERSION "23.11"
#define MD5_OF_ZERO_BYTES_INITIALIZER \
{ \
0xD4, 0x1D, 0x8C, 0xD9, 0x8F, 0x00, 0xB2, 0x04, 0xE9, 0x80, 0x09, \
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 23.11 (Nov 21st, 2023)

### Bugfixes
- Increased the AT command timeout for the DNS resolution command, for better
compatibility with various TYPE1SC firmware versions

## 23.09 (Sep 7th, 2023)

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ extern "C" {
#define TYPE1SC_SIMREADY_TIMEOUT ((uint32_t)3000U)

#if (USE_SOCKETS_TYPE == USE_SOCKETS_MODEM)
#define TYPE1SC_DNSRSLV_TIMEOUT ((uint32_t)60000) /* 60 sec */
#define TYPE1SC_PING_TIMEOUT ((uint32_t)15000) /* 15 sec */
#endif /* (USE_SOCKETS_TYPE == USE_SOCKETS_MODEM)*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void ATCustom_TYPE1SC_init(atparser_context_t *p_atp_ctxt)
fCmdBuild_SOCKETDATA_RECEIVE, fRspAnalyze_SOCKETDATA
},
{
CMD_AT_DNSRSLV, "%DNSRSLV", TYPE1SC_DEFAULT_TIMEOUT,
CMD_AT_DNSRSLV, "%DNSRSLV", TYPE1SC_DNSRSLV_TIMEOUT,
fCmdBuild_DNSRSLV, fRspAnalyze_DNSRSLV
},
{
Expand Down
6 changes: 4 additions & 2 deletions Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ospi.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma GCC push_options
#pragma GCC optimize ("-O0")
/**
******************************************************************************
* @file stm32u5xx_hal_ospi.c
Expand Down Expand Up @@ -3000,7 +3002,6 @@ static void OSPI_DMAAbortCplt(DMA_HandleTypeDef *hdma)
* @param Tickstart : Tick start value
* @retval HAL status
*/
__attribute__((optimize("O0")))
static HAL_StatusTypeDef OSPI_WaitFlagStateUntilTimeout(OSPI_HandleTypeDef *hospi, uint32_t Flag,
FlagStatus State, uint32_t Tickstart, uint32_t Timeout)
{
Expand Down Expand Up @@ -3032,7 +3033,6 @@ static HAL_StatusTypeDef OSPI_WaitFlagStateUntilTimeout(OSPI_HandleTypeDef *hosp
* @param cmd : structure that contains the command configuration information
* @retval HAL status
*/
__attribute__((optimize("O0")))
static HAL_StatusTypeDef OSPI_ConfigCmd(OSPI_HandleTypeDef *hospi, OSPI_RegularCmdTypeDef *cmd)
{
HAL_StatusTypeDef status = HAL_OK;
Expand Down Expand Up @@ -3528,3 +3528,5 @@ HAL_StatusTypeDef HAL_OSPI_DLYB_GetClockPeriod(OSPI_HandleTypeDef *hospi, HAL_OS
*/

#endif /* OCTOSPI || OCTOSPI1 || OCTOSPI2 */

#pragma GCC pop_options
2 changes: 1 addition & 1 deletion Middlewares/Third_Party/Anjay
Submodule Anjay updated 104 files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OEM_KEY_COMPANY1
4 changes: 4 additions & 0 deletions Projects/B-L462E-CELL1/UserApp/app_compat/barometer_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ static int get_pressure(float *out_pressure) {
LOG(ERROR, "Error getting current pressure");
return -1;
}
if (!*out_pressure) {
// Disregard 0 reading
return -1;
}
// convert hPa to Pa
*out_pressure = 100.0f * *out_pressure;
return 0;
Expand Down
4 changes: 4 additions & 0 deletions Projects/B-U585I-IOT02A/app_compat/barometer_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ static int get_pressure(float *out_pressure) {
LOG(ERROR, "Couldn't read pressure");
return -1;
}
if (!*out_pressure) {
// Disregard 0 reading
return -1;
}
// convert hPa to Pa
*out_pressure = 100.0f * *out_pressure;
return 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OEM_KEY_COMPANY1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OEM_KEY_COMPANY1
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ static int get_pressure(float *out_pressure) {
LOG(ERROR, "IKS01A2 barometer not initialized");
return -1;
}
float pressure;
if (BSP_PRESSURE_Get_Press(g_sensor_barometer, &pressure)) {
if (BSP_PRESSURE_Get_Press(g_sensor_barometer, out_pressure)) {
LOG(ERROR, "error getting current pressure");
return -1;
}
if (!*out_pressure) {
// Disregard 0 reading
return -1;
}
// convert hPa to Pa
*out_pressure = 100.0f * pressure;
*out_pressure = 100.0f * *out_pressure;
return 0;
}

Expand Down
32 changes: 14 additions & 18 deletions stm32u5_hal_ospi_noopt.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Following patch was applied to STM32U5's HAL OSPI driver to disable optimizations
# for certain functions. Compiling the app in -Os mode for certain STM32CubeIDE
# Following patch was applied to STM32U5's HAL OSPI driver to disable
# optimizations. Compiling the app in -Os mode for certain STM32CubeIDE
# versions causes the driver to not function correctly.

diff --git a/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ospi.c b/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ospi.c
index 3d38b50..22643c7 100644
index 3d38b50..6ef32b0 100644
--- a/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ospi.c
+++ b/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_ospi.c
@@ -3000,6 +3000,7 @@ static void OSPI_DMAAbortCplt(DMA_HandleTypeDef *hdma)
* @param Tickstart : Tick start value
* @retval HAL status
@@ -1,3 +1,5 @@
+#pragma GCC push_options
+#pragma GCC optimize ("-O0")
/**
******************************************************************************
* @file stm32u5xx_hal_ospi.c
@@ -3526,3 +3528,5 @@ HAL_StatusTypeDef HAL_OSPI_DLYB_GetClockPeriod(OSPI_HandleTypeDef *hospi, HAL_OS
*/
+__attribute__((optimize("O0")))
static HAL_StatusTypeDef OSPI_WaitFlagStateUntilTimeout(OSPI_HandleTypeDef *hospi, uint32_t Flag,
FlagStatus State, uint32_t Tickstart, uint32_t Timeout)
{
@@ -3031,6 +3032,7 @@ static HAL_StatusTypeDef OSPI_WaitFlagStateUntilTimeout(OSPI_HandleTypeDef *hosp
* @param cmd : structure that contains the command configuration information
* @retval HAL status
*/
+__attribute__((optimize("O0")))
static HAL_StatusTypeDef OSPI_ConfigCmd(OSPI_HandleTypeDef *hospi, OSPI_RegularCmdTypeDef *cmd)
{
HAL_StatusTypeDef status = HAL_OK;

#endif /* OCTOSPI || OCTOSPI1 || OCTOSPI2 */
+
+#pragma GCC pop_options
32 changes: 32 additions & 0 deletions xcc_type1sc_dnsrslv_timeout.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Following patch was applied to X-Cube-Cellular 7.1.0 to make it more
# compatible with some newer revisions of the TYPE1SC firmware, in which the
# AT%DNSRSLV request sometimes takes longer than 15 seconds if performed just
# after attaching to the network. The timeout may cause the eventual response
# to interfere with subsequent AT command requests, which causes a fatal error
# in a situation where successful communication is perfectly possible.

diff --git a/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Inc/at_custom_modem_specific.h b/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Inc/at_custom_modem_specific.h
index 4f6924bb..258e87fc 100644
--- a/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Inc/at_custom_modem_specific.h
+++ b/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Inc/at_custom_modem_specific.h
@@ -71,6 +71,7 @@ extern "C" {
#define TYPE1SC_SIMREADY_TIMEOUT ((uint32_t)3000U)

#if (USE_SOCKETS_TYPE == USE_SOCKETS_MODEM)
+#define TYPE1SC_DNSRSLV_TIMEOUT ((uint32_t)60000) /* 60 sec */
#define TYPE1SC_PING_TIMEOUT ((uint32_t)15000) /* 15 sec */
#endif /* (USE_SOCKETS_TYPE == USE_SOCKETS_MODEM)*/

diff --git a/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Src/at_custom_modem_specific.c b/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Src/at_custom_modem_specific.c
index 5bd1d6a3..f7aa4ad2 100644
--- a/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Src/at_custom_modem_specific.c
+++ b/Drivers/BSP/X_STMOD_PLUS_MODEMS/TYPE1SC/AT_modem_type1sc/Src/at_custom_modem_specific.c
@@ -256,7 +256,7 @@ void ATCustom_TYPE1SC_init(atparser_context_t *p_atp_ctxt)
fCmdBuild_SOCKETDATA_RECEIVE, fRspAnalyze_SOCKETDATA
},
{
- CMD_AT_DNSRSLV, "%DNSRSLV", TYPE1SC_DEFAULT_TIMEOUT,
+ CMD_AT_DNSRSLV, "%DNSRSLV", TYPE1SC_DNSRSLV_TIMEOUT,
fCmdBuild_DNSRSLV, fRspAnalyze_DNSRSLV
},
{

0 comments on commit e9a2caf

Please sign in to comment.