cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-Creating a File System on SD card using FatFs Library, SDMMC host Interface and NUCLEO-L476RG.

Sahilsb7
Associate II

Hello all, 

  I am new to embedded programming and I am practicing embedded program and trying out new things. Recently I was trying to create a new text file on my SD card by referring this video posted by ST :- https://www.youtube.com/watch?v=I9KDN1o6924

The problem that I am facing is that my code gets stuck in the error handler. I debugged my code and I noticed that it jumps into the error handler after executing this particular line: 

if(f_mkfs((TCHAR const*)SDPath, FM_ANY, 0, rtext, sizeof(rtext)) != FR_OK)

{

    Error_Handler();

}    ...... (From the video)

I tried disabling the DMA but still it won't work. For some instance, when I drag and drop the .bin file directly into the Controller's driver to flash the program onto the memory chip, that is when I can see that the code is able to write some data into the .txt file, but still the code is not capable of creating a new .txt file and write the data into it. The code won't execute at all if I perform 'Run as' or 'Debug as' from the cubeIDE. I want to know what am I doing wrong.
Can someone please guide me with this issue? Much appreciated.

PS:- Every time I connect/disconnect my controller or SD card for testing/verifying, I get this noticiation pop-up message stating : ' SYMANTEC ERROR PROTECTION - Blocked explorer.exe from accessing Autorun.inf. Autorun has been blocked.' Does this also affects the code execution in any way? 

0 REPLIES 0