Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory troubles solved #45

Open
Jos-Ven opened this issue Feb 15, 2019 · 3 comments
Open

Memory troubles solved #45

Jos-Ven opened this issue Feb 15, 2019 · 3 comments

Comments

@Jos-Ven
Copy link

Jos-Ven commented Feb 15, 2019

Hi,
I had some trouble to flash punyforth. When using:
python flash.py /dev/ttyUSB0 --main blinker.forth

I got:
Writing at 0x0005f000... (100 %)
Wrote 1024 bytes at 0x0005f000 in 0.1 seconds (84.5 kbit/s)...
Erasing flash...

A fatal error occurred: Invalid head of packet.

Then after reading some more stuff I entered:
python esptool.py erase_flash
Reset the ESP8266
python flash.py /dev/ttyUSB0 --flashmode dio --main blinker.forth --modules gpio.forth
Ran it. And then:
python flash.py /dev/ttyUSB0 --flashmode dio --main blinker.forth --binary false

Now I got:
Writing at 0x0006b400... (100 %)
Wrote 2048 bytes at 0x0006b000 in 0.2 seconds (82.8 kbit/s)...

Leaving...

Finally, no memory error anymore. I think something was blocking access to the memory.

What is the highest possible address to which I can write to on my ESP8266 ESP-12F ?

Jos

@zeroflag
Copy link
Owner

@Jos-Ven probably the problem was that your esp doesn't support Quad I/O mode which is used by default by flash.py. When you switched to dio it looks like it started working.

@Jos-Ven
Copy link
Author

Jos-Ven commented Feb 18, 2019

Hi,

Thank you, I think you are right.
Being a complete newbie for PunyForth I would like you to ask if there is
a quick way to get to the (stack) prompt without restarting the whole Forth-system
as abort does.

Jos

@zeroflag
Copy link
Owner

zeroflag commented Feb 18, 2019

@Jos-Ven,

If you start Punyforth on the esp you should get the (stack) prompt automatically after the system booted. If you start some code that runs indefinitely in single task mode you can't access to the prompt until that code returns. However if you execute that code as a task in multitasking mode then you'll still see the prompt and you'll be able to interact with Punyforth further.

For example:

\ create a task for the consumer
0 task: mytask

: some-infinite-loop ( task -- )
  activate
  begin 
    println: "Still running..."
    1000 ms
    pause
  again ;

multi \ switch to multitask mode
mytask some-infinite-loop \ this will run the task in the background while the prompt is still active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants