cancel
Showing results for 
Search instead for 
Did you mean: 

Storing binary.bin file into eeprom using Nucleoh743zi2

sushma
Associate III

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

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

View solution in original post

2 REPLIES 2

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.

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

Thank you so much for the reply. I am the begineer and was considering the code is running on PC🙂