Error on Install, Nano ESP32


#1

Attempting to build:
My attempt to build for the Nano ESP. Build for the Uno R4 was successful. I an new to Lisp/uLisp but long time developer, mostly C, C++, Perl. Lots of work with Particle boards.

uLisp ESP Release 4.4d

For Arduino Nano ESP32

Installing uLisp from the Arduino IDE
• Install the ESP32 Arduino core version 2.0.3 or later.
• Select ESP32 Arduino from the Board menu.
• Select the ESP32S2 Dev Module board opt

Compile Errors:

/Users/donaldthompson/Documents/Arduino/uLisp-ESP/uLisp-ESP.ino:1952:29: error: macro “tone” requires 3 arguments, but only 2 given
void tone (int pin, int note) {
^
/Users/donaldthompson/Documents/Arduino/uLisp-ESP/uLisp-ESP.ino:1965:54: error: macro “tone” requires 3 arguments, but only 2 given
tone(pin, pgm_read_word(&scale[note%12])>>prescaler);
^

exit status 1

Compilation error: macro “tone” requires 3 arguments, but only 2 given


#2

I think this must be a bug in the Arduino Nano ESP32 core, because tone() is defined as allowing two arguments:

tone() - Arduino Reference

Reported here:

tone() does not accept two arguments


#3

Here are the changes to get uLisp to compile for the Arduino Nano ESP32:

1 In the file:

packages/arduino/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h

change the line:

#define tone(_pin, frequency, duration)     tone(digitalPinToGPIONumber(_pin), frequency, duration)

to:

#define tone(_pin, args...)                 tone(digitalPinToGPIONumber(_pin), args)

2 Add a section at the start of the uLisp source after the one for the ESP8266:

#elif defined(ARDUINO_NANO_ESP32)
  #define WORKSPACESIZE (9216-SDSIZE)     /* Cells (8*bytes) */
  #define LITTLEFS
  #include <LittleFS.h>
  #define SDCARD_SS_PIN 13

3 Delete or comment out these lines:

void tone (int pin, int note) {
  (void) pin, (void) note;
}

void noTone (int pin) {
  (void) pin;
}

When I get hold of a board I’ll release an update to the ESP version of uLisp to support it properly.


#4

I thought I was jumping the gun on this board but just received it and want to use it to teach my granddaughter programming. Although I haven’t used Lisp I did play with it some back in the late ‘60s in college. In Domkin’s book ‘Programming Algorithms in Lisp’ he talks about Lisp as a teaching language and the importance of a clean slate. Kinzee is ten, very good at math, loves to build things, likes to watch my projects, so we’re learning Lisp together. Thanks for your quick and detailed respinse.


#5

I made the changes listed above, fixing the number of args to tone, but now I get this error:

exit status 1
Compilation error: 'pserial' was not declared in this scope

Build for UNO NANO aned UNO R4 are clean.
Any ideas why pserial is missing?
Thanks


#6

Just to check:

  • You’re using an Arduino Nano ESP32 board?
  • You’re using the ESP32 Arduino (Arduino) core?
  • You’re using ESP uLisp 4.4d?
  • You’ve left the default uLisp Compile options?

#7

your ‘to check’:

  • You’re using an Arduino Nano ESP32 board?
  • You’re using the ESP32 Arduino (Arduino) core?
  • You’re using ESP uLisp 4.4d?
  • You’ve left the default uLisp Compile options ?

My Verification:
Yes on first three:

Fourth: are these the compile options you refer to?:

// Compile options
// #define resetautorun
#define printfreespace
// #define printgcs
// #define sdcardsupport
// #define gfxsupport
// #define lisplibrary
// #define lineeditor
// #define vt100
// #define extensions

I have not changed any of the above, or anything else.
I have also retried by removing all of the boards under Board Manager and re-installing
just ‘Arduino ESP32 Boards’ 2.0.11

I have two working so I’ll just wait until you get around to adding support for this guy.
Thanks for all your great work on this project!
Don


#8

One further question: what version of the Arduino IDE are you using, and on what operating system (Mac/Windows/Linux)?

On Mac I can compile without getting this error, but you might try adding:

void pserial (char c);

after the heading:

// Forward references

#9

A post was split to a new topic: Arduino Nano ESP32: not recommended for use with uLisp