Hi,
I recently upgraded from TI-RTOS 2.16.01.14 to 2.20.00.06. After upgrading to the latest version of SmartRF Studio and recreatign the smartrf_settings.c/.h files (there are some RF command structures that have changed), I rebuilt my project code.
My SPI code that ran ok under 2.16.01.14 is now creating exceptions related to the SPI driver. I am using the SPI in slave mode with callback and have enabled RETURN_PARTIAL, so that the SPI transfer can be terminated on my device when the master de-asserts the chip select line.
I have previously had issues with the TI SPI driver, and had previously received assistance from TI to modify the driver to prevent an exception (hard fault, bus fault, imprecise). A copy of the SPICC26xxDMA.c file had to be taken into the local project and modified. The following check (highlighted in orange) had to be added within the SPICC26XXDMA_csnCallback() function to prevent the exception:
/* Cancel transfer if POSEDGE interrupt */
/* TODO: Consider doing this in a SWI */
if ((csnConfig & PIN_IRQ_POSEDGE) == PIN_IRQ_POSEDGE) {
/* Indicate why the transaction completed */
if (object->currentTransaction != NULL)
{
object->currentTransaction->status = SPI_TRANSFER_CSN_DEASSERT;
}
/* Cancel the current transaction */
SPICC26XXDMA_transferCancel(spiHandle);
}
This resolved my issue and I continued my development.
However, after upgrading to TI-RTOS 2.20.00.06 (which for the record DOES NOT include the modification outlined above ...) I have started to get SPI exceptions again. I have tried the following options for the SPI functionality:
1) Continue to use the 'modified' SPICC26XXDMA.c file from the TI-RTOS version 2.16.01.14
2) Use the new version of the SPICC26XXDMA.c file as supplied in TI-RTOS version 2.20.00.06
3) Use the new version of the SPICC26XXDMA.c file as supplied in TI-RTOS version 2.20.00.06 modified with the patch shown above
All of these options continue to provide exceptions.
I have compared the CC1310DK_7XD.c files from TI-RTOS versions 2.16.01.14 and 2.20.00.06 to ensure that any changes have been implemented into the equivalent file in my project.
Here is the exception information from the CCS (v. 6.1.1.00022) console window:
[Cortex_M3_0] {module#38}: line 1095: error {id:0x130000, args:[0xae6c, 0x0]}
{module#38}: line 1172: error {id:0x150000, args:[0x8458, 0xe000ed38]}
Exception occurred in background thread at PC = 0x00007c1e.
Core 0: Exception occurred in ThreadType_Swi.
Swi name: {unknown-instance-name}, handle: 0x20000f58.
Swi stack base: 0x20003c00.
Swi stack size: 0x400.
R0 = 0x20000f20 R8 = 0x00000000
R1 = 0x00000000 R9 = 0x00000002
R2 = 0x00007bc5 R10 = 0xffffffff
R3 = 0x00000000 R11 = 0xffffffff
R4 = 0x200001c8 R12 = 0x2000230c
R5 = 0x00000000 SP(R13) = 0x20003f90
R6 = 0x00000000 LR(R14) = 0x1001b011
R7 = 0x20000f58 PC(R15) = 0x00007c1e
PSR = 0x61000000
ICSR = 0x00414803
MMFSR = 0x00
BFSR = 0x04
UFSR = 0x0000
HFSR = 0x40000000
DFSR = 0x00000001
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...
and here is the section from the map file that corresponds to the PC given for the exception:
00007a24 000001a0 drivers_cc13xxware.aem3 : PowerCC26XX_calibrateRCOSC.oem3 (.text:PowerCC26XX_doCalibrate)
00007bc4 000001a0 SPICC26XXDMA.obj (.text:SPICC26XXDMA_swiFxn)
00007d64 00000190 drivers_cc13xxware.aem3 : UARTCC26XX.oem3 (.text:UARTCC26XX_open)
00007ef4 00000184 mnet_llc.obj (.text:LLC_initialise)
which indicates that the exception occurs in SPICC26XXDMA_swiFxn
Here is the exception information from the ROV:
Decoded exception,
Decoded,Hard Fault: FORCED: BUSFAULT: IMPRECISERR
Exception context,
$addr,0x20003ec0
$type,ti.sysbios.family.arm.m3.Hwi.ExcContext
threadType,ti.sysbios.BIOS.ThreadType_Swi
threadHandle,0x20000f58
threadStack,0x20003c00
threadStackSize,1024
r0,0x20000f20
r1,0x0
r2,0x7bc5
r3,0x0
r4,0x200001c8
r5,0x0
r6,0x0
r7,0x20000f58
r8,0x0
r9,0x2
r10,0xffffffff
r11,0xffffffff
r12,0x2000230c
sp,0x20003f90
lr,0x1001b011
pc,0x7c1e
psr,0x61000000
ICSR,0x400803
MMFSR,0x0
BFSR,0x4
UFSR,0x0
HFSR,0x40000000
DFSR,0x1
MMAR,0xe000ed34
BFAR,0xe000ed38
AFSR,0x0
Exception call stack,
0 SPICC26XXDMA_swiFxn(unsigned int, unsigned int) at SPICC26XXDMA.c:532,PC = 0x00007C1E FP = 0x20003F90
1 <symbol is not available>,PC = 0x1001B010 FP = 0x20003FB8
And here is the section of my SPICC26XXDMA.c file that corresponds to line 532:
As we have tight timescales for a Beta test release of the project, I am going to return to TI-RTOS 2.16.01.14, but at some point I will need to resolve this issue so that I can move forward to TI-RTOS 2.20.00.06.
If anybody has any suggestions as to how I should proceed with resolving this exception, then they would be gratefully received.
Regards,
Chris


