How To Extract Hex File From Arduino - Read EEPROM Memory

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends in this video I will show you how to extract hex file from Arduino this method requires two arduinos one Arduino will act as the programmer it will be used to extract the hex file from the other Arduino which in this case is an Arduino Nano the first step is to upload the Arduino ISP sketch to the Arduino Uno it will turn the Arduino Uno into an ISP programmer before uploading the sketch make sure you have selected the Arduino Uno board from the tools menu also choose the com port to which your Arduino is connected now click on upload button to upload the code to the Arduino now we have set up the Arduino Uno as an ISP programmer next let's focus on the Arduino Nano which will be used as Target device I have already uploaded a simple blink sketch on it which will blink the LED at a 100 milliseconds interval and I am going to extract the hex code for This Blink sketch you can also use an Arduino Uno or any other Arduino as the target device the steps remain the same for any device next step is to connect the programmer to the Target device you can follow this wiring diagram to properly connect the target Arduino to the programmer if you are using an Arduino Uno as the target device then you can follow this wiring diagram to extract the hex file I will use AVR dudes software you can find the link for this software in the description here first you will need to select the Arduino as a programmer then select the com port to which the Arduino is connected next set the baud rate to 19200 to establish communication with the Arduino next you will need to detect the microcontroller of the target device so click on detect button and it will automatically detect the microcontroller on the target device in our case it will be the atmega328p which is commonly used in Arduino Nano boards now we are ready to extract the hex file from Arduino Nano the Arduino program or hex file is stored in the flash memory of the Arduino therefore to extract the desired hex file you will need to read the flash memory of the Arduino first you will need to click on the three dots and then select the location where you want to save the extracted hex file give the extracted hex file a name such as bling.x and ensure you save it with the proper file extension then select the hex file format as Intel hex as it is compatible with Arduino additionally make sure to select the read option as we are reading the data from the flash memory of the Arduino Nano now click on go button to start the extraction process you can monitor the console in the AVR doodas software for the status and progress of the extraction process once the extraction is complete the resulting hex code will be stored in the blink dot hex file to access this file navigate to the location where you saved it here you can see the hex file is created I will just open it to look inside here are just zeros and ones this binary code represents the blink sketch that blink the LED at the intervals of 100 milliseconds now you can upload it to another Arduino however it's important to note that the single blink dot hex file might not work for large and complex programs that use eprom memory in such case you will also need to extract the data from the arduinos eprom memory first click on the three dots next to eprom section then enter the file name to store the eprom data such as blink dot Eep remember Eep is the standard extension for eprom files next select the format as Intel hex make sure you have selected the read option as we want to read data from the eprom memory then click on go button to start the eprom reading process wait for the process to complete and the eprom data will be stored in our file the final step is to read the fuse bits and lock bits from the target Arduino so click on the read button it will read the data about the required bits from the target Arduino here you can see the data about the required bits you just save this information inside a text file it will be used when we upload the code to another Arduino now we have these three files for the Arduino Nano the next step is to upload these files to the Target device I will use the Arduino Uno as a programmer for testing purpose I will use the same Arduino Nano that I have used in the previous step however you can use any other Arduino as the target device the connection diagram and the other steps remain the same currently the built-in LED of the Arduino Nano is off it indicates there is no any blink code inside its flash memory so let's upload the blink code using the hex file here first you will need to make some configurations these configurations will remain the same as we performed in the previous step the only difference is that this time I will select the right option since we are writing the hex file onto the Arduino now click on the three dots to open the file explorer and select the hex file that we have created in the previous step as we are dealing with the simple blink sketch so there is no need to upload the eprom file only the hex file is required wait for the upload process to complete now the hex file is uploaded if you look at the Arduino Nano you can see the LED start blinking after every 100 milliseconds to verify the LED functionality you can directly power the Arduino Nano using a USB cable to upload large and complex programs you need to update the eprom data as well this process is straightforward you just select the right option from the eprom section then select the format as Intel hex and then click on the three dots to open the file explorer here select the eprom file that we have created before now click on Go Button to upload the eprom file on the target device finally you will need to update the fuse bits information you just open the previously saved fuse bits text file and enter the bit information into the appropriate fields after entering the bit information click on right button to update the fuse bits and finally click on the right button for the lock bits to complete the process this way you can easily copy code from one Arduino and upload it to as many Arduino boards as needed if you have any questions or need further clarification please leave a comment below see you in another video bye
Info
Channel: Ahmad Logs
Views: 10,760
Rating: undefined out of 5
Keywords: how to extract hex file from arduino, extract hex file from arduino, arduino read and write hex file, extracting hex file from arduino, how to read eeprom of arduino, arduino read hex file, arduino eeprom read and write, arduino read eeprom
Id: oWYakdLMrdI
Channel Id: undefined
Length: 8min 10sec (490 seconds)
Published: Sun Jul 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.