Closed mobluse closed 3 years ago
Looks like this example causes a C stack overflow, crashing the interpreter. I've tested a version with a smaller Snek heap, which leaves more space for the stack, and things work fine. See if this works for you!
When I connect to the Arduino UNO R3 with minicom -D /dev/ttyACM0
or press the reset button it shows:
<stdin>:51 out of memory
>
And not Welcome to Snek... It does show Welcome to Snek 1.7
briefly, but then the screen is deleted and the error message is shown instead.
In snekde I get (since it seems to remove Esc):
> Welcome to Snek 1.7
[2J[H<stdin>:51 out of memory
>
The while
example works now, but it's not so nice to be greeted with an error message.
I tried both this version and one that I compiled myself, but get the same result.
Flashing went without problems for both hex-files.
eeprom.erase()
fixed the issue with out of memory
on reset. There must have been some garbage there.
I installed Snek 1.7 on two Arduino UNO R3 boards. One original and one clone, but they give the same bug regarding the example with
while
from the tutorial in the documentation at https://sneklang.org/doc/snek.html#_while.The output stops after 70 F, and the Arduino UNO R3 is reset by itself. Sometimes it hangs and Ctrl+C doesn't work. I believe this is related to the formatted
print
since it works if I replace it withprint(F, C)
. Thefor
example works even though that also uses print with string interpolation.Flashing went without problems using a Raspberry Pi 4 B 8 GB with Raspberry Pi OS (Raspbian GNU/Linux 10 (buster)):
/home/pi/.local/share/arduino-1.8.16/hardware/tools/avr/bin/avrdude -C/home/pi/.local/share/arduino-1.8.16/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/home/pi/Downloads/snek/snek-uno-1.7.hex:i
I started with Snek only a few hours ago.