Other Parts Discussed in Thread: CC2640
Tool/software: TI-RTOS
Hello,
I am currently having some issues with the FATFS API on the CC26X2R1 (SDK 2.30.0.34). My program spends most of it’s time collecting data in low-power mode using SCS code and wakes up periodically to empty buffer and write the data to a microSD card.
For previous versions of this code that I ran on both the CC2640 and the CC2640R2, the code would open a file (and keep it open while doing periodic f_sync's), start the SCS task, then do f_writes to the microSD card, with only the writing process repeating upon every wake up of the device. For these devices I was able to achieves a current draw of around 3mA.
For my current build on the CC26X2R1, the process/code is the same, but I am unable to leave the file open without getting errors or empty files. The workaround I found for this issue was to do an f_open of the file, f_write the data, and then f_close, with this entire process repeating every time the device is woken up from the SCS task. This would be fine if it weren’t for the fact that the open and closing process takes an extremely long time and results in the device consuming an astounding 17-19 mA of current during operation. In order to isolate the portion of the code responsible for the high current, I ended up putting an infinite while loop around the f_open->f_write->f_close sequence and current remained constant at around 21 mA. I also verified that the idle current from the microSD card is not the culprit. My device needs to be able to run for seven days and with it's current power consumption its only making it one day.
What can I do to solve this problem?
Thanks