Discussion:
Continue with the XTENSA assembler in ESP32forth
(too old to reply)
Marc Petremann
2022-11-20 22:45:00 UTC
Permalink
Let's continue exploring the resources of the XTENSA assembler. Mastery of the instruction set opens up interesting possibilities.
https://esp32.arduino-forth.com/article/XTENSA_nextXtensaSteps
Zbig
2022-11-21 10:41:35 UTC
Permalink
Maybe it would be possible to prepare also UF2 binary of ESP32forth?
It would make the installation significantly easier.
Marc Petremann
2022-11-21 20:47:56 UTC
Permalink
Post by Zbig
Maybe it would be possible to prepare also UF2 binary of ESP32forth?
It would make the installation significantly easier.
Here:

https://esp32.arduino-forth.com/public/files/ESP32forthV7074.zip

ZIP with binary files.....

Instal instructions here:

https://esp32.arduino-forth.com/article/installation_instalFromBinaries
Zbig
2022-11-21 21:09:22 UTC
Permalink
Post by Marc Petremann
https://esp32.arduino-forth.com/public/files/ESP32forthV7074.zip
ZIP with binary files.....
https://esp32.arduino-forth.com/article/installation_instalFromBinaries
The point was to make it easier, without any need for additional ST
programmer, like this:

„Instead of needing drivers or a separate program for flashing (say, bossac,
jlink or avrdude), one can simply drag a file onto a removable drive. The format
of the file is a little special. Due to 'operating system woes' you cannot just drag
a binary or hex file (trust us, we tried it, it isn't cross-platform compatible). Instead,
the format of the file has extra information to help the bootloader know where the
data goes. The format is called UF2 (USB Flashing Format). Microsoft MakeCode
generates UF2s for flashing and CircuitPython releases are also available as UF2.”
( https://learn.adafruit.com/adafruit-hallowing/uf2-bootloader-details )

I didn't use such kind of files yet — but if the Mecrisp guys were
able to prepare it for RP2040, then it must be feasible somehow.
I'll try to „convert” your binaries.
SpainHackForth
2022-11-22 15:30:31 UTC
Permalink
Post by Zbig
Post by Marc Petremann
https://esp32.arduino-forth.com/public/files/ESP32forthV7074.zip
ZIP with binary files.....
https://esp32.arduino-forth.com/article/installation_instalFromBinaries
The point was to make it easier, without any need for additional ST
„Instead of needing drivers or a separate program for flashing (say, bossac,
jlink or avrdude), one can simply drag a file onto a removable drive. The format
of the file is a little special. Due to 'operating system woes' you cannot just drag
a binary or hex file (trust us, we tried it, it isn't cross-platform compatible). Instead,
the format of the file has extra information to help the bootloader know where the
data goes. The format is called UF2 (USB Flashing Format). Microsoft MakeCode
generates UF2s for flashing and CircuitPython releases are also available as UF2.”
( https://learn.adafruit.com/adafruit-hallowing/uf2-bootloader-details )
I didn't use such kind of files yet — but if the Mecrisp guys were
able to prepare it for RP2040, then it must be feasible somehow.
I'll try to „convert” your binaries.
I believe this is part of the bootloader not the firmware itself....
https://learn.adafruit.com/adafruit-metro-esp32-s2/install-uf2-bootloader
Zbig
2022-11-22 22:30:03 UTC
Permalink
Post by SpainHackForth
Post by Zbig
I didn't use such kind of files yet — but if the Mecrisp guys were
able to prepare it for RP2040, then it must be feasible somehow.
I'll try to „convert” your binaries.
I believe this is part of the bootloader not the firmware itself....
https://learn.adafruit.com/adafruit-metro-esp32-s2/install-uf2-bootloader
Well, the bootloader „cost” is about 20 kB. It may be somewhat „expensive”
for board like STM32F103C8T6, that features 64 kB — but we can afford it
in case of ESP32, since Flash size of these is counted in megabytes, so we
can sacrifice that few kB just to work with this more comfortably.

From what I can see transforming „raw binary” into UF2 file is a matter of
adding properly kind of „header”, that will be used by the bootloader to
place the binary's contents into proper location.
Searching the details, how to do this.
Marc Petremann
2022-11-23 09:15:56 UTC
Permalink
Hello,
You are getting out of the initial subject which concerns the XTENSA assembler for ESP32forth.
I would appreciate it if you would stick to the original topic.
Post by SpainHackForth
Post by Zbig
Post by Marc Petremann
https://esp32.arduino-forth.com/public/files/ESP32forthV7074.zip
ZIP with binary files.....
https://esp32.arduino-forth.com/article/installation_instalFromBinaries
The point was to make it easier, without any need for additional ST
„Instead of needing drivers or a separate program for flashing (say, bossac,
jlink or avrdude), one can simply drag a file onto a removable drive. The format
of the file is a little special. Due to 'operating system woes' you cannot just drag
a binary or hex file (trust us, we tried it, it isn't cross-platform compatible). Instead,
the format of the file has extra information to help the bootloader know where the
data goes. The format is called UF2 (USB Flashing Format). Microsoft MakeCode
generates UF2s for flashing and CircuitPython releases are also available as UF2.”
( https://learn.adafruit.com/adafruit-hallowing/uf2-bootloader-details )
I didn't use such kind of files yet — but if the Mecrisp guys were
able to prepare it for RP2040, then it must be feasible somehow.
I'll try to „convert” your binaries.
I believe this is part of the bootloader not the firmware itself....
https://learn.adafruit.com/adafruit-metro-esp32-s2/install-uf2-bootloader
Jach Feng
2022-11-23 01:20:23 UTC
Permalink
Zbig 在 2022年11月21日 星期一下午6:41:37 [UTC+8] 的信中寫道:
Post by Zbig
Maybe it would be possible to prepare also UF2 binary of ESP32forth?
It would make the installation significantly easier.
I don't think a bootloader will help in the situation where the board may come from different sources.
1) How the user flash the chip at the first time?
2) What if the bootloader was messed up sometime later?
Unless it was embedded in the chip's ROM, it's not a reliable solution.
Marc Petremann
2022-11-23 09:15:36 UTC
Permalink
Post by Jach Feng
Zbig 在 2022年11月21日 星期一下午6:41:37 [UTC+8] 的信中寫道:
Post by Zbig
Maybe it would be possible to prepare also UF2 binary of ESP32forth?
It would make the installation significantly easier.
I don't think a bootloader will help in the situation where the board may come from different sources.
1) How the user flash the chip at the first time?
2) What if the bootloader was messed up sometime later?
Unless it was embedded in the chip's ROM, it's not a reliable solution.
Hello,
You are getting out of the initial subject which concerns the XTENSA assembler for ESP32forth.
I would appreciate it if you would stick to the original topic.
Zbig
2022-11-23 09:43:47 UTC
Permalink
Post by Jach Feng
Post by Zbig
Maybe it would be possible to prepare also UF2 binary of ESP32forth?
It would make the installation significantly easier.
I don't think a bootloader will help in the situation where the board may come from different sources.
1) How the user flash the chip at the first time?
Usually the boards come already flashed with some kind of
bootloader (like Arduino). If not — it can be installed later
anyway, for example:

Post by Jach Feng
2) What if the bootloader was messed up sometime later?
In such case most probably it can be installed again. :)
Post by Jach Feng
Unless it was embedded in the chip's ROM, it's not a reliable solution.
Why not? It works elsewhere else (Arduino, STM32 etc.) without
embedding it in the chip's ROM.

