From b7b083e6a2d47a4ad0750c917514ef8de0f87724 Mon Sep 17 00:00:00 2001 From: Wajahat Abbas Date: Fri, 1 Mar 2019 15:33:26 +0500 Subject: [PATCH] do not assert MDMRST in case of SARA-R4 --- .../TARGET_UBLOX_C030/ublox_low_level_api.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/ublox_low_level_api.c b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/ublox_low_level_api.c index 6df2aaf2b5..4e10004f79 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/ublox_low_level_api.c +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/ublox_low_level_api.c @@ -24,11 +24,18 @@ void ublox_board_init(void) { // Enable power to 3V3 gpio_init_inout(&gpio, PWR3V3, PIN_OUTPUT, OpenDrain, 1); - // start with modem disabled - gpio_init_out_ex(&gpio, MDMRST, 0); #if defined(TARGET_UBLOX_C030_R41XM) + /* In case of SARA-R4, MDMRST needs to be asserted for 10 seconds before modem actually powers down. + * This means that modem is initially responsive to AT commands but powers down + * after 10 seconds unless MDMRST is de-asserted (onboard_modem_init()). + * + * This will cause confusion for application as CellularDevice::is_ready() + * will return TRUE initially and later modem will power off without any indication to application. + */ + gpio_init_out_ex(&gpio, MDMRST, 1); gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1); #else + gpio_init_out_ex(&gpio, MDMRST, 0); gpio_init_out_ex(&gpio, MDMPWRON, 0); #endif gpio_init_out_ex(&gpio, MDMRTS, 0);