2024-01-19 11:35 PM
I tried to use fopen() on STM32Cude IDE, but it is always returning null. Please let me know how I can use the file handing functions on STM32Cube IDE. Please see my code I am using. What printf() will do here?
uint num;
File *fptr;
if ((fptr = fopen("C:\\newprogram.txt","r")) == NULL)
{
printf("Error! opening file");
// Program exits if the file pointer returns NULL.
exit(1);
}
fscanf(fptr,"%d", &num);
printf("Value of n=%d", num);
fclose(fptr);
2024-01-20 01:07 AM
There isn't an operating system or file system in operation here.
printf() can be plumbed to a UART, on GCC via _write() in syscalls.c
File system work can be done via FatFs, but you must plumb to a block storage device using SD Card, NOR Flash, USB MSC, etc
2024-01-20 01:39 AM
How can I load a file system or an operating system like Linux to the board (NUCLEO-F767ZI) I am using? Is there any way to load Linux to this board?
How can I use _write() call for printf? Any example available for that? Do I need to connect the UART on the board to my PC to see the data sent from UART?