diff --git a/features/cellular/framework/common/CellularTargets.h b/features/cellular/framework/common/CellularTargets.h index feb330efa8..2ffb377c4f 100644 --- a/features/cellular/framework/common/CellularTargets.h +++ b/features/cellular/framework/common/CellularTargets.h @@ -32,7 +32,7 @@ namespace mbed { #elif TARGET_MTB_MTS_DRAGONFLY #define CELLULAR_DEVICE TELIT_HE910 #elif TARGET_UBLOX_C030 -#if defined(TARGET_UBLOX_C030_N211) || defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_N211) || defined(TARGET_UBLOX_C030_R41XM) #define CELLULAR_DEVICE UBLOX_AT #else #define CELLULAR_DEVICE UBLOX_PPP diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp index 86e4b72be3..5532b45b93 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp @@ -23,7 +23,7 @@ using namespace mbed; using namespace events; -#ifdef TARGET_UBLOX_C030_R410M +#ifdef TARGET_UBLOX_C030_R41XM static const AT_CellularBase::SupportedFeature unsupported_features[] = { AT_CellularBase::AT_CGSN_WITH_TYPE, AT_CellularBase::SUPPORTED_FEATURE_END_MARK @@ -32,7 +32,7 @@ static const AT_CellularBase::SupportedFeature unsupported_features[] = { UBLOX_AT::UBLOX_AT(FileHandle *fh) : AT_CellularDevice(fh) { -#ifdef TARGET_UBLOX_C030_R410M +#ifdef TARGET_UBLOX_C030_R41XM AT_CellularBase::set_unsupported_features(unsupported_features); #endif } diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp index 240710239e..c06cf6d119 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp @@ -50,7 +50,7 @@ void UBLOX_AT_CellularContext::do_connect() _cb_data.error = NSAPI_ERROR_NO_CONNECTION; // Attempt to establish a connection -#ifdef TARGET_UBLOX_C030_R410M +#ifdef TARGET_UBLOX_C030_R41XM _cb_data.error = NSAPI_ERROR_OK; #else _cb_data.error = open_data_channel(); diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp index 85b06a4c7e..1491deee60 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp @@ -54,10 +54,10 @@ nsapi_error_t UBLOX_AT_CellularNetwork::set_access_technology_impl(RadioAccessTe break; case RAT_HSDPA_HSUPA: break; -#elif defined(TARGET_UBLOX_C030_R410M) +#elif defined(TARGET_UBLOX_C030_R41XM) case RAT_CATM1: break; -#elif defined(TARGET_UBLOX_C030_R410M) || defined(TARGET_UBLOX_C030_N211) +#elif defined(TARGET_UBLOX_C030_R41XM) || defined(TARGET_UBLOX_C030_N211) case RAT_NB1: break; #endif diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PeripheralPins.c b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PeripheralPins.c index 0c2110186c..051b5ebb3d 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PeripheralPins.c +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PeripheralPins.c @@ -42,6 +42,9 @@ const PinMap PinMap_ADC[] = { {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 +#ifdef TARGET_UBLOX_C030_R412M + {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 +#endif {PC_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 {PC_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 {PC_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 @@ -80,7 +83,9 @@ const PinMap PinMap_DAC[] = { const PinMap PinMap_PWM[] = { {PE_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 {PE_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1N +#ifndef TARGET_UBLOX_C030_R412M {PB_1, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 +#endif {PD_12, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 {PB_8, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 {PB_15, PWM_12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2 diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PinNames.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PinNames.h index 3e7b07f08d..f60447d8cf 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/PinNames.h @@ -82,7 +82,7 @@ typedef enum { // Cellular modem (a DCE) MDMPWRON = PE_14, // Power (active high) MDMRST = PB_5, // Reset (active low) -#if defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_R41XM) MDMTXD = PA_9, // Transmit Data MDMRXD = PA_10, // Receive Data MDMCTS = PA_11, // Clear to Send @@ -165,7 +165,7 @@ typedef enum { #ifdef MBED_CONF_TARGET_STDIO_UART_TX STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX, #else -#if defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_R41XM) STDIO_UART_TX = PD_5, #else STDIO_UART_TX = PA_9, @@ -174,7 +174,7 @@ typedef enum { #ifdef MBED_CONF_TARGET_STDIO_UART_RX STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX, #else -#if defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_R41XM) STDIO_UART_RX = PD_6, #else STDIO_UART_RX = PA_10, diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/onboard_modem_api.c b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/onboard_modem_api.c index 00281d2511..52b01ab155 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/onboard_modem_api.c +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/TARGET_UBLOX_C030/onboard_modem_api.c @@ -28,7 +28,7 @@ static void press_power_button(int time_us) { gpio_t gpio; -#if defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_R41XM) gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 0); #else gpio_init_out_ex(&gpio, MDMPWRON, 0); @@ -42,21 +42,28 @@ void onboard_modem_init() { gpio_t gpio; +#if defined(TARGET_UBLOX_C030_R41XM) + // Set the pin to high so on powerup we can set low + gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1); +#else // Take us out of reset gpio_init_out_ex(&gpio, MDMRST, 1); +#endif } void onboard_modem_deinit() { +#ifndef TARGET_UBLOX_C030_R41XM gpio_t gpio; // Back into reset gpio_init_out_ex(&gpio, MDMRST, 0); +#endif } void onboard_modem_power_up() { -#if defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_R41XM) /* keep the power line low for 1 seconds */ press_power_button(1000000); #else 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 d2b01c7c6b..6df2aaf2b5 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 @@ -26,7 +26,7 @@ void ublox_board_init(void) { // start with modem disabled gpio_init_out_ex(&gpio, MDMRST, 0); -#if defined(TARGET_UBLOX_C030_R410M) +#if defined(TARGET_UBLOX_C030_R41XM) gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1); #else gpio_init_out_ex(&gpio, MDMPWRON, 0); @@ -34,8 +34,8 @@ void ublox_board_init(void) { gpio_init_out_ex(&gpio, MDMRTS, 0); gpio_init_in_ex(&gpio, MDMCURRENTSENSE, PullNone); -#if !defined (TARGET_UBLOX_C030_R410M) - // start with GNSS disabled, this is ONLY TEMPORARY and that once the HW issue with the GNSSEN pin on the R410M board is resolved then this line will become default for all platforms. +#if !defined (TARGET_UBLOX_C030_R41XM) + // start with GNSS disabled, this is ONLY TEMPORARY and that once the HW issue with the GNSSEN pin on the R41XM board is resolved then this line will become default for all platforms. gpio_init_inout(&gpio, GNSSEN, PIN_OUTPUT, PushPullNoPull, 0); #endif diff --git a/targets/targets.json b/targets/targets.json index 0b0b03dbd3..50df37975e 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -4281,10 +4281,18 @@ "inherits": ["UBLOX_C030"], "release_versions": ["5"] }, - "UBLOX_C030_R410M": { + "UBLOX_C030_R41XM": { "inherits": ["UBLOX_C030"], "release_versions": ["5"] }, + "UBLOX_C030_R410M": { + "inherits": ["UBLOX_C030_R41XM"], + "release_versions": ["5"] + }, + "UBLOX_C030_R412M": { + "inherits": ["UBLOX_C030_R41XM"], + "release_versions": ["5"] + }, "NZ32_SC151": { "inherits": ["FAMILY_STM32"], "core": "Cortex-M3",