BTW: I'd like to point your attention to the fact, that XTENSA assembler
for ESP32forth is very useful and interesting.
dxforth
2022-11-23 10:06:41 UTC
Permalink
Post by Zbig
BTW: I'd like to point your attention to the fact, that XTENSA assembler
for ESP32forth is very useful and interesting.
Add-on assemblers for Forth and tutorials for same have been around forever.
There's something special about this one?
Zbig
2022-11-23 10:18:10 UTC
Permalink
Post by dxforth
Post by Zbig
BTW: I'd like to point your attention to the fact, that XTENSA assembler
for ESP32forth is very useful and interesting.
Add-on assemblers for Forth and tutorials for same have been around forever.
There's something special about this one?
Well this one allows coding „primitive” words directly in ESP32forth. :)
Marc Petremann
2022-11-23 11:25:44 UTC
Permalink
Post by Zbig
Post by dxforth
Post by Zbig
BTW: I'd like to point your attention to the fact, that XTENSA assembler
for ESP32forth is very useful and interesting.
Add-on assemblers for Forth and tutorials for same have been around forever.
There's something special about this one?
Well this one allows coding „primitive” words directly in ESP32forth. :)
You have many examples here:

https://github.com/MPETREMANN11/ESP32forth/blob/main/assembler/myXtensaTests.txt
Zbig
2022-11-25 14:05:28 UTC
Permalink
Post by Marc Petremann
Post by Zbig
Well this one allows coding „primitive” words directly in ESP32forth. :)
https://github.com/MPETREMANN11/ESP32forth/blob/main/assembler/myXtensaTests.txt
Thanks! I'll have to test them using „traditional” way of programming ESP32,
since uploading by USB is perfectly possible, but apart of binary conversion
there's a need for dedicated bootloader. So either some good soul prepared one
for you — or there's a need to create that bootloader by oneself.
There are bootloaders already available for ESP32-S2 and ESP32-S3 (here:
https://github.com/adafruit/tinyuf2/releases ), but not for my ESP-WROOM-32
based dev board („yet”?), unfortunately.

SpainHackForth
2022-11-23 11:44:31 UTC
Permalink
Post by dxforth
Post by Zbig
BTW: I'd like to point your attention to the fact, that XTENSA assembler
for ESP32forth is very useful and interesting.
Add-on assemblers for Forth and tutorials for same have been around forever.
There's something special about this one?
Well, if you know the history of the Xtensa platform, you would better understand that while it's not new to have a compiler and de-compiler in Forth, it is a great deal more effort to get it done on the XTENSA platform.
uForth is moving in a direction that gives it portability beyond the ESP32 platform, and as Espressif moves to RiskV, it opens up the horizon even more...
dxforth
2022-11-24 01:03:07 UTC
Permalink
Post by SpainHackForth
Post by dxforth
Post by Zbig
BTW: I'd like to point your attention to the fact, that XTENSA assembler
for ESP32forth is very useful and interesting.
Add-on assemblers for Forth and tutorials for same have been around forever.
There's something special about this one?
Well, if you know the history of the Xtensa platform, you would better understand that while it's not new to have a compiler and de-compiler in Forth, it is a great deal more effort to get it done on the XTENSA platform.
Get what done? Coding in assembler and writing assemblers in Forth is nothing new.
If ESP32Forth is lacking basic docs requiring someone else to delve in and document it,
then I'm afraid that's nothing new either.
Post by SpainHackForth
uForth is moving in a direction that gives it portability beyond the ESP32 platform, and as Espressif moves to RiskV, it opens up the horizon even more...
Projecting into the future is what Forth does best :)
Loading...