simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Self-programming question


From: ThomasK
Subject: Re: [Simulavr-devel] Self-programming question
Date: Fri, 09 Jul 2010 19:38:32 +0200
User-agent: Thunderbird 2.0.0.24 (X11/20100317)

Hi Quatre,

One thing that I want to test in my application is self-programming flash using the SPM command. The stable branch in the git repository does not provide support for the SPM instruction. However, the master branch seems to, as there is code for it in decode.cpp. What is the state of the master branch, and would I be able to use the SPM command successfully?
If yes, I think in the SPM code in decode.cpp, using SPM outside of the 
No-Read-White-Write section is ignored. From what I can tell from the atmega128 
data sheets, it seems the microcontroller will allow the SPM command both in 
the Read-While-Write and No-Read-While-Write sections. Is preventing the SPM 
command in the Read-While-Write section a simplification, to prevent 
potentially unpredictable behaviour?

One last question. Is there an example or test available showing the simulator 
using the SPM command?

You're right. stable branch ist the state of simulavr before we switched to git and before Onno started to make some improvments and new features. The master branch is the latest and hopefully stable code of simulavr. Unfortunately we havn't made a release from this new code till now.

And you're right too, that in master branch is self-programming functionality. I've tested (and developed ... ;-) ) it with amforth! amfoth uses programming to save new forth words. So it should work for normal programming cases. In the moment I work on fuses, lock bits and some special lpm and spm functionality. This code you'll find in devel-tomk branch. But hold in mind, this is code in development!

A coding example for spm programming isn't available. I have written some tests for reading fuses, reading and writing lock bits. This is actually only in devel-tomk branch. (you'll find it below regress directory!) But not for writing some data to flash. I think, that I'll do that next time, because it's a good idea to have some tests for that too. If you like, you can start with this test programs to write such test for programming a flash block by spm self programming.

cu, Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]