Comments (5)
Enrique,
Please reread https://github.com/zeroflag/punyforth/wiki/Developing-and-deploying-Punyforth-applications
and try the example.
You just need to generate a new uber.forth for your application.
Hope this help you.
from punyforth.
Turnkey is an ongoing expermiment and it is meant to be an optimalization that speeds up startup time. This is only important if you try to power the esp using batteries (with deep sleep) and you don't want to waste power during startup. When you execute turnkey then it'll save the current state of the dictionary in binary form to the flash and it'll also insert a small loading code that reads the dictionary upon startup.
Usually you don't need this. Just follow the link what @GerardSontag mentioned there is the recommended way to save code permanently to the flash.
from punyforth.
Thank you Gerard and Attila !
Yes Gerard of course I am generating a new Ueber-forth with all associated dependencies,
(I do this by hand selecting all files, that I copy to the new Ueberforth. This part is not the problem).
The problem arises when I am loading the example of flash.forth to create the new Ueberforth,
Punyforth repeatedly reboots It seems there is an error in the code of flash.forth, please if you
can check that for me :
0 constant: FLASH_OK
1 constant: FLASH_ERR
2 constant: FLASH_TIMEOUT
3 constant: FLASH_UNKNOWN
( blocks )
exception: EBLOCK
4096 constant: SIZE
hex: 51000 init-variable: block0
FALSE init-variable: dirty
SIZE buffer: buf
variable: offs
: check-err ( code -- | EBLOCK )
dup FLASH_OK <> if
print: 'SPI FLASH ERROR: ' . cr
EBLOCK throw
then
drop ;
: >sector ( block# -- sector# ) SIZE / ;
: flush ( -- )
dirty @ if
offs @ >sector erase-flash check-err
SIZE buf offs @ write-flash check-err
FALSE dirty !
then ;
: block ( block# -- addr )
flush
SIZE * block0 @ + offs !
SIZE buf offs @ read-flash check-err
FALSE dirty !
buf ;
: update ( -- ) TRUE dirty ! ;
( screen editor )
128 constant: COLS
32 constant: ROWS
: row ( y -- addr ) COLS * buf + ;
: ch ( y x -- addr ) swap row + ;
: type# ( y -- ) dup 10 < if space then . space ;
: list ( block# -- )
block drop
ROWS 0 do
i type#
i row COLS type-counted
loop ;
\ editor command: blank row
: b ( y -- )
COLS 2 - 0 do 32 over i ch c! loop
13 over COLS 2 - ch c!
10 swap COLS 1- ch c!
update ;
: copy-row ( dst-y src-y -- )
COLS 0 do
2dup i ch c@ swap i ch c!
loop
2drop ;
\ editor command: delete row
: d ( y -- )
ROWS 1- swap do i i 1+ copy-row loop
ROWS 1- b ;
\ editor command: clear screen
: c ( -- ) ROWS 0 do i b loop ;
\ editor command: overwrite row
: r: ( y "line" -- )
dup b row
begin
key dup line-break? invert
while
over c! 1+
repeat
2drop ;
\ editor command: prepends empty row before the given y
: p ( y -- )
dup ROWS 1- do
i i 1- copy-row
-1 +loop
b ;
defer: boot
: dst ( -- n ) block0 @ SIZE + ;
: heap-size ( -- n ) usedmem align ;
: save-loader ( -- )
0 block drop c
0 row dup heap-size >str dup strlen +
str: ' heap-start ' over 12 cmove
12 + dup dst >str dup strlen +
str: ' read-flash drop boot' swap 22 cmove
update flush ;
: turnkey ( -- )
heap-size SIZE / heap-size SIZE % 0> abs + 0 do
dst >sector i + erase-flash check-err
loop
heap-size heap-start dst write-flash check-err
save-loader ;
from punyforth.
Hi Attila, I am sending line by line to debug and see what can be wrong, is it possible I am getting out of memory ?
I could advance up to "copy-row" definition, then the system sayd "fatal exception 9"
this is the dump of the screen:
(stack 1073673520) .. Fatal exception (9):
epc1=0x4023þþs2
epc2=0x 0
epc3=0x402033þo
excvaddr=0x4010434s
depc=0x 0
excsave1=0x402133$4
Registers:
a0 402133$4 a1 3sss�f$0 a-2d 2
a-2d 3
a-2d 4�a-2d 54a-2d 6ha-2d $�a-2d áOa-2d þða-2d ?ÿa-2d � a-2d o
from punyforth.
@enriquepinedo, you can check the available free dictionary space by typing
freemem . cr
It's possible you've ran out of free space as the available dictionary space is fairly limited (about 24k).
from punyforth.
Related Issues (20)
- Minor inconsistency in documentation. HOT 1
- Complete word list with usage HOT 2
- Just for fun
- Mistype in README.md HOT 1
- A new fast flash utility HOT 1
- An interesting bug in the example dht22-data-loger or in netcon?
- highbit HOT 6
- Seriously? Python?
- Contributions HOT 2
- Convert flash.py to python3 HOT 1
- Flash starts but doesn't finish properly HOT 5
- Different speeds for multiple motors
- Word Glossary I have written HOT 3
- TASKS - when restarting a task, the data and return stack are not empty HOT 1
- Connected but no sending from the terminal HOT 1
- port on ESP-01 ? HOT 1
- Can TCP REPL eval be replicated using just strings? HOT 2
- TCP-REPL triggers ESP8266 Restart? HOT 3
- Receiving binary data via UDP
- This line should be.... .int xt_drop2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from punyforth.