This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, i want to work with UART on MSP 432 and i get this error:
My code is:
/******************************************************************************
* MSP432 printf example project
*
* Description: An example project to illustrate printf usage on the MSP432
* Launchpad.
* Author: Gerard Sequeira, 43oh
*******************************************************************************/
/* DriverLib Includes */
#include "driverlib.h"
/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
/* UART Configuration Parameter. These are the configuration parameters to
* make the eUSCI A UART module to operate with a 115200 baud rate. These
* values were calculated using the online calculator that TI provides
* at:
* processors.wiki.ti.com/.../
* USCI_UART_Baud_Rate_Gen_Mode_Selection
*/
const eUSCI_UART_Config uartConfig =
{
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
26, // BRDIV = 26
0, // UCxBRF = 0
0, // UCxBRS = 0
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_LSB_FIRST, // MSB First
EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
EUSCI_A_UART_MODE, // UART mode
EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION // Low Frequency Mode
};
/*
* USCIA0 interrupt handler.
*/
void EusciA0_ISR(void)
{
int receiveByte = UCA0RXBUF;
GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
/* Echo back. */
EUSCI_A_UART_transmitData(EUSCI_A0_BASE, receiveByte);
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
}
int main(void)
{
/* Halting WDT and disabling master interrupts */
WDTCTL = WDTPW | WDTHOLD; // Stop WDT
/* Initialize main clock to 3MHz */
MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_3);
CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1 );
/* Selecting P1.0 as output (LED). */
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
GPIO_PIN0, GPIO_PRIMARY_MODULE_FUNCTION);
GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
/* Selecting P1.2 and P1.3 in UART mode. */
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
/* Configuring UART Module */
MAP_UART_initModule(EUSCI_A0_BASE, &uartConfig);
/* Enable UART module */
MAP_UART_enableModule(EUSCI_A0_BASE);
UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
Interrupt_enableInterrupt(INT_EUSCIA0);
Interrupt_enableMaster();
printf("\r\nPrintf support for the launchpad\r\n");
printf("Decimal(10) :%d\r\n", 10);
printf("Hex(10) :%x\r\n", 10);
printf("float :%f\r\n", 4.32);
/* Main while loop */
while(1)
{
MAP_PCM_gotoLPM0();
}
}
Please help me to resolve this problem.
**Attention** This is a public forum