Problem: Fatfs + watchdog

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Not applicable
Hello at all,

we have a big problem, when we use the FATFS-App and the WATCHDOG-App in one project. With one output we measured the Time between "Write Start" and "Write Stop" in the main.c (we have deactivated the Watchdog for this test). The Time is 70µs.
With activated Watchdog (Set on 200ms) the System makes a Reset! I can't understand this Problem??? I hope someone can Help me!
I have attached our project.

Best regards,
Knecht Patrick

0 Likes
6 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi Patrick,

The problems is that unfortunately you are using the P1.10 (DO_Led_gruen) this pin is used by the SDMMC module as card detection.
There is a problem in the SDMMC APP which is not disabling the card detection Input if not selected in the APP.

Please add the following code
  SDMMC->HOST_CTRL |= SDMMC_HOST_CTRL_CARD_DETECT_TEST_LEVEL_Msk | SDMMC_HOST_CTRL_CARD_DET_SIGNAL_DETECT_Msk;

before your Main_Init.

Let us know if this solves your issue.

Regards,
Jesus
0 Likes
Not applicable
Hi Jesus,

we have test this and it works some hours, but after 8-10 hours the same problem comes and the watchdog makes a reset. It is better but still not correct! I hope you can help me again!

Regards,
Knecht Patrick
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Are you checking the return value of the calls to FatFS functions? i.e. f_printf in SD_Write() maybe this can give us some hint what is going on.

Regards,
Jesus
0 Likes
Not applicable
Hi,

now we tried to disable all functions on pin P1.10 (DO_Led_gruen). But after 2 ours the watchdog makes a reset. Actually we try to log all return data. Have anyone a idea what we can try other?

Regards,
Patrick
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

The P1.10 should not have any influence anymore since we have disabled this functionality previously.
Did you check the status returned by the FatFS functions, i.e. f_printf, you are using? Knowing which function is not behaving as expected could give us a further hint where to look.

Regards,
Jesus
0 Likes
Not applicable
The code
SDMMC->HOST_CTRL |= SDMMC_HOST_CTRL_CARD_DETECT_TEST_LEVEL_Msk | SDMMC_HOST_CTRL_CARD_DET_SIGNAL_DETECT_Msk;
doesn't works. The problem is still the same!
We have used another SD with different formatting and it is noticed that the one card does not show the problem longer than the other! Could there be a connection?

Regards,
Patrick
0 Likes