Skip to content

STMOD_CELLULAR: readme file additional information #10921

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
Jul 2, 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
63 changes: 61 additions & 2 deletions components/cellular/COMPONENT_STMOD_CELLULAR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,69 @@ This library allows enabling the cellular module that is connected to the STMOD+

## Supported modems.

Currently supported cellular modules are Quectel UG96 and BG96 expansion boards that are included in [p-l496g-cell01] (https://www.st.com/en/evaluation-tools/p-l496g-cell01.html) and [p-l496g-cell02.] (https://www.st.com/en/evaluation-tools/p-l496g-cell02.html) packs.
Currently supported cellular modules are Quectel UG96 and BG96 expansion boards that are included in [p-l496g-cell01](https://www.st.com/en/evaluation-tools/p-l496g-cell01.html)
and [p-l496g-cell02](https://www.st.com/en/evaluation-tools/p-l496g-cell02.html) packs.

## Specifications

The STMOD+ Connector specification can be found [here] (https://www.st.com/content/ccc/resource/technical/document/technical_note/group0/04/7f/90/c1/ad/54/46/1f/DM00323609/files/DM00323609.pdf/jcr:content/translations/en.DM00323609.pdf).
The STMOD+ Connector specification can be found [here](https://www.st.com/content/ccc/resource/technical/document/technical_note/group0/04/7f/90/c1/ad/54/46/1f/DM00323609/files/DM00323609.pdf/jcr:content/translations/en.DM00323609.pdf).

## Cellular tests in mbed-os

- features-cellular-tests-api-cellular_device
- features-cellular-tests-api-cellular_information
- features-cellular-tests-api-cellular_network
- features-cellular-tests-api-cellular_sms
- features-cellular-tests-socket-udp

Here is the used mbed_app.json:

````
{
"config": {
"cellular-sim-pin" : {
"help": "PIN code",
"value": "\"1234\""
},
"apn": {
"help": "The APN string to use for this SIM/network, set to 0 if none",
"value": "\"APN\""
},
"username": {
"help": "The user name string to use for this APN, set to zero if none",
"value": 0
},
"password": {
"help": "The password string to use for this APN, set to 0 if none",
"value": 0
}
},
"target_overrides": {
"DISCO_L496AG": {
"target.macros_add": ["CELLULAR_DEVICE=STModCellular"],
"target.components_add": ["STMOD_CELLULAR"],
"stmod_cellular.provide-default": "true"
}
}
}
````


````
$ mbed test -t ARM -m DISCO_L496AG -v -n features-cellular-*
````

## Cellular mbed-os example

https://github.com/ARMmbed/mbed-os-example-cellular

````
mbed import mbed-os-example-cellular
cd mbed-os-example-cellular

<edit mbed_app.json file as explained in the example: APN, PIN,... >

mbed compile -t GCC_ARM -m DISCO_L496AG --flash
````

Then check the serial console (serial baudrate set to 115200 bit/s)
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ nsapi_error_t STModCellular::soft_power_on()
_at->restore_at_timeout();
_at->unlock();

tr_debug("Modem %sready to receive AT commands", 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)) {
Expand All @@ -126,9 +126,9 @@ nsapi_error_t STModCellular::soft_power_on()
_at->unlock();

if (err == NSAPI_ERROR_OK) {
tr_debug("Flow control turned ON");
tr_debug("Flow control turned ON\r\n");
} else {
tr_error("Failed to enable hw flow control");
tr_error("Failed to enable hw flow control\r\n");
}
}
#endif
Expand Down Expand Up @@ -164,7 +164,7 @@ CellularDevice *CellularDevice::get_default_instance()

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", 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);
#endif
static STModCellular device(&serial);
Expand Down