-
Notifications
You must be signed in to change notification settings - Fork 19
Question regarding the binary file upload #6
Comments
What do you mean you use only one line for the I2C communication? I2C requires 2 lines : SDA and SCL. Have a look at the Drivers repo for the EEPROM driver. You can find the sketch there. |
Thanks for your answer. Two lines pulled up via two resistors to Vcc. But in my case connected to one of the atmega pins. I found the hex file but I have trouble using it. Might be my lack of knowledge :-D I would like to adapt the miniboot_uart_to_eeprom_uploader program to my case. |
No ideea what you are talking about. You need 2 lines connected to the atmega : SDA and SCL, not one. In the above link, look at src/ and the files inside. I cannot help you if you do not know what you are doing. |
I think I was not clear on the problem I have. I use 3 lines to get the I2C communication to work. Two lines are SDA and SCL and a 3. line that pulls SDA and SCL high and powers the EEPROM. (similar to this: http://forum.arduino.cc/index.php?topic=296269.0) |
I see. Did you look into src/examples/e2prom.ino ? |
Yeah. I changed the sketch to adapt for my case and I was able to upload the binary to the EEPROM. Currently, I use a simple sketch for testing. But starting the sketch from the eerpom is still not working... The status LED blinks a few times, turns off and starts blinking again before it remains on. I'll try to track down the error that I do somewhere along. I checked the Fuses and I thing there that is ok. Size of miniboot.elf is 1942bytes with bootloader_start_address: 0x7800. I'll check next if I make the error somewhere with the timestamps. Thanks for pointing at the eprom.ino. |
The blinking of the led is fine, indicating pages are read from the i2c, checked for CRC and written to the internal flash of the MCU, as implemented here and here.
|
I've improved the readme (commit 5b4377bed556314a5da45dcedc49b7a77f5546fc) to make it clearer that one really needs to update the metadata before they are able to successfully use miniboot. Since I assume you were not using YAT, you didn't get promted to fill in the metadata fields. |
I use the Atmega328p with the internal RC Oscillator and 3.3V supply voltage.
I do the following:
I'll check later on the EEPROM content |
While you're at it, check both the contents of the I2C eeprom and the contents of the atmega eeprom. After each reflash, miniboot stores the timestamp from the i2c eeprom in the atmega eeprom. Next time the device boots, a diff between the two is performed. If it is 0, no reflash occurs. |
Your Lock fuse looks wrong (is: 0xFE should be: 0xEF). The current value, 0xFE means "Mode2: further programming disabled". |
First of all, thanks a lot for your help! |
The size required in the metadata needs to be size of the bin. It is the only thing relevant here, since miniboot writes exactly size amount of bytes to the atmega flash. I think you're nearly there, you should have a successful reflash very soon! :-) |
I think there is only one way to generate the bin, the way described in the readme:
|
It finally works :-) Thanks a lot for your advice and helping me getting it to work. The issue was related to how I build the binary file... |
Glad you finally got it running. I've improved the readme, since I also think the previous wording was poor and misled you. A compiled *.hex and *.bin is of no use on a source-sharing website. Can you please specify how you've built the binary and why it didn't work? That way other people can benefit too. |
What did not work:
What worked:
|
Thanks a lot for the great work! I have been trying to upload the program to the eeprom. In my case the I2C lines are connected to a pin of the mcu. I do this to disable I2C to reduce power consumption (battery power application). I changed the bootloader that I2C communication works. But...
I tried using the miniboot_uart_to_eeprom_uploader.hex but I doesn't seem to work in my case. Could you provide the sketch of the program?
Thanks
The text was updated successfully, but these errors were encountered: