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

Problem with flashing modules #38

Closed
craiglindley opened this issue May 9, 2018 · 4 comments
Closed

Problem with flashing modules #38

craiglindley opened this issue May 9, 2018 · 4 comments

Comments

@craiglindley
Copy link

I followed the documentation in the readme file and successfully flashed a esp8266 using the following commands on my mac:
python flash.py /dev/tty.SLAB_USBtoUART

My understanding is that without specifying which modules to program, all modules would be programmed including the GPIO module. Unfortunately when I type help to see all defined words, words like GPIO_HIGH or GPIO_IN, etc. are not found. Further more when I try to examine the value of GPIO_HIGH it is undefined.

Then I attempted to specify the GPIO module directly using the following command line it still doesn't work.
python flash.py /dev/tty.SLAB_USBtoUART --modules core gpio flash

What am I doing wrong?

I should also say that the docs still shows the use of modules.py file to control which forth modules to be included in uber.forth. It now seems uber.forth is no longer used and the modules.py functionality is now included in the flash.py file. Please update the docs to match the code when you get a chance.

@zeroflag
Copy link
Owner

zeroflag commented May 9, 2018

Yeah, in the recent version this changed quite much. The flash.py flashes everything by default, so GPIO is there. In order to use it you have to load it by either typing

(stack) GPIO load

in the REPL, or by adding GPIO load to the beginning of your program (or right before you wan't to use GPIO related words). This is similar than an import in other languages. If you load something multiple times, it will eventually eat up the dictionary space so make sure you load it once.

So normally you don't need to worry about what modules you want to have up front. You just flash everything and later you can load anything into memory if needed.

I still need to update the doc about this.

@craiglindley
Copy link
Author

craiglindley commented May 9, 2018 via email

@zeroflag
Copy link
Owner

zeroflag commented May 9, 2018

yes, that is correct.

Here are the names of the available modules:

https://github.com/zeroflag/punyforth/blob/master/arch/esp8266/bin/flash.py#L236

CORE is already loaded.

@zeroflag
Copy link
Owner

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