Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hi,
There is an error which always comes for the variables declared in the code of CCS. I have attached a picture of the error message which I get. I use a MAC laptop and I get this but I have also seen a couple of windows laptops do the same. Basically this happens sometimes for some variables which are declared inside the main function. If I disconnect the target then the error is gone and the msp runs with the uploaded code but this is causing problems for debugging.
#include "driverlib.h" #include <stdint.h> #include <stdbool.h> #include "printf.h" #include <stdio.h> #include <stdarg.h> #include <math.h> #include <stdlib.h> int vspfunc(char *format, ...); static volatile uint8_t rxAHigher = 0, rxALower = 0, trashA1 = 0, trashA2 = 0, rxBHigher = 0, rxBLower = 0; static uint8_t tx = 0; static uint8_t rxA = 0, rxB = 0; static float voltage1 = 0, voltage2 = 0; static char s[100]; const eUSCI_SPI_MasterConfig spiMasterConfig = { EUSCI_B_SPI_CLOCKSOURCE_SMCLK, 30000000, 30000000, EUSCI_B_SPI_MSB_FIRST, EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_B_SPI_3PIN }; const eUSCI_UART_Config uartConfig = { EUSCI_A_UART_CLOCKSOURCE_SMCLK, 16, 4, 146, EUSCI_A_UART_NO_PARITY, EUSCI_A_UART_LSB_FIRST, EUSCI_A_UART_ONE_STOP_BIT, EUSCI_A_UART_MODE, EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION }; int main(void) { WDT_A_holdTimer(); MAP_FPU_enableModule(); uint32_t i = 0; MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION); MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION); P5OUT |= BIT2; P5DIR |= BIT2; P5OUT |= BIT2; SPI_initMaster(EUSCI_B0_BASE, &spiMasterConfig); SPI_enableModule(EUSCI_B0_BASE); SPI_enableInterrupt(EUSCI_B0_BASE, EUSCI_B_SPI_RECEIVE_INTERRUPT); SPI_enableInterrupt(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT); MAP_CS_setDCOFrequency(30000000); MAP_UART_initModule(EUSCI_A0_BASE, &uartConfig); MAP_UART_enableModule(EUSCI_A0_BASE); MAP_Interrupt_enableMaster(); for(i = 0; i < 3000; i++); P5OUT &= (~BIT2); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, 0x84); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); P5OUT |= BIT2; while(1) { rxA = 0; P5OUT &= (~BIT2); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, 0x84); trashA1 = SPI_receiveData(EUSCI_B0_BASE); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); trashA2 = SPI_receiveData(EUSCI_B0_BASE); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); rxAHigher = SPI_receiveData(EUSCI_B0_BASE); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); rxALower = SPI_receiveData(EUSCI_B0_BASE); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); rxBHigher = SPI_receiveData(EUSCI_B0_BASE); while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT))); SPI_transmitData(EUSCI_B0_BASE, tx); rxBLower = SPI_receiveData(EUSCI_B0_BASE); MAP_UART_transmitData(EUSCI_A0_BASE, rxAHigher); MAP_UART_transmitData(EUSCI_A0_BASE, rxALower); MAP_UART_transmitData(EUSCI_A0_BASE, rxBHigher); MAP_UART_transmitData(EUSCI_A0_BASE, rxBLower); } } int vspfunc(char *format, ...) { va_list aptr; int ret; va_start(aptr, format); ret = vsprintf(s, format, aptr); va_end(aptr); return(ret); }