xrstokes wrote on Thursday, August 15, 2019:
I’ve just finished some custom PCB’s with microSD cards. I’ve used the fatfs option included in cubeIDE. Reading a single line is fine. what i’m trying todo is read multiple lines into a character pointer or array. The problem i have is when i call
small_piece = f_gets((TCHAR*)readBuf, 100, &fil);
small_piece now points to some memory on the heap “0x20002000 <ucHeap+7656> “test\n””
when i try to copy test\n onto some memory on the stack so i can read the next line, neither
memcpy( tmp, small_piece, 6 ); //<---Doesn't work?
strcpy( tmp, small_piece ); //<---Doesn't work either?
see the attached pic. I’m new to this so I might be missing something really basic.
Thanks in advance.