From: Peter M. <spa...@pm...> - 2019-06-15 20:39:49
|
>> Corresponding web page: >> http://amforth.sourceforge.net/TG/recipes/Turnkey.html >> >> >> The error message is the non-descriptive: >> >> ?? -13 23 >> >> 'Evalue' was found in: >> >> \lib\forth2012\core\avr-values.frt >> > On 12/06/2019 01:37, Tristan Williams wrote: > Hello Peter and welcome, > > I have just tried the turnkey example from the docs > > http://amforth.sourceforge.net/TG/recipes/Turnkey.html > > and it works for me. > > Your error message[1] ?? -13 23 after the line > > ' turnkey defer@ Evalue tk.amforth > > suggests that you are missing the word Evalue Yes, it turned out I was on the second flash of AmForth (on a separate chip), with "Evalue" being defined on the first chip... (something went wrong and I had to flash AmForth again). > Have you loaded these files on your mcu? > > avr-values.frt > is.frt > ms.frt > defers.frt > > as the line > > ' turnkey defer@ Evalue tk.amforth > > depends on words defined in these files. I have done that now, and it works now! That was probably the crucial step (though I don't understand why(?)). I could also define "tk.custom" and set it up with " ' tk.custom is turnkey ", putting my main init and infinite control loop in there, all in word "mainApplication". After a power cycle, the control loop ran immediately, as it should. The control loop can be terminated by removing a jumper that pulls a digital input low (pulled up externally with 10 kΩ). The jumper is located on my custom Arduino shield. Also, connecting the Arduino Uno to USB while in the control loop (mainApplication) does not reset the I/O and does not disrupt the operation (unlike normally, where, even if powered from a 9 V battery source, connecting will reset - though I cannot rule out power glitches). When the jumper is removed the normal interactive stuff is available. Everything works as it should!! For this try, I had to flash AmForth a third time (due to another incident, an unfortunate paste error...) and used the opportunity to see if I could repeat it. This was also to automate as much as possible (.BAT script calling AVRDUDE for the flashing, launching PuTTY with the profile for this (38400 baud, etc.), and running several AutoIt scripts for the source pasting). There were a few corrections. The fourth time, with a few more changes for automation (mostly focus changes in Windows), should reduce it to moving the chip from the ISP programmer to the Arduino and a single press of Enter when it has been moved. But this is not needed for this first deployment, only for subsequent versions (if there will ever be more). With direct ICSP, just starting the script should be enough. : tk.custom \ Call the previous turnkey action. tk.amforth execute \ Now something specific e.g. \ I_O-setup mainApplication ; Regards, Peter |