Part Number: AM2732-Q1
Other Parts Discussed in Thread: AM2732, SYSCONFIG
Hello,
I have implemented a MSS_MIBSPIB Controller freertos project on a R5-0 processor on a AM2732 device.
My code runs correctly without any error. The main code is shown below:
void spi_master(void *args)
{
int32_t transferOK;
Drivers_open();
Board_driversOpen();
transferOK = spi_enable_tx_interrupt(gMibspiHandle[SPI_TX]);
if((SystemP_SUCCESS != transferOK))
{
DebugP_assert(FALSE); /* MIBSPI transfer failed!! */
}
while(1){;}
}
int32_t spi_enable_tx_interrupt(MIBSPI_Handle handle){
static MIBSPI_Transaction spiTransaction;
static int32_t status;
uint16_t enable_tx_interrupt[5]= {0x1008, 0x44A1, 0x0000, 0x0000, 0x0001};
CacheP_wbInv((void*)enable_tx_interrupt, sizeof(enable_tx_interrupt), CacheP_TYPE_ALLD);
/* Initiate transfer */
spiTransaction.count = sizeof(enable_tx_interrupt);
spiTransaction.txBuf = (void *)enable_tx_interrupt;
spiTransaction.rxBuf = NULL;
spiTransaction.peripheralIndex = 0U;
spiTransaction.arg = NULL;
status = MIBSPI_transfer(handle, &spiTransaction);
return status;
}
The syscfg is shown below:

When I try to transfer the exact same code and syscfg options to a freertos system project to the exact same R5-0 processor, the project does not run correctly. To be exact the MIBSPI_transfer function fails.
After a lot of debugging inside the MIBSPI_transfer function I see that in the freertos system project it seems that the icount option is NOT enabled and in the freertos R5-0 project is ENABLED. But that makes no sense since there is no icount option when SPI is configured as a Controller and moreover I put by hand the exact same configurations in syscfg in the 2 projects. This difference with icount option has as a result to run different parts of the driver code and end up to failure.
Why is that happening?


