mirror of https://github.com/ARMmbed/mbed-os.git
fixing onboard modem init bug on mts dragonfly l471
parent
c98f402e6c
commit
72901a9440
|
@ -46,6 +46,7 @@ void onboard_modem_init()
|
||||||
gpio_init_inout(&gpio, RADIO_PWR, PIN_OUTPUT, PushPullNoPull, 1);
|
gpio_init_inout(&gpio, RADIO_PWR, PIN_OUTPUT, PushPullNoPull, 1);
|
||||||
gpio_init_inout(&gpio, BUF_EN, PIN_OUTPUT, OpenDrainNoPull, 0);
|
gpio_init_inout(&gpio, BUF_EN, PIN_OUTPUT, OpenDrainNoPull, 0);
|
||||||
gpio_init_inout(&gpio, MDMRST, PIN_OUTPUT, OpenDrainNoPull, 1);
|
gpio_init_inout(&gpio, MDMRST, PIN_OUTPUT, OpenDrainNoPull, 1);
|
||||||
|
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrainNoPull, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onboard_modem_deinit()
|
void onboard_modem_deinit()
|
||||||
|
@ -53,11 +54,14 @@ void onboard_modem_deinit()
|
||||||
gpio_t gpio;
|
gpio_t gpio;
|
||||||
|
|
||||||
// Back into reset
|
// Back into reset
|
||||||
gpio_init_inout(&gpio, RADIO_PWR, PIN_OUTPUT, PushPullNoPull, 0);
|
|
||||||
gpio_init_inout(&gpio, BUF_EN, PIN_OUTPUT, OpenDrainNoPull, 1);
|
|
||||||
gpio_init_inout(&gpio, MDMRST,PIN_OUTPUT, OpenDrainNoPull, 0);
|
gpio_init_inout(&gpio, MDMRST,PIN_OUTPUT, OpenDrainNoPull, 0);
|
||||||
|
gpio_init_inout(&gpio, BUF_EN, PIN_OUTPUT, OpenDrainNoPull, 1);
|
||||||
|
gpio_init_inout(&gpio, RADIO_PWR, PIN_OUTPUT, PushPullNoPull, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void onboard_modem_power_up()
|
void onboard_modem_power_up()
|
||||||
{
|
{
|
||||||
#if defined(TARGET_UBLOX_C030_R410M)
|
#if defined(TARGET_UBLOX_C030_R410M)
|
||||||
|
@ -65,11 +69,34 @@ void onboard_modem_power_up()
|
||||||
press_power_button(1000000);
|
press_power_button(1000000);
|
||||||
#else
|
#else
|
||||||
/* keep the power line low for 50 microseconds */
|
/* keep the power line low for 50 microseconds */
|
||||||
press_power_button(1000000);
|
gpio_t gpio;
|
||||||
|
gpio_init_in(&gpio, MON_1V8);
|
||||||
|
|
||||||
|
if(gpio_is_connected(&gpio) != 0 && gpio_read(&gpio) != 0) {
|
||||||
|
unsigned int i = 0;
|
||||||
|
while(i < 5)
|
||||||
|
{
|
||||||
|
press_power_button( 2000000);
|
||||||
|
wait_ms(1000);
|
||||||
|
onboard_modem_deinit();
|
||||||
|
wait_ms(1000);
|
||||||
|
onboard_modem_init();
|
||||||
|
wait_ms(250);
|
||||||
|
|
||||||
|
if(gpio_is_connected(&gpio) != 0 && gpio_read(&gpio) == 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
press_power_button( 2000000);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* give modem a little time to respond */
|
/* give modem a little time to respond */
|
||||||
wait_ms(100);
|
wait_ms(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onboard_modem_power_down()
|
void onboard_modem_power_down()
|
||||||
|
@ -79,7 +106,7 @@ void onboard_modem_power_down()
|
||||||
press_power_button(1500000);
|
press_power_button(1500000);
|
||||||
#else
|
#else
|
||||||
/* keep the power line low for 1 seconds */
|
/* keep the power line low for 1 seconds */
|
||||||
press_power_button(1500000);
|
press_power_button(300000);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2182,7 +2182,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"detect_code": ["0312"],
|
"detect_code": ["0312"],
|
||||||
"macros_add": [ "RTC_LSE=1"],
|
"macros_add": [ "RTC_LSE=1", "CELLULAR_DEVICE=UBLOX_PPP"],
|
||||||
"device_has_add": ["ANALOGOUT", "CAN", "LOWPOWERTIMER", "SERIAL_ASYNCH", "SERIAL_FC", "TRNG", "FLASH", "ANALOGIN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"],
|
"device_has_add": ["ANALOGOUT", "CAN", "LOWPOWERTIMER", "SERIAL_ASYNCH", "SERIAL_FC", "TRNG", "FLASH", "ANALOGIN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"],
|
||||||
"release_versions": ["2", "5"],
|
"release_versions": ["2", "5"],
|
||||||
"device_name": "STM32L471QG",
|
"device_name": "STM32L471QG",
|
||||||
|
|
Loading…
Reference in New Issue