Skip to content

C030 R410M Target Added #5957

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
Feb 26, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ typedef enum {
// Cellular modem (a DCE)
MDMPWRON = PE_14, // Power (active high)
MDMRST = PB_5, // Reset (active low)
#if defined(TARGET_UBLOX_C030_R410M)
MDMTXD = PA_9, // Transmit Data
MDMRXD = PA_10, // Receive Data
MDMCTS = PA_11, // Clear to Send
MDMRTS = PA_12, // Request to Send
#else
MDMTXD = PD_5, // Transmit Data
MDMRXD = PD_6, // Receive Data
MDMCTS = PD_3, // Clear to Send
MDMRTS = PD_4, // Request to Send
#endif
MDMDCD = NC, // DCD line not connected
MDMDSR = NC, // DSR line not connected
MDMDTR = NC, // DTR line not connected
Expand Down Expand Up @@ -148,13 +155,21 @@ typedef enum {
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
#if defined(TARGET_UBLOX_C030_R410M)
STDIO_UART_TX = PD_5,
#else
STDIO_UART_TX = PA_9,
#endif
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
#if defined(TARGET_UBLOX_C030_R410M)
STDIO_UART_RX = PD_6,
#else
STDIO_UART_RX = PA_10,
#endif
#endif

// ST-Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ static void press_power_button(int time_us)
{
gpio_t gpio;

#if defined(TARGET_UBLOX_C030_R410M)
gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 0);
#else
gpio_init_out_ex(&gpio, MDMPWRON, 0);
#endif

wait_us(time_us);
gpio_write(&gpio, 1);
}
Expand All @@ -51,16 +56,27 @@ void onboard_modem_deinit()

void onboard_modem_power_up()
{
/* keep the power line low for 50 microseconds */
#if defined(TARGET_UBLOX_C030_R410M)
/* keep the power line low for 1 seconds */
press_power_button(1000000);
#else
/* keep the power line low for 50 microseconds */
press_power_button(50);
#endif

/* give modem a little time to respond */
wait_ms(100);
}

void onboard_modem_power_down()
{
/* keep the power line low for 1 second */
#if defined(TARGET_UBLOX_C030_R410M)
/* keep the power line low for 1.5 seconds */
press_power_button(1500000);
#else
/* keep the power line low for 1 seconds */
press_power_button(1000000);
#endif
}

#endif //MODEM_ON_BOARD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ void ublox_board_init(void) {

// start with modem disabled
gpio_init_out_ex(&gpio, MDMRST, 0);
#if defined(TARGET_UBLOX_C030_R410M)
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);

// start with GNSS disabled
#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.
gpio_init_inout(&gpio, GNSSEN, PIN_OUTPUT, PushPullNoPull, 0);
#endif

// power on SD card
gpio_init_out_ex(&gpio, SDPWRON, 1);
Expand Down
4 changes: 4 additions & 0 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,10 @@
"inherits": ["UBLOX_C030"],
"release_versions": ["5"]
},
"UBLOX_C030_R410M": {
"inherits": ["UBLOX_C030"],
"release_versions": ["5"]
},
"NZ32_SC151": {
"inherits": ["FAMILY_STM32"],
"core": "Cortex-M3",
Expand Down