Skip to content

Add target C030-R412M #9369

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 1 commit into from
Jan 17, 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
2 changes: 1 addition & 1 deletion features/cellular/framework/common/CellularTargets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ 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);
#endif
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

Expand Down
10 changes: 9 additions & 1 deletion targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4273,10 +4273,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",
Expand Down