How to open files on Host PC with fopen on STM32L5
Title edited to clarify that this is about accessing a file located on a Host PC
hello ST Community,
I'm trying to open a binary file with the fopen function for a STM32L5 microcontroller, but it always gives me a null value. The code is like this:
char filepath[256];
sprintf(filepath,"%s","C:\\fileBIN.bin");
FILE *file;
file = fopen(filepath,"rb");
if(file == NULL)
{
printf("Error occurred opening file. \r\n");
}
else
{
printf("File opened successfully. \r\n");
}
It always gives me a null value but the path exists and is correct. What's wrong?
Thanks for supports
