Is there a possibility to use Mbed compiler without new problems every day

Hello all,
I’m trying to make some device with SD card, I2C LCD to work as SPI slave.
Found some SD card write example, tested it about 5 days ago, it worked fine, modified a little bit to append text file, all was OK.
Today the same project from online compiler does not work. My board (LPC1768) blinks some os fault, terminal show “Could not open file for write”.
Code:
#include “mbed.h”
#include “SDFileSystem.h”

int main() {
    printf("Hello World!\n");   
    int i;
    mkdir("/sd/log", 0777);
    
    FILE *fp = fopen("/sd/log/log.txt", "a");
    if(fp == NULL) {
        error("Could not open file for write\n");
    }
    fprintf(fp,"  Begin\r\n");
    for(i=0;i<100;i++)
        {
          
        fprintf(fp,"%d\r\n",i);
        wait (0.1);
        }
    fprintf(fp,"  End\r\n");
    fclose(fp); 
 
    printf("Goodbye World!\n");
    
    DigitalOut myled(LED3);
 
    while(1) {
       // ThisThread::sleep_for(500);
        wait(0.3);
        myled = !myled;
    }
}

BTW now bin file created is only 18KB size vs 40KB 5 days ago. As I understand there is something wrong due to not existing mbed-os folder (library) in the project. 5 days ago there was no problem.
When I’m try to add library I getting fault “internal server error 500…” and after this “library already exist”.
Library appearing and program does not compiling anymore. Error: No member named ‘fsize’ in ‘FIL’ in “SDFileSystem/FATFileSystem/FATFileHandle.cpp”, Line: 65, Col: 25
There is something changed in mbed-os today, after release of new version?
With I2C LCD there was really similar problems past 6 days, every day new “thing”.
Mbed Studio also not work for me, it does not download project to board, just blink download LED and nothing.
So where to begin?

Romas

Hi Romas,

I’m sorry you’re having all these issues, you’re right there seems to be a problem in the online compiler environment which is not importing the correct Mbed OS versions by default. We’re working on getting it fixed as soon as possible.

In the mean time could you try to import Mbed OS manually and switch to the latest release (Mbed OS 6.5)?

(select 6.5 (not 6.15, typo on my part!) and click “switch”).

Thanks,

Don

Update: Fixed typo (6.5 is the latest version, not 6.15 :))

Thank you for reapply,
There I have new problem - how to find version 6.15? What I see is V5.15, 6.3, 6.2 etc and no v6.15. There is no search, versions is not by date. And which version is now selected? It is known by bold fonts only?
Update: Tried v6.3, v5.15.6, v6.2.0 - compilation give my the same
Error: Unknown type name ‘ssize_t’; did you mean ‘size_t’? in “extras/mbed-os.lib/platform/DirHandle.h”, Line: 64, Col: 13

Romas

It look like I found what was wrong there. All SD card examples are absolutely outdated. All normal documentation for SD card, I2C LCD is for mbed-os 2 only. My used example was also for mbed-os 2, it worked perfectly, I tried to modify it, all still worked fine until I closed and next day reopened compiler. There was no folder/library mbed-os at all but everything worked!
I found some SD card example for os v5, it does not work, in terminal I see a lot of errors like Error Status: 0x80FF0100 Code: 256 Module: 255
So now I have one question - if I do not want to study all these libraries thoroughly to make them working and need to make only quite simple device - do I need to switch to os v2 (with fear of problems after reopening compiler)? Or just go back to most powerful arduimo WITH REALLY GREAT DOCUMENTATION AND REALLY WORKING EXAMPLES?
Or is there any other solution?

Hello,

Donatien probably misspelled the number. He probably mean the version 6.5, according to the picture.

According to your code and your last post it seems you use some old community code/example. There can be some issue with compatibility when you update Mbed 2 based project to Mbed OS 5 or 6+.

On the Mbed homepage on top panel you can find buttons like Code and Documentation > MbedOS. Under the Code link you will found latest official examples and under the Documentation link you will found latest official documentation also with some examples. Also there can be some issues because it is made by people but usually it works.

For the SD card you need to see Full API list >> Data storage >> SDBlockDevice and combine it with FATFileSystem.

BR, Jan

@romasxp please be aware that Mbed 2 and associated examples were deprecated a while back and are thus no longer maintained (See here Mbed | Mbed ). The code base is still there however and you are free to use it at your own discretion. As @JohnnyK has mentioned if you take a look at the Mbed OS 6 documentation you should find what you need there. If you are still having issues after that, please reach out to us on here again.

Thanks @JohnnyK - you’re right I almost released 10 extra versions of Mbed OS by mistake :smiley:.

Thanks both for the additional pointers.

Don

Hello again,
OK, I’m trying to use mentioned SDBlockDevice. Imported example, imported library. And cannot compile it.
Error: Variable type ‘SDBlockDevice’ is an abstract class in “main.cpp”, Line: 10, Col: 15
BTW how to check which version of mbed os is in this imported example? When trying to check revision - there is no bolded version in the list. So as I understand this example is also with some old mbed os?

Hi Romas,

look for a file called mbed_version.h (it should be under ‘platform’ but the actual location will change depending on which version of Mbed you are using). Inside the file you will see major, minor and patch values. Putting those together ie major.minor.patch will tell you the Mbed version. If the major begins with 2 then it is old no longer supported code. If the overall version is lower than 5.15.0 then that is also now unsupported.
For Mbed 6 the file is here:

For Mbed 5 the file is here:

Let us know here , what version you find?

Regards
Anna