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

Zeotoforth on the #18

Open
hinsech475 opened this issue Feb 2, 2023 · 7 comments
Open

Zeotoforth on the #18

hinsech475 opened this issue Feb 2, 2023 · 7 comments

Comments

@hinsech475
Copy link

hinsech475 commented Feb 2, 2023

I currently use zeptoforth built for rp2040, version 0.59.4 s a hobbyist on a Cytron MAKER PI PICO.
Seeed also has the Wio RP2040 mini Dev Board with Onboard Wifi. I have 3 of these dev boards and I would like to use them with zepto forth instead of the installed MicroPython.

Will zeptoforth also work on the Wio RP2040 mini Dev Board with Onboard Wifi?
Will zeptoforth be able to access the AT command SPI interface allowing use of the WiFi integrated on this board using the ESP8285 chip?

I appreciate your help.

Christian Hinse

@tabemann
Copy link
Owner

tabemann commented Feb 4, 2023

You gave me the idea to buy three WIO RP2040 mini Dev Boards in hopes that I manage to not break one of them when soldering them (I'm terrible at killing boards while soldering). I note from your posts on Forth2020 that you got zeptoforth running on one of your WIO RP2040's. Once I get my boards I will try to get the WiFi radio on it working with zeptoforth (it does not support it as of yet, but does have SPI support that can be used with it).

@arlaneenalra
Copy link
Contributor

OK!

One failure mode:

I have an oled hooked up to gpio 14/15 and have all of the files from the wiki Hello World example loaded oled.fs.txt. I concatenated them in order and set them up to compile-to-flash ... but that was just a convenience.

Running:

Note: I have the draw-string arguments out of order there .. with op-set in the wrong position.

oo import
bitmap import
ssd1306 import
font import
simple-font import

128 constant my-width
64 constant my-height

my-width my-height bitmap-buf-size constant my-buf-size
my-buf-size 4 align buffer: my-buf
<ssd1306> class-size buffer: my-ssd1306
14 15 my-buf my-width my-height SSD1306_I2C_ADDR 1 <ssd1306> my-ssd1306 init-object

init-simple-font

s" Hello, World!" my-width 2 / 7 13 * 2 / - my-height 2 / 8 2 / - my-ssd1306 op-set a-simple-font draw-string
$FF my-width 4 / my-width 2 / 0 my-height op-xor my-ssd1306 draw-rect-const
my-ssd1306 update-display

Several times in succession yields the Following:
failure-usb.txt

and on the serial console it yields:

failure-serial.txt

The last run crashed the chip so it no longer responds on usb. Sometimes it's failing with:

\ Put your Forth code to upload here.  ok
\   ok
\ Clicking 'Send' without a selection will upload the contents of this area to the target.  ok
\   ok
\ Clicking 'Send' with a selection will upload just the selection to the target.  ok
  ok
oo import wordlist order overflow
Error

on the usb console ... I wonder if there's a memory/stack exhaustion issue with error cases some where .. or the console is falling back to serial and dropping usb .. I just got it to reboot from the serial side through a debug probe even though it was using a serial console. Also, I'm not seeing stack traces on the USB console at all, they only show up on the serial side ...

Could that be what's going on? Something crashes out the USB stack and it's falling back to serial entirely?

@arlaneenalra
Copy link
Contributor

It could also be a red herring .. the situation I ran into this with might just not be easily recoverable ... though it is annoying you can't get stack traces on the USB side ..
hmm

@tabemann
Copy link
Owner

@arlaneenalra The wordlist order overflow message is because each time you ran your code, you pushed more wordlists onto the current wordlist order. Sooner or later it will overflow. A good way around this is to use the following:

continue-module forth
  oo import
  <put your code here>
end-module

That way your code will be in the default wordlist but will pop oo from the wordlist order. Note, however, if there is an error in between, you may have to manually execute oo unimport to remove it from the wordlist order.

@tabemann
Copy link
Owner

@arlaneenalra About the stack traces on the serial console only, that is because they are generated with the bare minimum functionality, as they assume that the system is in an undefined state, and USB is just too complex for them (i.e. too likely to not work when the system is in an undefined state).

@arlaneenalra
Copy link
Contributor

arlaneenalra commented May 22, 2023 via email

@tabemann
Copy link
Owner

@arlaneenalra I should note that

s" Hello, World!" my-width 2 / 7 13 * 2 / - my-height 2 / 8 2 / - my-ssd1306 op-set a-simple-font draw-string

is practically guaranteed to fail spectacularly; op-set is 0, btw. I'm almost surprised that you were able to recover at all from that.

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

3 participants