cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a .csv file - STM32H745I-DISCO

iker_arrizabalaga
Associate II

Hi everyone,

I'm trying to open an image as a .csv or .bmp file in STM32CubeIDE. I've already tried different ways of reading the file but none of them would actually work. When I build the project the output gives no errors but when debugging, the file seems to be NULL. Should I add the .csv or .bmp file to the Src folder?

How should I import a .csv format file?

B.t.w, this is the code I wrote to open the file:

PreguntaSTM5.png

Thank you all in advance.

4 REPLIES 4
Pavel A.
Evangelist III

Use semihosting. Please see: https://community.st.com/t5/stm32-mcus/how-to-use-semihosting-with-stm32cubeide-and-stm32/ta-p/49742

Use absolute file paths because relative filenames with the semihosting are relative to the debugger directory, not to the project.

Thanks @Pavel A. I will definitely try this out. Is there any other way to read a .csv file?

@iker_arrizabalaga Yes definitely. I know one guy who writes parsers for csv and other text files in VHDL and programs this in FPGA. Your imagination is the limit.

 

The alternative is to have the file on the Target by way of a Micro SD Card, or USB Flash Drive, and driven by FATFS File System or Microsoft's equivalent.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..