[DISCO_F746NG] Fix issue with Virtual Com Port

- Add also missing two PWM signals
pull/1209/head
bcostm 2015-06-23 12:14:47 +02:00
parent bb7d4bd4db
commit a26a3299ea
4 changed files with 22 additions and 15 deletions

View File

@ -57,9 +57,9 @@ typedef enum {
UART_8 = (int)UART8_BASE
} UARTName;
#define STDIO_UART_TX PC_6
#define STDIO_UART_RX PC_7
#define STDIO_UART UART_6
#define STDIO_UART_TX PA_9
#define STDIO_UART_RX PB_7
#define STDIO_UART UART_1
typedef enum {
SPI_1 = (int)SPI1_BASE,

View File

@ -94,6 +94,8 @@ const PinMap PinMap_PWM[] = {
{PC_7, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 - ARDUINO D0
{PF_6, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - ARDUINO A5
{PF_7, PWM_11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - ARDUINO A4
{PF_8, PWM_13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 - ARDUINO A3
{PF_9, PWM_14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 - ARDUINO A2
{PH_6, PWM_12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 - ARDUINO D6
// {PI_0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 - ARDUINO D10 (used by us_ticker)
{PI_2, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4 - ARDUINO D8
@ -104,12 +106,14 @@ const PinMap PinMap_PWM[] = {
const PinMap PinMap_UART_TX[] = {
{PA_0, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // ARDUINO A0
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Virtual Com Port
{PC_6, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, // ARDUINO D1
{PF_7, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)}, // ARDUINO A4
{NC, NC, 0}
};
const PinMap PinMap_UART_RX[] = {
{PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Virtual Com Port
{PC_7, UART_6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, // ARDUINO D0
{PF_6, UART_7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART7)}, // ARDUINO A5
{NC, NC, 0}

View File

@ -286,17 +286,17 @@ typedef enum {
LED3 = PI_1,
LED4 = PI_1,
USER_BUTTON = PI_11,
SERIAL_TX = PC_6,
SERIAL_RX = PC_7,
USBTX = PC_6,
USBRX = PC_7,
I2C_SCL = PB_8,
I2C_SDA = PB_9,
SPI_MOSI = PB_15,
SPI_MISO = PB_14,
SPI_SCK = PI_1,
SPI_CS = PI_0,
PWM_OUT = PB_4,
SERIAL_TX = D1,
SERIAL_RX = D0,
USBTX = PA_9, // Virtual Com Port
USBRX = PB_7, // Virtual Com Port
I2C_SCL = D15,
I2C_SDA = D14,
SPI_MOSI = D11,
SPI_MISO = D12,
SPI_SCK = D13,
SPI_CS = D10,
PWM_OUT = D9,
// Not connected
NC = (int)0xFFFFFFFF

View File

@ -36,6 +36,7 @@
#include "pinmap.h"
#include <string.h>
#include "PeripheralPins.h"
#include "mbed_error.h"
#define UART_NUM (8)
@ -66,7 +67,9 @@ static void init_uart(serial_t *obj)
UartHandle.Init.Mode = UART_MODE_TX_RX;
}
HAL_UART_Init(&UartHandle);
if (HAL_UART_Init(&UartHandle) != HAL_OK) {
error("Cannot initialize UART");
}
}
void serial_init(serial_t *obj, PinName tx, PinName rx)