I have been working on a project for a while now, and have started to integrate the SD card interface. The code works correctly when ran separately from a different program. However, the problems arise when integrating it with the rest of the project. I am using mbed Studio and mbed-OS 6.17, programming a Nucleo-F429ZI.
The following occurs when integrated:
The SD card initializes
The file system mounts
All files are displayed correctly
When asked to enter name of file, I enter the name of the file and hit enter - BOOM it crashes
The given error message:
++ MbedOS Error Info ++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0xFFFFFFFF, Parameter error
Location: 0x801A669
Error Value: 0xFFFFFFFF
Current Thread: main Id: 0x2001326C Entry: 0x8016885 StackSize: 0x2000 StackMem: 0x20004A20 SP: 0x2002FF38
For more info, visit: https://mbed.com/s/error?error=0x80010133&tgt=NUCLEO_F429ZI
-- MbedOS Error Info --
= System will be rebooted due to a fatal error =
= Reboot count(=8) reached maximum, system will halt after rebooting =
Hello,
according to the console output last achieved line is lin 123. So the code crashes somewhere between 123-142. Try to isolate the issue to exact line of code.
Can you please try same code but with hardcoded file name in the fopen function? Line 126 like below.
I’m certain it’s within the fopen function, as the just before ‘fopen’ occurs. Could the stack size be an issue? As when I run the code in a separate program it functions correctly.
That is strange. With this board i read whole web page from SD card and sent it to browser over ethernet. And also from this page in browser i did a transfer of new binary file to SDcard for future firmware update. That all with default settings under MbedOS6.16.
As when I run the code in a separate program it functions correctly.
That means you are able to read SD card in another program?
Ah wow that’s pretty impressive and good to know it’s capable of managing that. I’ve been looking into attempting a project where you can edit the stored page on the board from the browser.
But yes I was able to read the SD card successfully in another program, however i’ve made progress… I’m able to read from the SD now, it was another function used for global settings, the part where it was attempting to read and write from flash must’ve been causing the error. Due to instead of initializing the settings, by attempting to read the flash followed by restoring the settings and writing them back to flash for later use, I just restored the global settings and removed the code that writes them to flash and it now works correctly with the following out.