rehxes
There is no ESP32-S3 board option but I want to add it to contribute. Even in Arduino IDE we need to choose OPI flash mode instead of QIO, to be able to upload the source code successfully and run the code on ESP32-S3 board.

Otherwise we see such an error:

Rebooting...
▒ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376a5c
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x43c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2a3c
entry 0x403c98d8

To sum up I need to change the flash mode , how can I do that in Open PLC editor while trying to upload to Arduino board ?
Reply 0 0
thiagoralves
That’s a little bit more complicated… I don’t have my computer with me right now, but I’ll give you a quick and dirty answer so you can try finding your way through it. On Monday I can give you more details if needed. But basically I think you will have to edit the builder.py file that has all the arduino-cli commands. Since this board doesn’t use the default upload method, you will have to specify it in the arduino-cli command line. I’m not sure what the command is, but Google might be able to give you the right answer
Reply 0 0
thiagoralves
Check what was done for the FX1N PLC as an example for this. That device also uses non-standard upload methods
Reply 0 0
rehxes
Check what was done for the FX1N PLC as an example for this. That device also uses non-standard upload methods


I couldn't find the source code that you mentioned for FX1N specific upload method. Can you give me a link for that ?
Reply 0 0
thiagoralves
You probably have an outdated version of the editor. Update the editor and check for it again. It will be there with the other .cpp hals. Just beware that updating the editor will replace all your modified files, so make a backup first
Reply 1 0
rehxes
Thank you, now I see. I will try my best to make it work.
Reply 0 0
murilo

Hi,

I’m trying to get ESP32-S3 board running without success. After uploading a ladder (blink) program i got at serial port:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403743c0
SPIWP:0xee
mode😃IO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
I installed the board here:
C:\Users\<%user%>\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\variants
through:
C:\Users\<%user%>\OpenPLC_Editor\editor\arduino\bin>arduino-cli-w32.exe core install esp32:esp32
 
it is an  esp32s3, so i add to
C:\Users\<%user%>\OpenPLC_Editor\editor\arduino\examples\Baremetal\hals.json

  "ESP32-S3": {
    "core": "esp32:esp32",
    "default_dout": "12, 13, 14, 15",
    "default_ain": "34, 35",
    "user_aout": "25",
    "last_update": 0,
    "source": "esp32s3.cpp",
    "version": "2.0.14",
    "user_ain": "34, 35",
    "platform": "esp32:esp32:esp32s3",
    "default_din": "27, 32",
    "default_aout": "25",
    "user_dout": "12, 13, 14, 15",
    "user_din": "27, 32",
    "define": "BOARD_ESP32"
  },
 
and create a copy of esp32.cpp (esp32s3.cpp) and delete(remark) the dacWrite entries

C:\Users\<%user%>\OpenPLC_Editor\editor\arduino\src\hal\esp32.cpp

// disable DAC block, as esp32-S3 does not have it
//    for (int i = 0; i < NUM_ANALOG_OUTPUT; i++)
//    {
//        if (int_output[i] != NULL) 
//           dacWrite(pinMask_AOUT[i], (*int_output[i] / 256));
//    }
 
It seems fine ( no error messages) but it does not work , there is no communication via  mod bus (Radzio) .
What can i try next?

Regards from Diadema.

 

Reply 0 0
thiagoralves
Instead of trying any communication, upload the blink example and test if the output blinks. If it does, then it is working
Reply 0 0
murilo

Hello Thiago,

It´s not working. Different hals.json didn´t help.  Most likely I defined my IO pins incorrectly.
My answer took so long cause I tried on Ubuntu 20.04.1, where esp32-s3 has different behaviour:

first /dev/ttyACM0 works fine for Leonardo, but for esp32-s3 you need to:

sudo usermod -a -G dialout $USER
 

to your $USER, but then OpenplcEditor complains about serial, then:

sudo apt install python3-serial
please see the attachment with output.

 

Reply 0 0
Reply