• AVR Freaks

Hot!Removing SD-card Invokes error in system timer (Harmony 2.06)

Author
Kopper29
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/02/04 04:54:05
  • Location: 0
  • Status: offline
2019/04/01 01:50:20 (permalink)
0

Removing SD-card Invokes error in system timer (Harmony 2.06)

Hallo
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); 

 SYS_TMR_DelayMS(DelayMS); 


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:
 SYS_TMR_DelayMS(DelayMS); 

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.
Regard Jakob
#1
Kopper29
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/02/04 04:54:05
  • Location: 0
  • Status: offline
Re: Removing SD-card Invokes error in system timer (Harmony 2.06) 2019/04/02 23:26:44 (permalink)
0
Hello everybody,
I have located the error! and it is stupid, please dont repeat my mistake: Remember the pullup ;)
Regards Jakob
post edited by Kopper29 - 2019/04/03 04:24:59
#2
moser
Super Member
  • Total Posts : 504
  • Reward points : 0
  • Joined: 2015/06/16 02:53:47
  • Location: Germany
  • Status: offline
Re: Removing SD-card Invokes error in system timer (Harmony 2.06) 2019/04/03 06:12:37 (permalink)
#3
Jump to:
© 2019 APG vNext Commercial Version 4.5