Skip to content

Commit 05a9f68

Browse files
authored
Update to Azure RTOS 6.1 (#151)
1 parent 869fff8 commit 05a9f68

File tree

523 files changed

+1532
-142504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

523 files changed

+1532
-142504
lines changed

.gitmodules

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
[submodule "core/lib/threadx"]
22
path = core/lib/threadx
3-
url = http://github.com/azure-rtos/threadx.git
3+
url = https://github.com/azure-rtos/threadx.git
44
[submodule "core/lib/netxduo"]
55
path = core/lib/netxduo
6-
url = http://github.com/azure-rtos/netxduo.git
7-
[submodule "core/lib/azure-iot-preview"]
8-
path = core/lib/azure-iot-preview
9-
url = https://github.com/azure-rtos/azure-iot-preview
6+
url = https://github.com/azure-rtos/netxduo.git
107
[submodule "core/lib/jsmn/src"]
118
path = core/lib/jsmn/src
129
url = https://github.com/zserge/jsmn

MXChip/AZ3166/app/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ add_executable(${PROJECT_NAME} ${SOURCES})
2525
target_link_libraries(${PROJECT_NAME}
2626
azrtos::threadx
2727
azrtos::netxduo
28-
azrtos::nx_cloud
29-
azrtos::azure_iot
3028

3129
stm32cubef4
3230
wiced_sdk

MXChip/AZ3166/app/nx_client.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "nx_api.h"
1212
#include "nx_azure_iot_hub_client.h"
1313
#include "nx_azure_iot_provisioning_client.h"
14+
#include "nx_azure_iot_json_reader.h"
1415

1516
// These are sample files, user can build their own certificate and ciphersuites
1617
#include "azure_iot_cert.h"
@@ -46,7 +47,7 @@ static void set_led_state(bool level)
4647
}
4748

4849
static void direct_method_cb(AZURE_IOT_NX_CONTEXT* nx_context,
49-
UCHAR* method,
50+
const UCHAR* method,
5051
USHORT method_length,
5152
UCHAR* payload,
5253
USHORT payload_length,
@@ -84,15 +85,17 @@ static void device_twin_desired_property_cb(UCHAR* component_name,
8485
UINT component_name_len,
8586
UCHAR* property_name,
8687
UINT property_name_len,
87-
az_json_reader property_value_reader,
88+
NX_AZURE_IOT_JSON_READER property_value_reader,
8889
UINT version,
8990
VOID* userContextCallback)
9091
{
92+
UINT status;
9193
AZURE_IOT_NX_CONTEXT* nx_context = (AZURE_IOT_NX_CONTEXT*)userContextCallback;
9294

9395
if (strncmp((CHAR*)property_name, TELEMETRY_INTERVAL_PROPERTY, property_name_len) == 0)
9496
{
95-
if (az_succeeded(az_json_token_get_int32(&property_value_reader.token, &telemetry_interval)))
97+
status = nx_azure_iot_json_reader_token_int32_get(&property_value_reader, &telemetry_interval);
98+
if (status == NX_AZURE_IOT_SUCCESS)
9699
{
97100
// Set a telemetry event so we pick up the change immediately
98101
tx_event_flags_set(&azure_iot_flags, TELEMETRY_INTERVAL_EVENT, TX_OR);
@@ -108,15 +111,17 @@ static void device_twin_property_cb(UCHAR* component_name,
108111
UINT component_name_len,
109112
UCHAR* property_name,
110113
UINT property_name_len,
111-
az_json_reader property_value_reader,
114+
NX_AZURE_IOT_JSON_READER property_value_reader,
112115
UINT version,
113116
VOID* userContextCallback)
114117
{
118+
UINT status;
115119
AZURE_IOT_NX_CONTEXT* nx_context = (AZURE_IOT_NX_CONTEXT*)userContextCallback;
116120

117121
if (strncmp((CHAR*)property_name, TELEMETRY_INTERVAL_PROPERTY, property_name_len) == 0)
118122
{
119-
if (az_succeeded(az_json_token_get_int32(&property_value_reader.token, &telemetry_interval)))
123+
status = nx_azure_iot_json_reader_token_int32_get(&property_value_reader, &telemetry_interval);
124+
if (status == NX_AZURE_IOT_SUCCESS)
120125
{
121126
// Set a telemetry event so we pick up the change immediately
122127
tx_event_flags_set(&azure_iot_flags, TELEMETRY_INTERVAL_EVENT, TX_OR);
@@ -132,7 +137,7 @@ UINT azure_iot_nx_client_entry(
132137
NX_IP* ip_ptr, NX_PACKET_POOL* pool_ptr, NX_DNS* dns_ptr, UINT (*unix_time_callback)(ULONG* unix_time))
133138
{
134139
UINT status;
135-
ULONG events = 0;
140+
ULONG events = 0;
136141
int telemetry_state = 0;
137142
lps22hb_t lps22hb_data;
138143
hts221_data_t hts221_data;
@@ -222,7 +227,7 @@ UINT azure_iot_nx_client_entry(
222227
// Send the compensated humidity
223228
hts221_data = hts221_data_read();
224229
azure_iot_nx_client_publish_float_telemetry(
225-
&azure_iot_nx_client, "humidityPercentage", hts221_data.humidity_perc);
230+
&azure_iot_nx_client, "humidity", hts221_data.humidity_perc);
226231
break;
227232

228233
case 3:

MXChip/AZ3166/lib/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(TX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/threadx/tx_user.h" CACHE STRING "Ena
1010

1111
# Define NetXDuo user configuration
1212
set(NX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/netxduo/nx_user.h" CACHE STRING "Enable NX user configuration")
13+
set(NXD_ENABLE_AZURE_IOT ON CACHE BOOL "Enable Azure IoT")
1314
set(NXD_ENABLE_FILE_SERVERS OFF CACHE BOOL "Disable fileX dependency by netxduo")
1415

1516
# Disable ASC
@@ -18,15 +19,7 @@ set(NX_AZURE_DISABLE_IOT_SECURITY_MODULE ON CACHE BOOL "Disable ASC")
1819
# Core libraries
1920
add_subdirectory(${CORE_LIB_DIR}/threadx threadx)
2021
add_subdirectory(${CORE_LIB_DIR}/netxduo netxduo)
21-
add_subdirectory(${CORE_LIB_DIR}/azure-iot-preview/nx_cloud nx_cloud)
22-
add_subdirectory(${CORE_LIB_DIR}/azure-iot-preview/azure_iot azure_iot)
2322
add_subdirectory(${CORE_LIB_DIR}/jsmn jsmn)
2423

25-
# Bind the nx_cloud preview include into the existing netxduo
26-
target_include_directories(netxduo
27-
PUBLIC
28-
${CORE_LIB_DIR}/azure-iot-preview/nx_cloud
29-
)
30-
3124
add_subdirectory(stm32cubef4)
3225
add_subdirectory(wiced_sdk)

MXChip/AZ3166/lib/netxduo/nx_user.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1+
/**************************************************************************/
2+
/* */
3+
/* Copyright (c) Microsoft Corporation. All rights reserved. */
4+
/* */
5+
/* This software is licensed under the Microsoft Software License */
6+
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
7+
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
8+
/* and in the root directory of this software. */
9+
/* */
10+
/**************************************************************************/
11+
112
#ifndef NX_USER_H
213
#define NX_USER_H
314

15+
#define NX_SECURE_ENABLE
16+
#define NX_ENABLE_EXTENDED_NOTIFY_SUPPORT
17+
#define NX_ENABLE_IP_PACKET_FILTER
418
#define NX_DISABLE_IPV6
5-
#define NX_DISABLE_INCLUDE_SOURCE_CODE
619
#define NX_DNS_CLIENT_USER_CREATE_PACKET_POOL
720

8-
#define NX_SECURE_ENABLE
9-
#define NX_ENABLE_EXTENDED_NOTIFY_SUPPORT
1021
#define NXD_MQTT_CLOUD_ENABLE
1122

23+
#define NX_SNTP_CLIENT_MIN_SERVER_STRATUM 3
24+
1225
extern UINT nx_rand16( void );
1326
#define NX_RAND nx_rand16
1427

Microchip/ATSAME54-XPRO/app/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ target_link_libraries(${PROJECT_NAME}
2121
PUBLIC
2222
azrtos::threadx
2323
azrtos::netxduo
24-
azrtos::nx_cloud
25-
azrtos::azure_iot
26-
24+
2725
atmel_start
2826
app_common
2927
jsmn

Microchip/ATSAME54-XPRO/app/nx_client.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "nx_api.h"
1212
#include "nx_azure_iot_hub_client.h"
13+
#include "nx_azure_iot_json_reader.h"
1314
#include "nx_azure_iot_provisioning_client.h"
1415

1516
#include "jsmn.h"
@@ -22,7 +23,7 @@
2223

2324
#include "azure_config.h"
2425

25-
#define IOT_MODEL_ID "dtmi:com:example:azurertos:gsg;1"
26+
#define IOT_MODEL_ID "dtmi:com:example:azurertos:gsg;1"
2627
#define TELEMETRY_INTERVAL_PROPERTY "telemetryInterval"
2728
#define LED_STATE_PROPERTY "ledState"
2829
#define SET_LED_STATE_COMMAND "setLedState"
@@ -51,7 +52,7 @@ static void set_led_state(bool level)
5152
}
5253

5354
static void direct_method_cb(AZURE_IOT_NX_CONTEXT* nx_context,
54-
UCHAR* method,
55+
const UCHAR* method,
5556
USHORT method_length,
5657
UCHAR* payload,
5758
USHORT payload_length,
@@ -89,15 +90,17 @@ static void device_twin_desired_property_cb(UCHAR* component_name,
8990
UINT component_name_len,
9091
UCHAR* property_name,
9192
UINT property_name_len,
92-
az_json_reader property_value_reader,
93+
NX_AZURE_IOT_JSON_READER property_value_reader,
9394
UINT version,
9495
VOID* userContextCallback)
9596
{
97+
UINT status;
9698
AZURE_IOT_NX_CONTEXT* nx_context = (AZURE_IOT_NX_CONTEXT*)userContextCallback;
9799

98100
if (strncmp((CHAR*)property_name, TELEMETRY_INTERVAL_PROPERTY, property_name_len) == 0)
99101
{
100-
if (az_succeeded(az_json_token_get_int32(&property_value_reader.token, &telemetry_interval)))
102+
status = nx_azure_iot_json_reader_token_int32_get(&property_value_reader, &telemetry_interval);
103+
if (status == NX_AZURE_IOT_SUCCESS)
101104
{
102105
// Set a telemetry event so we pick up the change immediately
103106
tx_event_flags_set(&azure_iot_flags, TELEMETRY_INTERVAL_EVENT, TX_OR);
@@ -113,15 +116,17 @@ static void device_twin_property_cb(UCHAR* component_name,
113116
UINT component_name_len,
114117
UCHAR* property_name,
115118
UINT property_name_len,
116-
az_json_reader property_value_reader,
119+
NX_AZURE_IOT_JSON_READER property_value_reader,
117120
UINT version,
118121
VOID* userContextCallback)
119122
{
123+
UINT status;
120124
AZURE_IOT_NX_CONTEXT* nx_context = (AZURE_IOT_NX_CONTEXT*)userContextCallback;
121125

122126
if (strncmp((CHAR*)property_name, TELEMETRY_INTERVAL_PROPERTY, property_name_len) == 0)
123127
{
124-
if (az_succeeded(az_json_token_get_int32(&property_value_reader.token, &telemetry_interval)))
128+
status = nx_azure_iot_json_reader_token_int32_get(&property_value_reader, &telemetry_interval);
129+
if (status == NX_AZURE_IOT_SUCCESS)
125130
{
126131
// Set a telemetry event so we pick up the change immediately
127132
tx_event_flags_set(&azure_iot_flags, TELEMETRY_INTERVAL_EVENT, TX_OR);
@@ -215,4 +220,3 @@ UINT azure_iot_nx_client_entry(
215220

216221
return NX_SUCCESS;
217222
}
218-

Microchip/ATSAME54-XPRO/lib/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(TX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/threadx/tx_user.h" CACHE STRING "Ena
1010

1111
# Define NetXDuo user configuration
1212
set(NX_USER_FILE "${CMAKE_CURRENT_LIST_DIR}/netxduo/nx_user.h" CACHE STRING "Enable NX user configuration")
13+
set(NXD_ENABLE_AZURE_IOT ON CACHE BOOL "Enable Azure IoT")
1314
set(NXD_ENABLE_FILE_SERVERS OFF CACHE BOOL "Disable fileX dependency by netxduo")
1415

1516
# Disable ASC
@@ -18,15 +19,7 @@ set(NX_AZURE_DISABLE_IOT_SECURITY_MODULE ON CACHE BOOL "Disable ASC")
1819
# Core libraries
1920
add_subdirectory(${CORE_LIB_DIR}/threadx threadx)
2021
add_subdirectory(${CORE_LIB_DIR}/netxduo netxduo)
21-
add_subdirectory(${CORE_LIB_DIR}/azure-iot-preview/nx_cloud nx_cloud)
22-
add_subdirectory(${CORE_LIB_DIR}/azure-iot-preview/azure_iot azure_iot)
2322
add_subdirectory(${CORE_LIB_DIR}/jsmn jsmn)
2423

25-
# Bind the nx_cloud preview include into the existing netxduo
26-
target_include_directories(netxduo
27-
PUBLIC
28-
${CORE_LIB_DIR}/azure-iot-preview/nx_cloud
29-
)
30-
3124
add_subdirectory(netx_driver)
3225
add_subdirectory(atmel_start)

Microchip/ATSAME54-XPRO/lib/netxduo/nx_user.h

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,17 @@
99
/* */
1010
/**************************************************************************/
1111

12-
13-
/**************************************************************************/
14-
/**************************************************************************/
15-
/** */
16-
/** NetX Component */
17-
/** */
18-
/** User Specific */
19-
/** */
20-
/**************************************************************************/
21-
/**************************************************************************/
22-
23-
24-
/**************************************************************************/
25-
/* */
26-
/* PORT SPECIFIC C INFORMATION RELEASE */
27-
/* */
28-
/* nx_user.h PORTABLE C */
29-
/* 6.0 */
30-
/* */
31-
/* AUTHOR */
32-
/* */
33-
/* William E. Lamie, Microsoft Corporation */
34-
/* */
35-
/* DESCRIPTION */
36-
/* */
37-
/* This file contains user defines for configuring NetX in specific */
38-
/* ways. This file will have an effect only if the application and */
39-
/* NetX library are built with NX_INCLUDE_USER_DEFINE_FILE defined. */
40-
/* Note that all the defines in this file may also be made on the */
41-
/* command line when building NetX library and application objects. */
42-
/* */
43-
/* RELEASE HISTORY */
44-
/* */
45-
/* DATE NAME DESCRIPTION */
46-
/* */
47-
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
48-
/* */
49-
/**************************************************************************/
50-
5112
#ifndef NX_USER_H
5213
#define NX_USER_H
5314

54-
#define NX_DISABLE_INCLUDE_SOURCE_CODE
55-
5615
#define NX_SECURE_ENABLE
5716
#define NX_ENABLE_EXTENDED_NOTIFY_SUPPORT
17+
#define NX_ENABLE_IP_PACKET_FILTER
18+
5819
#define NXD_MQTT_CLOUD_ENABLE
5920

21+
#define NX_SNTP_CLIENT_MIN_SERVER_STRATUM 3
22+
6023
/* Define various build options for the NetX Duo port. The application should either make changes
6124
here by commenting or un-commenting the conditional compilation defined OR supply the defines
6225
though the compiler's equivalent of the -D option. */
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
:: Copyright (c) Microsoft Corporation.
22
:: Licensed under the MIT License.
33

4-
atprogram.exe --tool edbg --interface SWD --device ATSAME54P20A program --chiperase --file atsame54_azure_iot.bin --verify
4+
setlocal
5+
cd /d %~dp0\..
6+
7+
openocd -f board/microchip_same54_xplained_pro.cfg -c "program build/app/atsame54_azure_iot.elf verify reset exit"

0 commit comments

Comments
 (0)