Skip to content

STMOD_CELLULAR: remove flow control support for DISCO_L4R9I #11642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion components/cellular/COMPONENT_STMOD_CELLULAR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Here is the used mbed_app.json:
},
"target_overrides": {
"DISCO_L496AG": {
"target.macros_add": ["CELLULAR_DEVICE=STModCellular"],
"target.components_add": ["STMOD_CELLULAR"],
"stmod_cellular.provide-default": "true"
}
Expand All @@ -70,3 +69,33 @@ mbed compile -t GCC_ARM -m DISCO_L496AG --flash
````

Then check the serial console (serial baudrate set to 115200 bit/s)

## Board with STMOD+ Connector

### DISCO_L496AG

https://os.mbed.com/platforms/ST-Discovery-L496AG/

Default HW configuration:
- STMOD pins 1, 2, 3 and 4 are mapped to UART CTS/TX/RX/RTS

BG96 expansion board is fully compatible.

### DISCO_L4R9I

https://os.mbed.com/platforms/DISCO-L4R9I/

Default HW configuration:
- STMOD pins 1 and 2 are mapped to SPI
- STMOD pins 2 and 3 are mapped to UART TX/RX

BG96 expansion board can be used but without flow control.

### DISCO_H747I

https://os.mbed.com/platforms/ST-Discovery-H747I/

Default HW configuration:
- STMOD pins 1, 2, 3 and 4 are mapped to SPI

BG96 expansion board can not be used without solder bridges update
10 changes: 4 additions & 6 deletions components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ nsapi_error_t STModCellular::soft_power_on()

tr_debug("Modem %sready to receive AT commands\r\n", rdy ? "" : "NOT ");

#if DEVICE_SERIAL_FC
if ((MBED_CONF_STMOD_CELLULAR_CTS != NC) && (MBED_CONF_STMOD_CELLULAR_RTS != NC)) {
tr_debug("Enable flow control\r\n");

Expand All @@ -131,7 +130,6 @@ nsapi_error_t STModCellular::soft_power_on()
tr_error("Failed to enable hw flow control\r\n");
}
}
#endif

rtos::ThisThread::sleep_for(500);

Expand Down Expand Up @@ -163,10 +161,10 @@ CellularDevice *CellularDevice::get_default_instance()
tr_debug("MODEM default instance\r\n");

static UARTSerial serial(MBED_CONF_STMOD_CELLULAR_TX, MBED_CONF_STMOD_CELLULAR_RX, MBED_CONF_STMOD_CELLULAR_BAUDRATE);
#if defined (MBED_CONF_STMOD_CELLULAR_RTS) && defined(MBED_CONF_STMOD_CELLULAR_CTS)
tr_debug("STMOD_CELLULAR flow control: RTS %d CTS %d\r\n", MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS);
serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS);
#endif
if ((MBED_CONF_STMOD_CELLULAR_CTS != NC) && (MBED_CONF_STMOD_CELLULAR_RTS != NC)) {
tr_debug("STMOD_CELLULAR flow control: RTS %d CTS %d\r\n", MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS);
serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS);
}
static STModCellular device(&serial);
return &device;
}
Expand Down
5 changes: 5 additions & 0 deletions components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,10 @@
"help": "Provide as default CellularDevice [true/false]",
"value": false
}
},
"target_overrides": {
"DISCO_L4R9I": {
"rts": "NC"
}
}
}