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.

FR5994 SPI initialization

Other Parts Discussed in Thread: MSP-EXP430FR5994, MSP430WARE

I have the following code implementation on a MSP-EXP430FR5994 board trying to get the B1 SPI module to function.

void initSPIComms(void)
{
	//Initialize EUSCI SPI B Master
	EUSCI_B_SPI_initMasterParam param = {0};
	param.selectClockSource = EUSCI_B_SPI_CLOCKSOURCE_ACLK;
	param.clockSourceFrequency = 10000;
	param.desiredSpiClock = 1;
	param.msbFirst = EUSCI_B_SPI_MSB_FIRST;
	param.clockPhase = EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT;
	param.clockPolarity = EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH;
	param.spiMode = EUSCI_B_SPI_3PIN;

	GPIO_setAsPeripheralModuleFunctionOutputPin(
			GPIO_PORT_P5,
			GPIO_PIN0,		//UCB1SIMO
			GPIO_PRIMARY_MODULE_FUNCTION);

	GPIO_setAsPeripheralModuleFunctionOutputPin(
				GPIO_PORT_P5,
				GPIO_PIN1,		//UCB1MISO
				GPIO_PRIMARY_MODULE_FUNCTION);

	GPIO_setAsOutputPin(CSnRadioPort,CSnRadioPin);

	EUSCI_B_SPI_initMaster(EUSCI_B1_BASE, &param);

	//Enable SPI Module
	EUSCI_B_SPI_enable(EUSCI_B1_BASE);
}

When I run the code it goes off into the weeds on the EUSCI_B_SPI_initMaster(EUSCI_B1_BASE, &param); call. I was single stepping through and it ends up in the following area:

void *memcpy(void *to, const void *from, size_t n)
{
     register char *rto   = (char *) to;
     register char *rfrom = (char *) from;
     register size_t rn;

     for (rn = 0; rn < n; rn++) *rto++ = *rfrom++;
     return (to);
}

in the memcpy.c source file and just never returns from there.

**Attention** This is a public forum