-
Notifications
You must be signed in to change notification settings - Fork 41
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
Port to ESP32 #19
Comments
It would be good. But I don't think esp-open-rtos supports the esp32 at this moment. If it will, then adding esp32 support to punyforth won't be difficult. An other option is to drop rtos and port only the bare-metal parts of punyforth. A contributor ported punyforth to the BeagleBone Black similarly. So, there are definitely plans to do so, but it is not yet decided how, and when. |
Thank you for the reply. Best regards. |
Cool, esp-idf should work too. Let me know if you have any questions. |
I would really like to see Punyforth ported to the ESP32 for two reasons: |
I made an attempt with esp-idf. After cutting out some pieces, punyforth compiled and started on an esp32. However it fails when the assembly code tries to call C functions from RTOS. Currently call0 is used for doing this but esp-idf functions are compiled in a way that they use RETW instruction instead of RET. The RETW indicates that the function is a windowed function which is supposed to be called with call4, call8 or call12 instead of call0. Basically there are two ways to call subroutines, one where the windowed hardware automatically saves some registers by rotating the register window and an other where register windows are not used (call0). I tired to replace call0 with call8 and call12 but didn't work. This needs more investigations as I not completely familiar with the Xtensa architecture. |
Do you have a snapshot of what you were trying it with ? I'm tempted to look at the micropython setup and how it's compiled, cf. micropython/micropython#5178 But if you already got down that path and got stumped, I'm probably no help either. |
Do you think it's worth it to try and see if any issues you saw are fixed, since the last update was about 18 months ago? I'm trying this right now, but before I spend too much time barking up the wrong tree: when you tried it, did you just copy punyforth into the esp-idf example directory, and then started to follow the build instructions/conventions there ? There's a fair amount of churn in the paths and naming of esp/rtos functions. If that's the wrong way to go about it, or there are other big changes that need to happen first, please let me know. |
OK, I gave this a try - after commenting out a bunch of functions whose API completely changed and will require some larger changes [1], I ended up with something that compiles but does not link: Either I leave the ldflags alone and then get lots of fatal warnings about dangerous relocations (probably because the binary is pretty large, beyond 512K I guess). Or, I specify
and get the linker error "undefined reference to `main'". I'm really a noob concerning the xtensa architecture, so I'm stuck here. I'll poke around a bit more but if someone with more insight can point me to the correct path that might speed up any resolution. [1] Seems to me that the esp32 port would probably be another arch and not a small patch of the esp8266 arch. |
Hi,
When Gforth is compiled there are also many errors.
No one seems to bother about them until they are fatal.
At the end of the compilation you get a success message so everyone knowns
the compilation succeeded.
I am not a C guru so I cannot help you out.
It seems "undefined reference to `main'" occurs when
the main() function does not exist in the program
Jos
From: Klapaucius
Sent: Monday, June 1, 2020 7:07 PM
To: zeroflag/punyforth
Cc: Subscribed
Subject: Re: [zeroflag/punyforth] Port to ESP32 (#19)
OK, I gave this a try - after commenting out a bunch of functions whose API
completely changed and will require some larger changes [1], I ended up with
something that compiles but does not link:
Either I leave the ldflags alone and then get lots of fatal warnings about
dangerous relocations (probably because the binary is pretty large, beyond
512K I guess).
Or, I specify
LDFLAGS += -mtext-section-literals
and get the linker error "undefined reference to `main'".
I'm really a noob concerning the xtensa architecture, so I'm stuck here.
I'll poke around a bit more but if someone with more insight can point me to
the correct path that might speed up any resolution.
[1] Seems to me that the esp32 port would probably be another arch and not a
small patch of the esp8266 arch.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Not an issue, but are there any plans to port punyforth to ESP32 ?
The text was updated successfully, but these errors were encountered: