Skip to content

Commit e2cff95

Browse files
authored
Merge pull request #762 from arduino/edge_gsm_fixes
Edge control build fixes and CI
2 parents 7800f10 + e2e2c64 commit e2cff95

File tree

18 files changed

+164
-27
lines changed

18 files changed

+164
-27
lines changed

.github/workflows/compile-examples.yml

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- fqbn: arduino:mbed:opta
4242
- fqbn: arduino:mbed:giga
4343
- fqbn: arduino:mbed:nicla_voice
44+
- fqbn: arduino:mbed:edge_control
4445

4546
# compile only the examples compatible with each board
4647
include:
@@ -170,6 +171,15 @@ jobs:
170171
version: v0.9.6
171172
- name: arduino-libg722
172173
source-url: https://github.com/pschatzmann/arduino-libg722.git
174+
- board:
175+
fqbn: arduino:mbed:edge_control
176+
additional-libraries: |
177+
- name: MicroNMEA
178+
additional-sketch-paths: |
179+
- libraries/GSM
180+
- libraries/USBHID
181+
- libraries/USBMSD/examples/Nano33BLE_FlashMassStorage
182+
- libraries/ThreadDebug
173183
174184
steps:
175185
- name: Checkout repository

cores/arduino/mbed/connectivity/cellular/include/cellular/framework/AT/AT_CellularContext.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class AT_CellularContext : public CellularContext {
109109
* @return NIDD context text, e.g. Non-IP or NONIP
110110
*/
111111
virtual const char *get_nonip_context_type_str();
112-
virtual void enable_access_technology();
112+
virtual nsapi_error_t enable_access_technology();
113113
virtual void set_cid(int cid);
114114

115115
private:
@@ -135,15 +135,15 @@ class AT_CellularContext : public CellularContext {
135135

136136
PinName _dcd_pin;
137137
bool _active_high;
138-
RadioAccessTechnologyType _rat;
139-
FrequencyBand _band;
140138

141139
protected:
142140
char _found_apn[MAX_APN_LENGTH];
143141
// flag indicating if CP was requested to be setup
144142
bool _cp_req;
145143
bool _is_connected;
146144
ATHandler &_at;
145+
RadioAccessTechnologyType _rat;
146+
FrequencyBand _band;
147147
};
148148

149149
} // namespace mbed

cores/arduino/mbed/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class GEMALTO_CINTERION_CellularContext: public AT_CellularContext {
3434
virtual NetworkStack *get_stack();
3535
#endif // NSAPI_PPP_AVAILABLE
3636
virtual nsapi_error_t do_user_authentication();
37+
virtual nsapi_error_t enable_access_technology();
3738
};
3839

3940
} /* namespace mbed */

cores/arduino/mbed/platform/include/platform/Callback.h

+1-10
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
#include <mstd_type_traits>
2727
#include <mstd_functional>
2828

29-
#pragma GCC push_options
30-
// This prevents the GCC compiler from applying optimizations that assume the code follows strict aliasing rules.
31-
// In order to prevent bugs arising from undefined behavior that is tricky to find in the Callback implementation,
32-
// or simply from compiler bugs in GCC.
33-
#pragma GCC optimize("-fno-strict-aliasing")
34-
// This prevents the GCC compiler from generating incorrect inline code for the Callback constructor.
35-
#pragma GCC optimize("-fno-inline")
36-
3729
// Controlling switches from config:
3830
// MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL - support storing non-trivial function objects
3931
// MBED_CONF_PLATFORM_CALLBACK_COMPARABLE - support memcmp comparing stored objects (requires zero padding)
@@ -44,6 +36,7 @@
4436
#define MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL 1
4537
#endif
4638

39+
4740
namespace mbed {
4841
/** \addtogroup platform-public-api */
4942
/** @{*/
@@ -842,6 +835,4 @@ Callback(R(*func)(const volatile T *, ArgTs...), const volatile U *arg) -> Callb
842835

843836
} // namespace mbed
844837

845-
#pragma GCC pop_options
846-
847838
#endif

edge.variables

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export FLAVOUR="edge"
22
export VARIANTS=("EDGE_CONTROL")
33
export FQBNS=("edge_control")
4-
export LIBRARIES=("PDM SPI Wire MRI USBHID USBMSD ThreadDebug Scheduler")
4+
export LIBRARIES=("SocketWrapper GSM GPS SPI Wire MRI USBHID USBMSD ThreadDebug Scheduler")
55
export BOOTLOADERS=("EDGE_CONTROL")

