Removing SD-card Invokes error in system timer (Harmony 2.06)
I tried making a post a couple of days ago about this problem, but I can’t seem to locate it. I don’t know if it has even been made/posted – Mean while I have come up with some additional information but essence is the same, if this will classify as a repost I’m sorry. So: I’m working on a project involving reading data periodically with I2C and then saving this data to an SD card.
I’m using a custom board with a PIC32MZ1024EFE064 microcontroller on board, and MPLAB X IDE 5.10 with Harmony 2.06.Using the sdcard_fat_single_disk exsample I’ve successfully implemented reading, writing, making directories etc. This code is disabled for now. This is using the SD-driver over SPI (dynamic) with File-system.In my code, in the I2C handling part is using the system timer functions:
SYS_TMR_CallbackPeriodic(1000, 0, &I2CTimerCallback);
The problem can be broken down into 3 different situations:1. SD-card not inserted: Everything runs fine (For extended periods of time)2. SD-card inserted: Everything runs fine (For extended periods of time)3. SD-card Removed: SYS_TMR_DelayStatusGet function will not/never return true and hence the code is stuck. SYS_TMR_CallbackPeriodic still works fine.It is the situation 3 that is the problem. I’m not doing anything to the SD-card in any of these situation, not even trying to mount it. The function handling the SD-card is simply empty. The only thing is that I’m inserting the SD-card, and then removing it (physically).The problem only is to the functions around the system delay:
if(SYS_TMR_DelayStatusGet(TimerDelayHandle) == true) I’ve tried to handle this error by deleting the time object when it becomes non responsive but this does not help. And it is not in the lack of a valid handle as the SYS_TMR_DelayMS function returns a valid handle every time it is called – also after the physically removal of the SD-card. SYS_TMR_DelayStatusGet function simply don’t return true. I’ve tried locating the error for hours and hope one of you could help me.