@@ -46,10 +46,26 @@ mbed::CellularDevice *mbed::CellularDevice::get_default_instance()
4646
4747int arduino::GSMClass::begin (const char * pin, const char * apn, const char * username, const char * password, RadioAccessTechnologyType rat, uint32_t band, bool restart) {
4848
49+ /* Assume module is powered ON. Uncomment this line is you are using
50+ * Edge Control without Arduino_ConnectionHandler
51+ * #if defined (ARDUINO_EDGE_CONTROL)
52+ * pinMode(ON_MKR2, OUTPUT);
53+ * digitalWrite(ON_MKR2, HIGH);
54+ * #endif
55+ */
56+
57+ /* Ensure module is not under reset */
58+ pinMode (MBED_CONF_GEMALTO_CINTERION_RST, OUTPUT);
59+ digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, LOW);
60+
61+ /* Reset module if needed */
4962 if (restart || isCmuxEnable ()) {
5063 reset ();
5164 }
5265
66+ /* Create rising edge on pin ON */
67+ on ();
68+
5369 if (!_context) {
5470 _context = mbed::CellularContext::get_default_instance ();
5571 }
@@ -59,9 +75,10 @@ int arduino::GSMClass::begin(const char* pin, const char* apn, const char* usern
5975 return 0 ;
6076 }
6177
62- pinMode (MBED_CONF_GEMALTO_CINTERION_ON, INPUT_PULLDOWN);
63-
78+ # if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
79+ /* This is needed to wakeup module if hw flow control is enabled */
6480 static mbed::DigitalOut rts (MBED_CONF_GEMALTO_CINTERION_RTS, 0 );
81+ #endif
6582
6683 _device = _context->get_device ();
6784 _device->modem_debug_on (_at_debug);
@@ -159,10 +176,15 @@ NetworkInterface* arduino::GSMClass::getNetwork() {
159176}
160177
161178void arduino::GSMClass::reset () {
179+ /* Reset logic is inverted */
162180 pinMode (MBED_CONF_GEMALTO_CINTERION_RST, OUTPUT);
163181 digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, HIGH);
164182 delay (800 );
165183 digitalWrite (MBED_CONF_GEMALTO_CINTERION_RST, LOW);
184+ }
185+
186+ void arduino::GSMClass::on () {
187+ /* Module needs a rising edge to power on */
166188 pinMode (MBED_CONF_GEMALTO_CINTERION_ON, OUTPUT);
167189 digitalWrite (MBED_CONF_GEMALTO_CINTERION_ON, LOW);
168190 delay (1 );
@@ -171,6 +193,4 @@ void arduino::GSMClass::reset() {
171193}
172194
173195
174-
175-
176196arduino::GSMClass GSM;
0 commit comments