From c9aead485b247b95625a8fb109124f9e03a59258 Mon Sep 17 00:00:00 2001 From: jeromecoutant Date: Tue, 28 Jan 2020 13:08:17 +0100 Subject: [PATCH] STMOD_CELLULAR: add DISCO_L562_QE support --- .../COMPONENT_STMOD_CELLULAR/README.md | 18 ++++++++++++++++++ .../COMPONENT_STMOD_CELLULAR/STModCellular.cpp | 11 +++++++++++ .../COMPONENT_STMOD_CELLULAR/STModCellular.h | 4 ++++ .../COMPONENT_STMOD_CELLULAR/mbed_lib.json | 3 +++ 4 files changed, 36 insertions(+) diff --git a/components/cellular/COMPONENT_STMOD_CELLULAR/README.md b/components/cellular/COMPONENT_STMOD_CELLULAR/README.md index 7f34720fa3..4ce80705f0 100644 --- a/components/cellular/COMPONENT_STMOD_CELLULAR/README.md +++ b/components/cellular/COMPONENT_STMOD_CELLULAR/README.md @@ -121,6 +121,24 @@ Default HW configuration: BG96 expansion board can be used but without flow control. +### DISCO_L562_QE + +https://os.mbed.com/platforms/ST-Discovery-L562QE/ + +HW configuration: + +Depending on PF_11 and PF_12 GPIO configuration, STMOD pins 1, 2, 3 and 4 can be mapped to SPI3 or UART3. + +STModCellular default init procedure is setting the correct values in order to get full UART connectivity. + +See in mbed-trace: +``` +[INFO][STMOD]: STModCellular creation +[INFO][STMOD]: STMOD+ UART pins re-configuration +``` + +BG96 expansion board is then fully compatible. + ### DISCO_H747I https://os.mbed.com/platforms/ST-Discovery-H747I/ diff --git a/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp b/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp index 568d46efbd..5dce516a91 100644 --- a/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp +++ b/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.cpp @@ -24,6 +24,10 @@ using namespace mbed; STModCellular::STModCellular(FileHandle *fh) : STMOD_CELLULAR_MODEM(fh), +#if defined(TARGET_DISCO_L562QE) + STMOD_SEL_12(PF_11), + STMOD_SEL_34(PF_12), +#endif m_powerkey(MBED_CONF_STMOD_CELLULAR_POWER), m_reset(MBED_CONF_STMOD_CELLULAR_RESET), m_simsel0(MBED_CONF_STMOD_CELLULAR_SIMSEL0), @@ -35,6 +39,13 @@ STModCellular::STModCellular(FileHandle *fh) : STMOD_CELLULAR_MODEM(fh), { tr_info("STModCellular creation"); +#if defined(TARGET_DISCO_L562QE) + /* See PinNames.h file, STMOD+ pins are configurable */ + STMOD_SEL_12 = 1; + STMOD_SEL_34 = 1; + tr_info("STMOD+ UART pins re-configuration"); +#endif + // start with modem disabled m_powerkey.write(0); m_reset.write(1); diff --git a/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.h b/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.h index 8271864f02..67af4e937d 100644 --- a/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.h +++ b/components/cellular/COMPONENT_STMOD_CELLULAR/STModCellular.h @@ -48,6 +48,10 @@ private: DigitalIn m_sim_reset; DigitalIn m_sim_clk; DigitalIn m_sim_data; +#if defined(TARGET_DISCO_L562QE) + DigitalOut STMOD_SEL_12; + DigitalOut STMOD_SEL_34; +#endif public: STModCellular(FileHandle *fh); virtual nsapi_error_t soft_power_on(); diff --git a/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json b/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json index ec5c02537b..509602c7ad 100644 --- a/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json +++ b/components/cellular/COMPONENT_STMOD_CELLULAR/mbed_lib.json @@ -69,6 +69,9 @@ "target_overrides": { "DISCO_L4R9I": { "rts": "NC" + }, + "DISCO_L562QE": { + "rts": "PD_2" } } }