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.
Tool/software: TI C/C++ Compiler
Hi
I want to use SPI EUSCI_A3_BASE and EUSCI_B0_BASE in ti rtos MSP430. Problem is that argument in MSP_EXP430F5529LP_isrDMA is always zero and does not show 1 for EUSCI_B0_BASE. How to fix this problem? but if I set SPI_serviceISR((SPI_Handle) &(SPI_config[1])); I can communicate and run and can be read using EUSCI_B0_BASE.
cfg file content
hwiParams.arg = 0;
hwiParams.priority = 5;
hwiParams.instance.name = "spi";
Program.global.hwi42 = halHwi.create(42, "&MSP_EXP430FR5994_isrDMA", hwiParams);
hwiParams.arg = 1;
hwiParams.priority = 1;
hwiParams.instance.name = "fram";
Program.global.hwi47 = halHwi.create(47, "&MSP_EXP430FR5994_isrDMA", hwiParams);
Void MSP_EXP430F5529LP_isrDMA(UArg arg)
{
/* Call the SPI DMA function, passing the SPI handle used for WiFi */
SPI_serviceISR((SPI_Handle) &(SPI_config[0]));
}
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
#pragma DATA_SECTION(spiEUSCIADMAHWAttrs, ".const:spiEUSCIADMAHWAttrs")
#endif
#include <ti/drivers/SPI.h>
#include <ti/drivers/spi/SPIEUSCIADMA.h>
uint8_t spiEUSCIADMAscratchBuf[1];
const SPIEUSCIADMA_HWAttrs spiEUSCIADMAHWAttrs[1] = {
{
.baseAddr = EUSCI_A3_BASE,
.clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
.bitOrder = EUSCI_A_SPI_MSB_FIRST,
.scratchBufPtr = &spiEUSCIADMAscratchBuf[0],
.defaultTxBufValue = 0,
.dmaBaseAddr = DMA_BASE,
.rxDMAChannelIndex = DMA_CHANNEL_4,
.rxDMASourceTrigger = DMA_TRIGGERSOURCE_16,//DMA_TRIGGERSOURCE_17
.txDMAChannelIndex = DMA_CHANNEL_5,
.txDMASourceTrigger = DMA_TRIGGERSOURCE_17 //DMA_TRIGGERSOURCE_16
}
};
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(spiEUSCIBDMAHWAttrs, ".const:spiEUSCIBDMAHWAttrs")
#endif
#include <ti/drivers/spi/SPIEUSCIBDMA.h>
uint8_t spiEUSCIBDMAscratchBuf;
SPIEUSCIADMA_Object spiEUSCIADMAObjects[1];
SPIEUSCIBDMA_Object spiEUSCIBDMAObjects[1];
const SPIEUSCIBDMA_HWAttrs spiEUSCIBDMAHWAttrs[1] = {
{
.baseAddr = EUSCI_B0_BASE,
.clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
.bitOrder = EUSCI_B_SPI_MSB_FIRST,
.scratchBufPtr = &spiEUSCIBDMAscratchBuf,
.defaultTxBufValue = 0,
.dmaBaseAddr = DMA_BASE,
.rxDMAChannelIndex = DMA_CHANNEL_0,
.rxDMASourceTrigger = DMA_TRIGGERSOURCE_18,//DMA_TRIGGERSOURCE_17
.txDMAChannelIndex = DMA_CHANNEL_1,
.txDMASourceTrigger = DMA_TRIGGERSOURCE_19 //DMA_TRIGGERSOURCE_16
}
};
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPIEUSCIADMA_fxnTable,
.object = &spiEUSCIADMAObjects[0],
.hwAttrs = &spiEUSCIADMAHWAttrs[0]
},
{
.fxnTablePtr = &SPIEUSCIBDMA_fxnTable,
.object = &spiEUSCIBDMAObjects[0],
.hwAttrs = &spiEUSCIBDMAHWAttrs[0]
},
{NULL, NULL, NULL},
};
/*
* ======== MSP_EXP430FR5994_initSPI ========
*/
void MSP_EXP430FR5994_initSPI(void)
{
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P6, GPIO_PIN0, GPIO_PRIMARY_MODULE_FUNCTION);/* SIMO/MOSI */
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P6, GPIO_PIN1, GPIO_PRIMARY_MODULE_FUNCTION);/* SOMI/MISO */
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P6, GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);/* CLK */
#ifdef EXTERNAL_FRAM
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1, GPIO_PIN6, GPIO_SECONDARY_MODULE_FUNCTION);
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN7, GPIO_SECONDARY_MODULE_FUNCTION);/* SOMI/MISO */
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN2, GPIO_SECONDARY_MODULE_FUNCTION);/* CLK */
#endif
SPI_init();
}
Hello,
Your observation
suggests it could be a configuration issue.ye myat thu said:but if I set SPI_serviceISR((SPI_Handle) &(SPI_config[1])); I can communicate and run and can be read using EUSCI_B0_BASE.
I will have to check internally and get back to you.
Srinivas
**Attention** This is a public forum