libraries/GPS/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ sentence=GPS Support Library
66
paragraph=
77
category=Other
88
url=http://www.arduino.cc/en/Reference/GSM
9-
architectures=mbed,ArduinoCore-mbed,mbed_portenta
9+
architectures=mbed,ArduinoCore-mbed,mbed_portenta,mbed_edge

libraries/GSM/examples/GNSSClient/GNSSClient.ino

+11
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ char username[] = SECRET_USERNAME;
88
char pass[] = SECRET_PASSWORD;
99

1010
void setup() {
11+
12+
#if defined(ARDUINO_EDGE_CONTROL)
13+
// Power ON MKR2
14+
pinMode(ON_MKR2, OUTPUT);
15+
digitalWrite(ON_MKR2, HIGH);
16+
#endif
17+
1118
Serial.begin(115200);
1219
while (!Serial) {}
1320

21+
// To enable AT Trace debug uncomment the following lines
22+
//GSM.trace(Serial);
23+
//GSM.setTraceLevel(4);
24+
1425
Serial.println("Starting Carrier Network registration");
1526
if(!GSM.begin(pin, apn, username, pass, CATNB)){
1627
Serial.println("The board was not able to register to the network...");

libraries/GSM/examples/GSMClient/GSMClient.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <GSM.h>
22

3-
REDIRECT_STDOUT_TO(Serial);
4-
53
#include "arduino_secrets.h"
64
char pin[] = SECRET_PIN;
75
char apn[] = SECRET_APN;
@@ -14,8 +12,20 @@ int port = 80;
1412
GSMClient client;
1513

1614
void setup() {
15+
16+
#if defined(ARDUINO_EDGE_CONTROL)
17+
// Power ON MKR2
18+
pinMode(ON_MKR2, OUTPUT);
19+
digitalWrite(ON_MKR2, HIGH);
20+
#endif
21+
1722
Serial.begin(115200);
1823
while(!Serial) {}
24+
25+
// To enable AT Trace debug uncomment the following lines
26+
//GSM.trace(Serial);
27+
//GSM.setTraceLevel(4);
28+
1929
Serial.println("Starting Carrier Network registration");
2030
if(!GSM.begin(pin, apn, username, pass, CATNB, BAND_20 | BAND_19)){
2131
Serial.println("The board was not able to register to the network...");

libraries/GSM/examples/GSMSSLClient/GSMSSLClient.ino

+23-4
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,46 @@
11
/*
22
GSMSSLlient
33
4-
This sketch connects to a website (https://ifconfig.me)
4+
This sketch connects to a website (https://example.com)
55
using the Portenta CAT.M1/NB IoT GNSS Shield and TLS.
66
77
*/
88

99
#include <GSM.h>
10-
1110
#include "arduino_secrets.h"
11+
12+
#if defined(ARDUINO_EDGE_CONTROL)
13+
#include "root_ca.h"
14+
#endif
15+
1216
char pin[] = SECRET_PIN;
1317
char apn[] = SECRET_APN;
1418
char username[] = SECRET_USERNAME;
1519
char pass[] = SECRET_PASSWORD;
1620

17-
const char server[] = "ifconfig.me";
21+
const char server[] = "example.com";
1822
const char* ip_address;
1923
int port = 443;
2024
GSMSSLClient client;
2125

2226
void setup() {
27+
28+
#if defined(ARDUINO_EDGE_CONTROL)
29+
// Power ON MKR2
30+
pinMode(ON_MKR2, OUTPUT);
31+
digitalWrite(ON_MKR2, HIGH);
32+
33+
// Configure root certificate
34+
client.appendCustomCACert(root_ca);
35+
#endif
36+
2337
Serial.begin(115200);
2438
while(!Serial) {}
39+
40+
// To enable AT Trace debug uncomment the following lines
41+
//GSM.trace(Serial);
42+
//GSM.setTraceLevel(4);
43+
2544
Serial.println("Starting Carrier Network registration");
2645
if(!GSM.begin(pin, apn, username, pass, CATM1, BAND_3 | BAND_20 | BAND_19)){
2746
Serial.println("The board was not able to register to the network...");
@@ -33,7 +52,7 @@ void setup() {
3352
if (client.connect(server, port)) {
3453
Serial.println("connected to server");
3554
// Make a HTTP request:
36-
client.println("GET /ip HTTP/1.1");
55+
client.println("GET / HTTP/1.1");
3756
client.print("Host: ");
3857
client.println(server);
3958
client.println("Connection: close");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
static const char root_ca[] =
2+
"-----BEGIN CERTIFICATE-----\n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1eXkIoyQY/Esr\n"
18+
"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
19+
"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
20+
"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
21+
"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
22+
"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
23+
"-----END CERTIFICATE-----\n";

libraries/GSM/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ sentence=GSM wrapper
66
paragraph=
77
category=Other
88
url=http://www.arduino.cc/en/Reference/GSM
9-
architectures=mbed,ArduinoCore-mbed,mbed_portenta
9+
architectures=mbed,ArduinoCore-mbed,mbed_portenta,mbed_edge

libraries/GSM/src/GSM.h

+2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ class GSMClass : public MbedSocketClass {
108108
bool setTime(unsigned long const epoch, int const timezone = 0);
109109
void enableCmux();
110110
bool isCmuxEnable();
111+
#if MBED_CONF_MBED_TRACE_ENABLE
111112
void trace(Stream& stream);
112113
void setTraceLevel(int trace_level, bool timestamp = false);
114+
#endif
113115
int ping(const char* hostname, uint8_t ttl = 128);
114116
int ping(const String& hostname, uint8_t ttl = 128);
115117
int ping(IPAddress host, uint8_t ttl = 128);

libraries/Scheduler/examples/MultipleBlinks/MultipleBlinks.ino

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
#define led2 LEDG
4444
#define led3 LEDB
4545

46+
// On Edge Control there are no leds so we use GPIO and Serial
47+
#elif defined(ARDUINO_EDGE_CONTROL)
48+
49+
#define led1 CMD_TRIAC_3
50+
#define led2 CMD_TRIAC_4
51+
#define led3 NOT_A_PIN
52+
4653
#else
4754

4855
int led1 = LEDR;

libraries/SocketWrapper/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ sentence=Wrapper for mbed Socket classes
66
paragraph=
77
category=Other
88
url=http://www.arduino.cc/en/Reference/WiFi
9-
architectures=mbed,ArduinoCore-mbed,mbed_portenta,mbed_nicla,mbed_opta,mbed_giga
9+
architectures=mbed,ArduinoCore-mbed,mbed_portenta,mbed_nicla,mbed_opta,mbed_giga,mbed_edge

variants/EDGE_CONTROL/defines.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
-DFEATURE_STORAGE=1
3939
-D__FPU_PRESENT=1
4040
-D__MBED__=1
41-
-DMBED_BUILD_TIMESTAMP=1690447154.5646534
41+
-DMBED_BUILD_TIMESTAMP=1700127377.3953335
4242
-D__MBED_CMSIS_RTOS_CM
4343
-DMBED_MPU_CUSTOM
4444
-DMBED_TICKLESS

variants/EDGE_CONTROL/includes.txt

+27
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,33 @@
9494
-iwithprefixbefore/mbed/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source
9595
-iwithprefixbefore/mbed/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver
9696
-iwithprefixbefore/mbed/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x
97+
-iwithprefixbefore/mbed/connectivity/drivers/cellular
98+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/Altair
99+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/Altair/ALT1250
100+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/Altair/ALT1250/PPP
101+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/GEMALTO
102+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/GEMALTO/CINTERION
103+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/GENERIC
104+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP
105+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/MultiTech
106+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/MultiTech/DragonflyNano
107+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP
108+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/QUECTEL
109+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/QUECTEL/BC95
110+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/QUECTEL/BG96
111+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/QUECTEL/EC2X
112+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/QUECTEL/M26
113+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/QUECTEL/UG96
114+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/RiotMicro
115+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/RiotMicro/AT
116+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/TELIT
117+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/TELIT/HE910
118+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/TELIT/ME310
119+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/TELIT/ME910
120+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/UBLOX
121+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/UBLOX/AT
122+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/UBLOX/N2XX
123+
-iwithprefixbefore/mbed/connectivity/drivers/cellular/UBLOX/PPP
97124
-iwithprefixbefore/mbed/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310
98125
-iwithprefixbefore/mbed/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840
99126
-iwithprefixbefore/mbed/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/include

variants/EDGE_CONTROL/libs/libmbed.a

771 KB
Binary file not shown.

0 commit comments

Comments
 (0)