Other Parts Discussed in Thread: SYSBIOS
I have a SPI in DMA mode setup to communicate to an ADC in 8 bit mode. My problem is that a call made to GIO_write is blocking my task forever. The blocking would occur almost immediately or after a minute of runtime. I have not noticed or try to pinpoint if GIO_read also causes the block. I am about 90% certain that it is hanging because a callback function is never called to signal the write to end. However, I checked the EDMA EMCR register to see if an event was missed for some reason, but I do not see any bits set.
I have suspicion that there is some sort of timing issue because the blocking occurs less often when I change several optimization settings with my BIOS/SPI libraries or added Log statements. For example, I tried compiling my SYSBIOS with no optimization "-Ooff" and got rid of the "--optimize_with_debug" as well. The SPI was able to run throughout a whole night without problems.
I also recompiled my SPI lib with some Log statements to attempt to debug this problem, but the blocking would occur less often again (maybe once every 45 minutes). This made it much harder to diagnose since the more I wanted to see what was wrong, the less the problem would appear.
I do not suspect that the initialization or the use of the SPI is incorrect because this was all fully functional when we were running in DSPBIOS.
I am currently trying to rollback my SPI src files to vanilla and continually add bug fixes to see if it somehow broke 8-bit transfers. Then I will try to go to the newest SYSBIOS version (although I did not see any relevant fixes in the release notes).
Anyone have any ideas as to what could cause my GIO_write never getting the signal to exit? Any help is greatly appreciated!
=================================================================================================
Here are the versions of libs I am currently using---
DSP: C6748
SYSBIOS: 6_34_04_22
BIOSPSP: 3_001_01_00
EDMA: 2_11_06_01
Current spi src files I'm building the lib from:
Spi.c and spi_edma.c has been modified from the vanilla version to include bug fixes found in other posts to make 12 and 16 bit transfers to work.
----------------------------------------------------------------------------
Here is the configuration---
Spi0Params = Spi_PARAMS;
Spi0Params.hwiNumber = 8;
Spi0Params.spiHWCfgData.intrLevel = FALSE;
Spi0Params.opMode = Spi_OpMode_DMAINTERRUPT;
Spi0Params.outputClkFreq = 2000000; //??
Spi0Params.loopbackEnabled = FALSE;
Spi0Params.edmaHandle = NULL;
Spi0Params.enableCache = true;
Spi0Params.spiHWCfgData.pinOpModes = Spi_PinOpMode_SPISCS_4PIN;
//Spi0Params.spiHWCfgData.pinOpModes = Spi_PinOpMode_3PIN;
Spi0Params.spiHWCfgData.configDatafmt[0].charLength = 8;//
Spi0Params.spiHWCfgData.configDatafmt[0].clkHigh = FALSE ;// polarity = 0
Spi0Params.spiHWCfgData.configDatafmt[0].lsbFirst = FALSE;//
Spi0Params.spiHWCfgData.configDatafmt[0].oddParity = FALSE;
Spi0Params.spiHWCfgData.configDatafmt[0].parityEnable = FALSE ;
Spi0Params.spiHWCfgData.configDatafmt[0].phaseIn = FALSE;//TRUE ;// phase = 1
Spi0Params.spiHWCfgData.configDatafmt[0].waitEnable = FALSE;
Spi0Params.spiHWCfgData.configDatafmt[0].wDelay = 0;