Hi Team,
I have a certain situation arising in the firmware written and to over come that situation I am thinking of using Watchdog.
So the point is as below:
In my firmware I am using RTC to wake up the device from sleep mode every 6 hours. After wake up the unit takes some data from uPulser on board and writes the data into SD card on board and then the same data is compressed and sent to another MCU on device,
The stuff what I am experiencing is that when the data is written on the file in SD card there is not issue but when the same data is compressed and is saved into another file and the compressed data is been sent to another device on board at times, the f_open function to open the file in SD card fails and gives FR_DSK_ERR and as per the third_party library to which this file functions belong it says that FR_DSK_ERR refers to
"The lower layer, disk_read, disk_write or disk_ioctl function, reported that an unrecoverable hard error occured.
Note that if once this error occured at any operation to an open file, the file object is aborted and any operations to the file except for close will be rejected."
So as per this the only way around to make everything work again is I have to reset the board.
But once the unit is in field there is no way that anyone can go and reset the board so I was planing to use Watchdog concept to reset the board.
So, my questions are as below:
Can we use Watchdog and RTC in the same code?
If yes, will watchdog still be active when the unit is in deep sleep mode?
And lastly, when the issue FR_DSK_ERR arises how do I use watchdog to restart the MCU?
Hope to hear from you soon.
Thank you
Vikram