Merge pull request #11642 from jeromecoutant/PR_CELLULAR_FC

STMOD_CELLULAR: remove flow control support for DISCO_L4R9I
pull/11694/head
Martin Kojtal 2019-10-16 14:24:55 +08:00 committed by GitHub
commit a0dfcfb18f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 7 deletions

View File

@ -43,7 +43,6 @@ Here is the used mbed_app.json:
}, },
"target_overrides": { "target_overrides": {
"DISCO_L496AG": { "DISCO_L496AG": {
"target.macros_add": ["CELLULAR_DEVICE=STModCellular"],
"target.components_add": ["STMOD_CELLULAR"], "target.components_add": ["STMOD_CELLULAR"],
"stmod_cellular.provide-default": "true" "stmod_cellular.provide-default": "true"
} }
@ -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) 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

View File

@ -109,7 +109,6 @@ nsapi_error_t STModCellular::soft_power_on()
tr_debug("Modem %sready to receive AT commands\r\n", rdy ? "" : "NOT "); 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)) { if ((MBED_CONF_STMOD_CELLULAR_CTS != NC) && (MBED_CONF_STMOD_CELLULAR_RTS != NC)) {
tr_debug("Enable flow control\r\n"); tr_debug("Enable flow control\r\n");
@ -133,7 +132,6 @@ nsapi_error_t STModCellular::soft_power_on()
tr_error("Failed to enable hw flow control\r\n"); tr_error("Failed to enable hw flow control\r\n");
} }
} }
#endif
rtos::ThisThread::sleep_for(500); rtos::ThisThread::sleep_for(500);
@ -165,10 +163,10 @@ CellularDevice *CellularDevice::get_default_instance()
tr_debug("MODEM default instance\r\n"); 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); 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) 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); 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); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_STMOD_CELLULAR_RTS, MBED_CONF_STMOD_CELLULAR_CTS);
#endif }
static STModCellular device(&serial); static STModCellular device(&serial);
return &device; return &device;
} }

View File

@ -65,5 +65,10 @@
"help": "Provide as default CellularDevice [true/false]", "help": "Provide as default CellularDevice [true/false]",
"value": false "value": false
} }
},
"target_overrides": {
"DISCO_L4R9I": {
"rts": "NC"
}
} }
} }