5 years, 2 months ago.

Adding SD card truncate support through the API

Hello all,

I'm attempting to follow a similar path to this topic: https://github.com/ARMmbed/mbed-os/issues/7010

However, I'm working in MBED 2, rather than the OS, so my process is giving me considerably more trouble.

I have added the appropriate truncate() function to FATFileHandle, and the virtual functions to FileHandle:

virtual ssize_t truncate();

and LocalFileSystem:

virtual ssize_t truncate() = 0;

However, now it's screwing with the Stream class, which manifests as a problem with a totally unrelated library. And I can't seem to fix this issue: if I add the corresponding virtual function to the Stream class, it starts to give me a "… undefined reference to … collect2: ld returned 1 exit status" linker error. If I don't, it makes the whole library class that calls stream virtual and it fails.

Has anyone added functionality through the MBED API before who could help me navigate this?

Be the first to answer this question.