Tool/software: TI-RTOS
I am tryuing to use uart0 as intended and to add the use of uartA3, P6.0,6.1 to communicate with another processor. I searched this forum and found an example for another pocessor that added in the additional uart. The esxample is old and some adjustments had to be mad. I did them and found that uartA0 still works but uartA3 does not. The error appears to be an unimitialized variable somewhere in the heirarchy. To simplify things I tried to convert the uartecho example from UARTA) to UART A3. When I do this I get a message on program load that states "Received exception from ROV server: Target memory read failed at address 0xffffffff length 128. This read is at an INVALID addreess according to the application map.. The application is likely either uninitialized or corrupt."
I believe that I have missed something in the conversion but cannot find it.
I am using CCSV7 and tirtos_msp43x_2_20_00_06. All the changes were made to the base uartecho example which does work.
The changes I made are below. Any help would be appreciuated. Thanks
msp430fr5994.h
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
#define EUSCI_A3_VECTOR ".int24" /* 0xFFC0 */
#else
#define EUSCI_A3_VECTOR (24 * 1u) /* 0xFFC0 */
#endif
#ifdef __ASM_HEADER__ /* Begin #defines for assembler */
#define EUSCI_A0_VECTOR ".int48" /* 0xFFF0 */
#else
#define EUSCI_A0_VECTOR (48 * 1u) /* 0xFFF0 */
#endif
Board.h
#define Board_UART3 MSP_EXP430FR5994_UARTA3
uartechoA3B.c
/* Create a UART with data processing off. */
UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 9600;
uart = UART_open(Board_UART3, &uartParams);
uartechoA3B.cfg
var hwiParams = new halHwi.Params();
hwiParams.arg = 0;
halHwi.create(24, "&UARTEUSCIA_hwiIntFxn", hwiParams);
MSP_EXP430FR5994.c
/*
* =============================== UART ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(UART_config, ".const:UART_config")
#pragma DATA_SECTION(uartEUSCIAHWAttrs, ".const:uartEUSCIAHWAttrs")
#endif
#include <ti/drivers/UART.h>
#include <ti/drivers/uart/UARTEUSCIA.h>
UARTEUSCIA_Object uartEUSCIAObjects[MSP_EXP430FR5994_UARTCOUNT];
/*
* The baudrate dividers were determined by using the MSP430 baudrate
* calculator
* software-dl.ti.com/.../index.html
*/
const UARTEUSCIA_BaudrateConfig uartEUSCIABaudrates[] = {
/* {baudrate, input clock, prescalar, UCBRFx, UCBRSx, oversampling} */
{
.outputBaudrate = 115200,
.inputClockFreq = 8000000,
.prescalar = 4,
.hwRegUCBRFx = 5,
.hwRegUCBRSx = 85,
.oversampling = 1
},
{9600, 8000000, 52, 1, 0, 1},
{9600, 32768, 3, 0, 3, 0},
};
const UARTEUSCIA_HWAttrs uartEUSCIAHWAttrs[MSP_EXP430FR5994_UARTCOUNT] = {
{
.baseAddr = EUSCI_A3_BASE,
.clockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
.bitOrder = EUSCI_A_UART_LSB_FIRST,
.numBaudrateEntries = sizeof(uartEUSCIABaudrates)/sizeof(UARTEUSCIA_BaudrateConfig),
.baudrateLUT = uartEUSCIABaudrates
},
};
const UART_Config UART_config[] = {
{
.fxnTablePtr = &UARTEUSCIA_fxnTable,
.object = &uartEUSCIAObjects[0],
.hwAttrs = &uartEUSCIAHWAttrs[0]
},
{NULL, NULL, NULL}
};
/*
* ======== MSP_EXP430FR5994_initUART ========
*/
void MSP_EXP430FR5994_initUART(void)
{
/* P6.0,1 = EUSCI_A3 TXD/RXD */
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P6,
GPIO_PIN0, GPIO_SECONDARY_MODULE_FUNCTION);
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P6,
GPIO_PIN1, GPIO_SECONDARY_MODULE_FUNCTION);
/* Initialize the UART driver */
UART_init();
}
MSP_EXP430FR5994.h
typedef enum MSP_EXP430FR5994_UARTName {
MSP_EXP430FR5994_UARTA3 = 0,
MSP_EXP430FR5994_UARTCOUNT
} MSP_EXP430FR5994_UARTName;