fopen in DAvE 4.3 (erno = 88) Socket operation on non-socket

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

cross mob
Not applicable
Hello everyone,

I'm working with a XMC 4700, I'm trying to use the fopen() as it follows:

const char* pFileName = "SOMETHING.BIN";

FILE* fp = fopen(pFileName, "w");

char * cadena = strerror(errno);


Instead of a direction, the value a I get from fp = 0, from cadena = "Function not implemented" and from errno = 88 (Socket operation on non-socket).

I don't know what I'm doing wrong heir, so I ask for your help.

I thank you in advance.

Best regards

Alan
0 Likes
1 Reply
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi Alan,

fopen will not work, it is a posix call which is not fully implemented in the c library (newlib).
Newlib requires an external implementation of system call open (a stub), which it is not provided since we do not know on which media you want to open a file.
I would recommend you to use the FatFS on the SDMMC (sdcard).

Regards,
Jesus
0 Likes