Other Parts Discussed in Thread: SYSCONFIG
Hi, we have a fairly mature hardware and firmware platform based on the CC3220SF IC. This hardware and firmware platform has been essentially stable since 2020, running a TI-RTOS-based application developed on SimpleLink CC32XX SDK 3.40. This year I've done the work to bring our firmware up to SimpleLink CC32XX SDK 7.10 using TI-RTOS7 and TIClang. For the most part, everything works great. But I am seeing a sporadic but consistent problem across a diversity of tasks where we make a call to SD_open(CONFIG_SD_0, NULL). We have six read/write/init tasks that call SD_open(...) for various reasons, and any of these tasks can hang when the SD_open(...) call triggers the following infinite loop failure I need help resolving.
Here's the sporadic but commonly repeating pattern that results in an infinite loop in sdhost.c, line 647 and a hard-lock of the device:
<can occur in all of our SDHost-related task functions when SD_open(CONFIG_SD_0, NULL) is made>, e.g.:
72 sdHandle = SD_open(CONFIG_SD_0, NULL);
SDHostCC32XX_open() at SDHostCC32XX.c:550 0x0101D062:
549 /* Save clkPin park state; set to logic '0' during LPDS */
550 pin = PinConfigPin(hwAttrs->clkPin);
initHw() at SDHostCC32XX.c:1,127 0x0101A472:
1119 /*
1120 * Configure the card clock to 400KHz for the card initialization and
1121 * idenitification process. This is done to ensure compatibility with
1122 * older SD cards. Once this is complete, the card clock will be
1123 * reconfigured to the set operating value.
1124 */
1125 MAP_SDHostSetExpClk(hwAttrs->baseAddr, MAP_PRCMPeripheralClockGet(PRCM_SDHOST), SD_ID_FREQ_400KHZ);
1126
1127 MAP_SDHostIntClear(hwAttrs->baseAddr,
1128 SDHOST_INT_CC | SDHOST_INT_TC | DATAERROR | CMDERROR | SDHOST_INT_DMAWR | SDHOST_INT_DMARD |
1129 SDHOST_INT_BRR | SDHOST_INT_BWR);
SDHostSetExpClk() at sdhost.c:647 0x102048D0:
647 while( !(HWREG(ulBase + MMCHS_O_SYSCTL) & 0x2) )
648 {
649
650 }
I've searched E2E for possible resolution of this issue (i.e., site:e2e.ti.com SDHostSetExpClk in Google), but none of the three previously reported issues provided me with useful tips for resolving this problem.
Some additional information related this problem:
a) we never remove or insert the uSD card;
b) we are not using SDFatFS, just opening the uSD card for binary data reads and writes;
c) the problem occurs whether the NWP is enabled or in shutdown;
d) this problem occurs whether power policy is enabled or disabled;
e) when it happens, I can confirm that the device has continuously been in a power-policy disabled mode, so it's not likely to be related to LPDS or hibernation issues others have reported;
f) someone suggested adding PRCMMCUReset(X), but I don't see how it could be relevant if we're operating with power policy disabled continuously and still experiencing this problem;
g) we are only using Samsung uSD cards, either Samsung 64 GB (MB_ME64GA/AM) and Samsung 128 GB (MB_ME128GA/AM); the problem occurs using either uSD capacity
h) we are using SysConfig to configure the CC3220SF in SimpleLink 7.10 builds, whereas the CC3220SF was configured using statically-coded files in our SimpleLink 3.40 builds
For reference, SD is configured as follows in SysConfig under SimpleLink 7.10 using identical settings to the configuration we use in our firmware based on SimpleLink 3.40:
CONFIG_SD_0
Name: CONFIG_SD_0
Use FatFS: unchecked
Clock Rate: 8000000
Interface Type: SD Host
SD Implementation: (grayed-out) SDHostCC32XX
Interrupt Priority: 1 - Highest Priority
PinMux:
SD Host Peripheral: SDHost0
CLK Pin: GP16/7
CMD Pin: GP17/8
DATA Pin: GP15/6
DMA TX: Any(UDMA_CH15)
DMA RX: Any(UDMA_CH14)
Other Dependencies:
DMA On-chip DMA resource allocation
DMA Implementation: (grayed out) UDMACC32xx
DMA Error Function: dmaErrorFxn
Interrupt Priority: 1 - Highest Priority
Power Power Driver
Power Implementation: (grayed out) PowerCC32XX
Enable Policy: unchecked
Policy Function: PowerCC32XX_sleepPolicy
Policy Init Function: PowerCC32XX_initPolicy
Enter LPDS Hook Function: <empty>
Resume LPDS Hook Function: <empty>
Enable Network Wakeup LPDS: checked
Keep Debug Active During LPDS: unchecked
Enable GPIO Wakeup LPDS: unchecked
Enable GPIO Wakeup Shutdown: checked
Wakeup GPIO Source Shutdown: GPIO4
Wakeup GPIO Type Shutdown: LOW_LEVEL
RAM Retention Mask LPDS: SRAM_COL_1, SRAM_COL_2 +2
Latency for LPDS: 20000
IO Retention Shutdown: GRP_1
Park Pins Pin Park States (only the relevant ones)
Pin 6: WEAK_PULL_DOWN_STD
Pin 7: WEAK_PULL_DOWN_STD
Pin 8: WEAK_PULL_DOWN_STD
Any clue why this would suddenly be happening under SimpleLink 7.10, when we've had scores of our devices (same PCB revision, same CC3220SF ICs, same Samsung uSD cards) running without issue for years when using our firmware based on SDK 3.40 and TI-RTOS?
This is a show-stopper of a problem for us, as it happens repeatedly, hard-locking the device during a variety of operational modes, most notably during sampling mode when we require perfect fidelity of various sensor data. Watchdog recovery isn't a practical solution, as it would result in an unacceptable user experience for our end users, with sample data frequently interrupted in contexts where users can't access the device (e.g., underwater and wild terrestrial settings) and costs of deployment are very high. Finally, we can't easily go back to using the firmware based on SimpleLink 3.40, as there are numerous other firmware updates we've made which depend on SimpleLink 7.10 SDK (e.g., MQTT and AWS support), all of which work great. Only SDHost under SimpleLink 7.10 is a problem.
Thanks,
Dave