user friendly eeprom writer

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 Was wondering if anyone knows of a way to write to EEPROM from a "user" perspective. Say I have a project that uses a boot loader to flash my device. I'm looking for a way to do something similar in the way of EEPROM. The idea being to let a user "program" a device.

 

i.e.  Users writes a byte to a specific EEPROM address, code reads this and preform the option on startup.

 

This could be done with avr-studio or avrdude but not without a burner.  I think a boot loader would be simple but all boot loaders assume to write flash code. One option would be to write my own boot loader but I'm looking for something that may already do this.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry but why can't the bootloader and the PC program that drives it just write EEPROM in exactly the same way as they write to the code flash?

 

Most bootloader protocols have both "send flash contents" and "send EEPROM contents" in their toolbox and the two things operate virtually identically except that at the very last minute the flash one does SPMs while the EEPROM one does writes to EEAR/EEDR/EECR. But the way the binary data and addressing is passed are otherwise very similar.

 

avrdude knows :eeprom: as a target just as it knows :flash: - when speaking a bootloader protocol like AVR109 it will send flash programming commands when :flash: is used and EEPROM programming commands when :eeprom: is used.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Right and I'm sure it could but I don't have the boot loader source to added the gui inputs. Like I said, I could write my own but just hoping not to. Writing a gui tool is not as simple as a command line tool. The key interest here is a user friendly tool. The only usb boot loader I have found that has a GUI is hidbootloaderflash and there is no source for it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well if you can't modify the bootloader it has to be implemented as a function in the app anyway doesn't it? So presumably you have complete control over the protocol and interface that uses?

 

As to writing GUI tools - I guess everyone already has their favourite way to achieve this already so I guess you just choose amongst whatever you are comfortable with: C#, Java, C++, Python, Perl, Ruby or whatever? They will all have library mechanisms for either accessing (virtual) serial ports or direct to some USB device class.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

right of course but was hoping for a general eeprom writing application. I could see many developers making such a thing for simple debugging/test. Though yes I'm sure there is a way to write this and that may be the only option.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How could there be a "general" application for this? Everyone makes use of the EEPROM locations in their own unique ways. The only way it could be "generic" is simply to allow the dumping of a block of anonymous binary and that's exactly what avrdude does anyway.

 

For my EEPROM I might want some interface like:

 

 

But you might want something completely different.

 

BTW, I just wrote that - the sliders/button are active - the Python code to achieve it was:

import tkinter as tk

disp = tk.Tk()

disp.geometry('800x400+10+10')
disp.title("a Pretty EEPROM writer")

vol_slide = tk.Scale(disp, from_=0, to=11, orient=tk.HORIZONTAL)
vol_slide.place(x=10, y=10, width=500, height=80)
vol_name = tk.Label(justify=tk.LEFT, text="Volume")
vol_name.place(x=550, y=30)

red_slide = tk.Scale(disp, from_=0, to=255, orient=tk.HORIZONTAL)
red_slide.place(x=10, y=100, width=500, height=80)
red_name = tk.Label(justify=tk.LEFT, text="RED")
red_name.place(x=550, y=120)

green_slide = tk.Scale(disp, from_=0, to=255, orient=tk.HORIZONTAL)
green_slide.place(x=10, y=200, width=500, height=80)
green_name = tk.Label(justify=tk.LEFT, text="GREEN")
green_name.place(x=550, y=220)

blue_slide = tk.Scale(disp, from_=0, to=255, orient=tk.HORIZONTAL)
blue_slide.place(x=10, y=300, width=500, height=80)
blue_name = tk.Label(justify=tk.LEFT, text="BLUE")
blue_name.place(x=550, y=320)

button = tk.Button(disp, text='Write EEPROM')
button.place(x=600, y=340)

tk.mainloop()

(isn't copy/paste a wonderful thing!).

 

EDIT: Oh and one of the joys of Python is that I can run that exact same code under Python in Windows and there it looks like this:

 

Last Edited: Mon. Apr 4, 2016 - 03:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Each line has so many bytes right? With a PIC for example

 

All you need to do here is put the data in you want below and write. this is nothing more then a general way to read and write to EEPROM (granted with a pickit3) .I would think the same could be done with a bootloader. Maybe i'm missing something?

 

nice py script btw, but yeah I'm guessing i'd need to write some stupid windows with runtime like in c# or something. Though I may give the py thing a go, do you need a runtime for compilation?

 

 

Last Edited: Mon. Apr 4, 2016 - 04:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

S_K_U_N_X wrote:
Though I may give the py thing a go, do you need a runtime for compilation?

Python is an interpreted language. Anyone wanting to run a Python script needs the Python interpreter installed.

 

Yes, there are tricks to make a scipted language program look like an ordinary executable, but for most cases that means that the EXE is a bundle of the interpreter, any used "libraries" and the actual "payload" script.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yeah, not sure that will work then but maybe get me one step closer. I would need a fairly polished app to do this without installing too much. The data window to the EEPROM could be just a list of boxes where they enter code. I guess I really need to make my own bootloader anyways.

Last Edited: Mon. Apr 4, 2016 - 04:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What you show in post #7 looks to be little more than a binary editor? In that case why not just have the user actually use a generic binary editor (hexedit, WinHex, etc) to create a x.bin, x.hex, x.srec or whatever then use avrdude to write that to the device?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it's a screen shot of a pic programmer the lower half writes to eeprom. "why not just have the user " The users would need a programmer right? That would not work.

 

about the image

I had the painful experience of using a PIC when I took over another Engineers role. We use that tool to flash code and we needed a way to config device out the door. So I just use the EEPROM data to write data. The shipping team just has to enter in the appropriate codes and write. Pretty simple tool for anyone to follow if they can read a few printed instructions. Now in this case we set up a burring station but I was hoping to use the same idea for another project I have. Only issue is that the user does not have a programmer. I figured the easy way to do this is to write a usb EEPROM writing app. I figured maybe I'm not the first to do this, hence my original question but perhaps my assumption was incorrect or like you said it would have been written too specific.

Last Edited: Mon. Apr 4, 2016 - 05:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suppose the binary editor (hexedit,..) would be used to prepare data to be sent, and , when the data are ready, they are sent to the eeprom...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

in my experience that does not work because of checksum calculations but I'm not sure avr has checksum .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I sometimes use ExtremeBurner to program the EEPROM using a USBasp programmer.  It's worked well for me.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

S_K_U_N_X wrote:
"why not just have the user " The users would need a programmer right? That would not work.

Well thank goodness that is NOT what I was suggesting then!

S_K_U_N_X wrote:
in my experience that does not work because of checksum calculations but I'm not sure avr has checksum .
then use an editor that can output .hex or .srec or one of the other BFD formats. Two minutes in Google suggests things like:

 

https://sourceforge.net/projects...

http://www.x-ways.net/winhex/ (actually I already mentioned that one ;-)

https://www.kde.org/applications...

 

For me perhaps the most interesting is actually:

 

https://pypi.python.org/pypi/bin...

 

In which case you could wrap this in a pretty GUI interface of your own design and that also then invoked avrdude or other bootloader app (use subprocess to do that bit).