2024-01-10 03:24 AM
I am trying to store .bin file into eeprom(24LC256) which is required for me to flash the LCM GUI. I am trying to open the binary file in main.c as follows:
#define Filepath "C:\\Users\\sushma\\STM32CubeIDE\\workspace_1.12.1\\filesizetest\\Core\\Src\\button.bin"
// Open the binary file in read mode
FILE *file = fopen(Filepath, "rb");
if (file == NULL) {
// Handle file opening error
while(1);
}
The .bin file is present in given Filepath. The file pointer is still returning NULL. I tried to use .txt format, That was also not opened in program and File pointer is returning NULL. I changed workspace and tried but I am getting the same error.
I have checked the file persmissions , They are accessible and readable. Even I checked if binary file is corrupted but I can open binary file and it has contents.
Could anyone please help me to resolve the issue ? or please let me know how I can store .bin file into EEPROM ?
Solved! Go to Solution.
2024-01-10 04:35 AM
How's it going to access the hosts hard drive?
You can create a C array and include initial content into code compiled on the target, code in your app would then do initial write of content into the EEPROM.
Or from the host you create an External Loader that's aware of your hardware, and STM32 Cube Programmer can use that to write the .BIN directly.
2024-01-10 04:35 AM
How's it going to access the hosts hard drive?
You can create a C array and include initial content into code compiled on the target, code in your app would then do initial write of content into the EEPROM.
Or from the host you create an External Loader that's aware of your hardware, and STM32 Cube Programmer can use that to write the .BIN directly.
2024-01-10 05:02 AM
Thank you so much for the reply. I am the begineer and was considering the code is running on PC:)