ulisp 4.7a on ESP32: Compilation error


#1

I have an ESP32 development board, and I downloaded uLisp ESP Release 4.6, which runs correctly on Arduino IDE 2.3.7. The Board Manager has Arduino ESP32 Boards version 2.0.18-arduino.5 installed. However, when I downloaded the latest version 4.7a and ran Verify in Arduino IDE 2.3.7, the following error occurred:

/home/Arduino/Code/sketch_apr24a/sketch_apr24a.ino: In function ‘object* eval(object*, object*)’:
/home/Arduino/Code/sketch_apr24a/sketch_apr24a.ino:6047:53: error: ‘MAX_STACK’ was not declared in this scope; did you mean ‘SET_STACK’?
6047 | if ((uint32_t)StackBottom - (uint32_t)&stackpos > MAX_STACK) { Context = NIL; error2(“stack overflow”); }
| ^~~~~~~~~
| SET_STACK
exit status 1

Compilation error: ‘MAX_STACK’ was not declared in this scope; did you mean ‘SET_STACK’?

I think this should be a bug, but I don’t know how to fix it.


#2

The value of MAX_STACK is set by a #define in the list of boards near the beginning of the uLisp source file, and I can see that it’s missing for a couple of boards. It should be something like:

#define MAX_STACK 7000

What board are you compiling for?


#3

I’m using ESP32.

I can find the code where define is used, but it doesn’t seem to take effect.

#elif defined(ESP32) /* Generic ESP32 board /
#define WORKSPACESIZE (9216-SDSIZE) /
Objects (8*bytes) */
#define MAX_STACK 7000


#4

I added #define MAX_STACK 7000 under the #if defined(ARDUINO_ESP32_DEV) section of the code, and it compiled successfully. However, is the MAX_STACK value for ARDUINO_ESP32_DEV 7000?"


#5

Yes, that will be OK. Thanks for reporting that - I’ll fix it next release.


#6