Skip to content
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

support for ESP32 #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

support for ESP32 #90

wants to merge 6 commits into from

Conversation

jafrado
Copy link

@jafrado jafrado commented Feb 14, 2022

No description provided.

@DavideLentini
Copy link

Hi ! What version of esp32-wroom have you use when you compiled this new support for the esp32 ? Thanks !

@jafrado
Copy link
Author

jafrado commented Oct 20, 2022

ESP32-WROOM-32UE

@DavideLentini
Copy link

ESP32-WROOM-32UE

Thank you for the kindness .The specifications of this esp32wroom32eu please confirm me that they are these following ? :

Xtensa® dualcore 32bit LX6 microprocessor

@jafrado
Copy link
Author

jafrado commented Oct 20, 2022

Yes, that is correct. The chip is here: https://www.sparkfun.com/products/17746 and you can use the devboard listed in README

@DavideLentini
Copy link

Thanks !

@jafrado
Copy link
Author

jafrado commented Oct 20, 2022

You’re welcome. I hope it works out for you.

@DavideLentini
Copy link

Hi , yes thanks I was able to merge with my branch and compile , but first I had to merge with the updated version of mavesp8266 from the ardupilot branch :
https://github.com/ArduPilot/mavesp8266
Your fork unfortunately was based on a somewhat old version , but it does the same . In a few days I should have a chance to test it on an ESP32-S3-MINI1

@jafrado
Copy link
Author

jafrado commented Nov 25, 2022

What’s in the Ardupilot branch ?
I based mine off of Gus’s work, which is the original work; I guess ardupilot guys forked theirs and made mods?

Please send me a link to your branch and I will check it out; I have new boards that are showing up in a few days.

@DavideLentini
Copy link

DavideLentini commented Nov 25, 2022

What’s in the Ardupilot branch ?
I based mine off of Gus’s work, which is the original work; I guess ardupilot guys forked theirs and made mods?

Please send me a link to your branch and I will check it out; I have new boards that are showing up in a few days.

I'll do it thanks :) Yes Ardupilot's guys made some mods . By the way you can test your version on a esp32-s3-mini1 ? It would be wonderful

@jafrado
Copy link
Author

jafrado commented Nov 26, 2022 via email

@DavideLentini
Copy link

DavideLentini commented Nov 26, 2022

Thanks ! Yes a lot of people use the mavesp version of ardupilot , and due to my long use of it I decided to make the merge with your fork for use the esp32 . The hardware is this : https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.espressif.com/sites/default/files/documentation/esp32-s3-mini-1_mini-1u_datasheet_en.pdf&ved=2ahUKEwiMxea7l8v7AhVMhP0HHdwoD3wQFnoECB0QAQ&usg=AOvVaw0yREMamIU9NmRjoYoXUXGB
Thanks a lot

@DavideLentini
Copy link

@jafrado Hi! Did you have any chance to test your fork with the esp32-s3-mini1? I would be interested in it , because I want to use it for my drone . Thank you very much ! :)

@jafrado
Copy link
Author

jafrado commented Nov 28, 2022 via email

@jafrado
Copy link
Author

jafrado commented Dec 1, 2022 via email

@DavideLentini
Copy link

Hello ! Sorry for the delay in replying . Actually it is a test we want to do on s3-mini 1 chip , but I think in case of incompatibility with your fork we could switch to esp32 wroom . I will start an issue for the port with S3 in your fork not to clog the discussion here :) . I am more on the software side so I couldn't point you to a good link for an external antenna for the s3-mini1 , but I will talk to the hardware guy ; However I think for a compatibility test you don't need an external antenna right ?
Do you think it is possible to port your fork for the s3-mini1 in case ?

@jafrado
Copy link
Author

jafrado commented Dec 1, 2022 via email

@DavideLentini
Copy link

No problem. sure I will buy the sparkfun module unless you have another bored you want me to look at…On Dec 1, 2022, at 7:35 AM, Davide_Lentini @.***> wrote:
Hello ! Sorry for the delay in replying . Actually it is a test we want to do on s3-mini 1 chip , but I think in case of incompatibility with your fork we could switch to esp32 wroom . I will start an issue for the port with S3 in your fork not to clog the discussion here :) . I am more on the software side so I couldn't point you to a good link for an external antenna for the s3-mini1 , but I will talk to the hardware guy ; However I think for a compatibility test you don't need an external antenna right ?
Do you think it is possible to port your fork for the s3-mini1 in case ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

At the moment no , not another board :) thank you for your patience and support !

@jafrado
Copy link
Author

jafrado commented Dec 7, 2022

@DavideLentini , ok, I researched this. It is hard to get the hardware besides the PCB antenna modules, and they are crap, you will not even be able to fly 1km or 1/4 mile at 100' - I know because I tested it. My current system works well over a mile, closer to 1.5 miles (about 3km). But then again, most consumers are ok with short range on PCB antenna.

Anyhow, it sounds like a new hardware platform build is needed - I found out the ESP32-WROOM is not recommended for new designs. None of the available S3 boards are any good for use in drones because there is no external antenna - all PCB. I have my own design I have been using for this pull request. I documented it here - https://github.com/jafrado/mavesp8266/wiki/WLAN-Mavlink-Router-Bridge-Development
Please comment on this, if you want any features not listed let me know. What would be really good is the dimensions. I use 300kv T-Motors and ESC and I am turning 18" props for my quad and hex, you may have different power and form-factor requirements then me. For the first few samples, I will only ask you to pay at cost if you help me test.

@DavideLentini
Copy link

@jafrado
Hi ! Thanks for your effort !
Actually we have this dev kit in our lab ( arrived few days ago ) , and we're available to test an eventually mavesp8266 ardupilot fork firmware build with this kind of board .
Also we are not interested in a long range flight . If you have a discord account , we can chat there , it's easier .
https://au.mouser.com/ProductDetail/356-ESP32S3DEVKTM1N8

@jafrado
Copy link
Author

jafrado commented Dec 7, 2022 via email

@jafrado
Copy link
Author

jafrado commented Dec 7, 2022 via email

@jafrado
Copy link
Author

jafrado commented Dec 8, 2022

@dogmaphobic - are you alive? I hope so; I don't see you online anymore and you've ghosted everyone! Miss you man!

@jafrado
Copy link
Author

jafrado commented Dec 8, 2022

@DavideLentini I merged the Ardupilot master with this code base. It builds for ESP32WROOM but I have not tested on HW yet.
Separately, I added the ESP32-S3 documentation based on PlatformIO ESP32-S3 support. It doesn't build when I run it though:

area51:~/esp8266/Arduino/mavesp8266> platformio --version
PlatformIO Core, version 6.1.4
area51:~/esp8266/Arduino/mavesp8266>

area51:~/esp8266/Arduino/mavesp8266> platformio run -e esp32-s3-devkitc-1 -t upload
Processing esp32-s3-devkitc-1 (platform: espressif32; framework: arduino; board: esp32-s3-devkitc-1)
--------------------------------------------------------------------------------
Error: Unknown board ID 'esp32-s3-devkitc-1'
area51:~/esp8266/Arduino/mavesp8266>

Probably I need a new version, I have been using this one since it is stable and flight tested.
Please add the below to your platformio.ini file and let me know what you find.

I get my S3 board on Friday, I will test that and the WROOM this weekend. Ciao!

[env:esp32-s3-devkitc-1]
platform = espressif32
framework = arduino
board = esp32-s3-devkitc-1
; change microcontroller
board_build.mcu = esp32s3
; change MCU frequency
board_build.f_cpu = 240000000L


@DavideLentini
Copy link

@jafrado
Hello ! Fantastic .
Then , also I had tried to compile a firmware with the new board in the platformio.ini , I could pass the board ID check , but it gave many errors on various libraries .
Anyway I will try again today or tomorrow to make some screens and share them .
So please confirm me , will you get this board on Friday ?
https://au.mouser.com/ProductDetail/356-ESP32S3DEVKTM1N8
We are so interested in testing it on this board because it would seem to be the only one available on the list for compatibility with ArduRemoteId , but that is another story !
Now let's focus on creating a port of your current fork esp32 for this board(the one I have in the lab) and for your wroom.
Thank you very much for your help

@DavideLentini
Copy link

DavideLentini commented Dec 8, 2022

yes, I got the exact board that you sent me, it will arrive in probably 24 hoursSee if you can get the platformio compiler set up and what version you’re using to compile for ESP32 – S3That will help a lot!On Dec 7, 2022, at 10:49 PM, Davide_Lentini @.> wrote: @jafrado Hello ! Fantastic . Then , also I had tried to compile a firmware with the new board in the platformio.ini , I could pass the board ID check , but it gave many errors on various libraries . Anyway I will try again today or tomorrow to make some screens and share them . So please confirm me , will you get this board on Friday ? https://au.mouser.com/ProductDetail/356-ESP32S3DEVKTM1N8 We are so interested in testing it on this board because it would seem to be the only one available on the list for compatibility with ArduRemoteId , but that is another story ! Now let's focus on creating a port of your current fork esp32 for this board(the one I have in the lab) and for your wroom. Thank you very much for your help —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

image
Fantastic .
So I checked just now , I usually use a sh script to compile everything faster .
The platformio version I have is 6.1.4 , I entered the same parameters as yours in the platformio.ini . Attached here is the initial compilation result .
Next there are various errors for various different files , always referring though to the ESP8266WiFi.h library .
fatal error: ESP8266WiFi.h: No such file or directory
I tried compiling for wroom32 as well and everything works perfectly . Could it be for a library incompatibility with the arduino framework?

@jafrado
Copy link
Author

jafrado commented Dec 8, 2022 via email

@DavideLentini
Copy link

@jafrado
So to summarize my setup .
I have a WSL with ubuntu 20.0.4 .
I installed platformio simply like this :
pip install platformio After I ran this command :
platformio run -e esp32-s3-devkitc-1 it started a process of installing various proprietary esp32-s3 packages
At the end of everything I checked with platformio boards :
image
And it seems to have installed it for me

@DavideLentini
Copy link

@jafrado
However in the meantime , I wanted to ask you since then for the board:
ESP32-S3-DevKitM-1-N8
We should still do the same process we are doing now , that is to add the board in the platformio.ini , do we know or is there a definition for this board to be included ?
Because looking in the platformio documentation:
https://docs.platformio.org/en/latest/platforms/espressif32.html#espressif
I saw that it goes up to C-1 , when we are interested in M-1. Am I missing something ?

@jafrado
Copy link
Author

jafrado commented Dec 9, 2022

Buongiorno David!

Some weird shit for sure, maybe Ubuntu 20 versus Ubuntu 16. WSL is fine, its the best thing Microsoft has done in decades
so I suspect it's just because I am running an older Linux (for a lot of reasons). You can cat /etc/issue to see your version.

jfd@area51:~/esp8266/Arduino/mavesp8266$ platformio upgrade
Please wait while upgrading PlatformIO ...
PlatformIO has been successfully upgraded to 6.1.5
Release notes: https://docs.platformio.org/en/latest/history.html

So now try:

jfd@area51:~/esp8266/Arduino/mavesp8266$ platformio run -e esp32-s3-devkitc-1 -t upload
Please wait while upgrading PlatformIO...
PlatformIO has been successfully upgraded to 6.1.5!

********************************************************************************
If you like PlatformIO, please:
- follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
- star it on GitHub > https://github.com/platformio/platformio
- try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
********************************************************************************

Processing esp32-s3-devkitc-1 (platform: espressif32; framework: arduino; board: esp32-s3-devkitc-1)
--------------------------------------------------------------------------------
Error: Unknown board ID 'esp32-s3-devkitc-1'
jfd@area51:~/esp8266/Arduino/mavesp8266$


So that looks like an unknown platform, so I looked again at the platformIO site, I found this ESP32-S3

https://docs.platformio.org/en/latest/boards/espressif32/esp32-c3-devkitm-1.html

And platformio recommendation to add to platform.ini

[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1

so yes, I tried again a build and that kicked the upgrade:

jfd@area51:~/esp8266/Arduino/mavesp8266$ platformio run -e esp32-c3-devkitm-1
Processing esp32-c3-devkitm-1 (platform: espressif32; board: esp32-c3-devkitm-1)
--------------------------------------------------------------------------------
Tool Manager: Installing platformio/toolchain-riscv-esp @ ~1.80400.0
Downloading  [#################################---]   93%  00:00:18

20 minutes later it downloaded the new S3 toolchain (looks like Espressif moved to a RISC processor core). But that fails too:


Tool Manager: [email protected] has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-c3-devkitm-1.html
PLATFORM: Espressif 32 (3.4.0) > Espressif ESP32-C3-DevKitM-1
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - tool-esptoolpy @ 1.30100.210531 (3.1.0) 
 - toolchain-riscv-esp @ 1.80400.0 (8.4.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- mavlink
Building in release mode
Compiling .pio/build/esp32-c3-devkitm-1/src/main.o
riscv32-esp-elf-g++: error: unrecognized command line option '-mlongcalls'
*** [.pio/build/esp32-c3-devkitm-1/src/main.o] Error 1
========================= [FAILED] Took 320.04 seconds =========================

Environment         Status    Duration
------------------  --------  ------------
esp32-c3-devkitm-1  FAILED    00:05:20.040
==================== 1 failed, 0 succeeded in 00:05:20.040 ====================

So it looks like the S3 build is busted anyhow so I did a google for the S3 riscv gcc error:

platformio riscv32-esp-elf-g++: error: unrecognized command line option '-mlongcalls'

I get hits here: platformio/platform-espressif32#497

So I did what @JamesSmartCell mentioned and got this:


[env:esp32-c3-devkitm-1]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
platform_packages =
    toolchain-riscv-esp
	framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.1
	platformio/tool-esptoolpy @ https://github.com/tasmota/esptool/releases/download/v3.2/esptool-v3.2.zip
framework = arduino
board = esp32dev
board_build.mcu = esp32c3
board_build.partitions = huge_app.csv
board_build.variant = esp32c3
board_build.f_cpu = 160000000L
board_build.f_flash = 80000000L
board_build.flash_mode = dio
board_build.arduino.ldscript = esp32c3_out.ld
build_unflags =
	-DARDUINO_ESP32_DEV
	-DARDUINO_VARIANT="esp32"
build_flags =
	-DARDUINO_ESP32C3_DEV
	-DARDUINO_VARIANT="esp32c3"
    -DARDUINO_USB_CDC_ON_BOOT=0
build_type = debug
monitor_speed = 115200

Now, it fetches a known working config:

jfd@area51:~/esp8266/Arduino/mavesp8266$ platformio run -e esp32-c3-devkitm-1
Processing esp32-c3-devkitm-1 (platform: https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream; framework: arduino; board: esp32dev)
--------------------------------------------------------------------------------
Platform Manager: Installing git+https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
git version 2.7.4
Cloning into '/home/jfd/.platformio/.cache/tmp/pkg-installing-pf823w2c'...
remote: Enumerating objects: 495, done.
remote: Counting objects: 100% (495/495), done.
remote: Compressing objects: 100% (401/401), done.
remote: Total 495 (delta 204), reused 275 (delta 73), pack-reused 0
Receiving objects: 100% (495/495), 344.00 KiB | 168.00 KiB/s, done.
Resolving deltas: 100% (204/204), done.
Checking connectivity... done.
Platform Manager: [email protected]+sha.3784198 has been installed!
Configuring from remote
* Adding toolchain toolchain-riscv32-esp with version 8.4.0+2021r2
* Adding toolchain toolchain-xtensa-esp32 with version 8.4.0+2021r2
* Adding toolchain toolchain-xtensa-esp32s2 with version 8.4.0+2021r2
Tool Manager: Installing espressif/toolchain-riscv32-esp @ 8.4.0+2021r2
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: [email protected]+2021r2 has been installed!
Tool Manager: Installing git+https://github.com/espressif/arduino-esp32.git#2.0.1
git version 2.7.4
Cloning into '/home/jfd/.platformio/.cache/tmp/pkg-installing-zuo2gf9a'...
remote: Enumerating objects: 4366, done.
remote: Counting objects: 100% (4366/4366), done.
remote: Compressing objects: 100% (3045/3045), done.
remote: Total 4366 (delta 1144), reused 2552 (delta 823), pack-reused 0
Receiving objects: 100% (4366/4366), 132.44 MiB | 276.00 KiB/s, done.
Resolving deltas: 100% (1144/1144), done.
Checking connectivity... done.
Note: checking out 'd218e58f9648f084346fa8329bf549d5e31ed7dd'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Checking out files: 100% (6867/6867), done.
Tool Manager: [email protected]+sha.d218e58 has been installed!
Tool Manager: Installing https://github.com/tasmota/esptool/releases/download/v3.2/esptool-v3.2.zip
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%
Tool Manager: [email protected] has been installed!
* Adding toolchain toolchain-riscv32-esp with version 8.4.0+2021r2
* Adding toolchain toolchain-xtensa-esp32 with version 8.4.0+2021r2
* Adding toolchain toolchain-xtensa-esp32s2 with version 8.4.0+2021r2
Verbose mode can be enabled via `-v, --verbose` option
* Adding toolchain toolchain-riscv32-esp with version 8.4.0+2021r2
* Adding toolchain toolchain-xtensa-esp32 with version 8.4.0+2021r2
* Adding toolchain toolchain-xtensa-esp32s2 with version 8.4.0+2021r2
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.3.1+sha.3784198) > Espressif ESP32 Dev Module
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 0.0.0+sha.d218e58 
 - tool-esptoolpy @ 1.30200.211025 (3.2.0) 
 - toolchain-riscv-esp @ 1.80400.0 (8.4.0) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Update @ 2.0.0
|-- WebServer @ 2.0.0
|   |-- WiFi @ 2.0.0
|   |-- FS @ 2.0.0
|-- EEPROM @ 2.0.0
|-- WiFi @ 2.0.0
|-- mavlink
Building in debug mode
Compiling .pio/build/esp32-c3-devkitm-1/src/main.cpp.o
<command-line>: warning: "ARDUINO_VARIANT" redefined
<command-line>: note: this is the location of the previous definition
In file included from src/main.cpp:38:
src/mavesp8266.h:44:10: fatal error: ESP8266WiFi.h: No such file or directory

*********************************************************************
* Looking for ESP8266WiFi.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESP8266WiFi.h"
* Web  > https://registry.platformio.org/search?q=header:ESP8266WiFi.h
*
*********************************************************************

 #include <ESP8266WiFi.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/esp32-c3-devkitm-1/src/main.cpp.o] Error 1
========================= [FAILED] Took 795.27 seconds =========================

Environment         Status    Duration
------------------  --------  ------------
esp32-c3-devkitm-1  FAILED    00:13:15.266
==================== 1 failed, 0 succeeded in 00:13:15.266 ====================
jfd@area51:~/esp8266/Arduino/mavesp8266$


So just started porting, it means we need to change:

#ifdef ARDUINO_ESP32_DEV

to:

#if defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_ESP32C3_DEV)

and

#ifndef ARDUINO_ESP32_DEV

to:

#if !defined(ARDUINO_ESP32_DEV) || !defined(ARDUINO_ESP32C3_DEV)

And then debug the API changes.

It also means we have a real pain in the ass with Espressif changing their API for every module. That sucks, whats the point of an API!!!

Anyhow, I will debug this tomorrow; looking forward to getting my board!

Oh, you also asked a good question, the JSON file has all of the configs and memory settings which may change from board to board. I have even bought boards on Amazon that have claims of 4MB of FLASH and they have 1MB!

But you should do something like the below to study these files, they control the memory map, toolchain, defines and linker script (like the mods required above to compile for S3).

Have fun and let me know where you get. Thank you @JamesSmartCell for your fixes!

@DavideLentini
Copy link

DavideLentini commented Dec 9, 2022

@jafrado
Hi , very good , I'm glad you were able to solve your problem and get to where I am.

So just started porting, it means we need to change:

#ifdef ARDUINO_ESP32_DEV

to:

#if defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_ESP32C3_DEV)

and

#ifndef ARDUINO_ESP32_DEV

to:

#if !defined(ARDUINO_ESP32_DEV) || !defined(ARDUINO_ESP32C3_DEV)

And then debug the API changes.

Okay , I think I understand . This should be the easiest part right ? 😆

Anyhow, I will debug this tomorrow; looking forward to getting my board!

Fantastic , can't wait for us to start working on this project

Oh, you also asked a good question, the JSON file has all of the configs and memory settings which may change from board to board. I have even bought boards on Amazon that have claims of 4MB of FLASH and they have 1MB!

But you should do something like the below to study these files, they control the memory map, toolchain, defines and linker script (like the mods required above to compile for S3).

Yes I think so , but don't you think that first it is necessary for platformio , to publish the necessary configuration to be included in platformio.ini for the board we are mainly interested in ?
Namely this one : ESP32-S3-DevKitM-1-N8
Before we start porting just for this board ?
I wonder why they haven't published anything ...

@jafrado
Copy link
Author

jafrado commented Dec 11, 2022 via email

@DavideLentini
Copy link

DavideLentini commented Dec 11, 2022

Hi Davide,

The name is important yes, but more important is the chip version and
flash. We will make a config file and submit it as a separate push, no
worries.
Anyhow, good news, I fixed the build issues and got a firmware tonight

@.***:~/esp8266/Arduino/mavesp8266$ platformio run -e
esp32-c3-devkitm-1
Processing esp32-c3-devkitm-1 (platform:
https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream;
framework: arduino; board: esp32dev)

  • Adding toolchain toolchain-riscv32-esp with version 8.4.0+2021r2
  • Adding toolchain toolchain-xtensa-esp32 with version 8.4.0+2021r2
  • Adding toolchain toolchain-xtensa-esp32s2 with version 8.4.0+2021r2
  • Adding toolchain toolchain-riscv32-esp with version 8.4.0+2021r2
  • Adding toolchain toolchain-xtensa-esp32 with version 8.4.0+2021r2
  • Adding toolchain toolchain-xtensa-esp32s2 with version 8.4.0+2021r2
    Verbose mode can be enabled via -v, --verbose option
  • Adding toolchain toolchain-riscv32-esp with version 8.4.0+2021r2
  • Adding toolchain toolchain-xtensa-esp32 with version 8.4.0+2021r2
  • Adding toolchain toolchain-xtensa-esp32s2 with version 8.4.0+2021r2
    CONFIGURATION:
    https://docs.platformio.org/page/boards/espressif32/esp32dev.html
    PLATFORM: Espressif 32 (3.3.1+sha.3784198) > Espressif ESP32 Dev Module
    HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
    DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink,
    minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h,
    olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
    PACKAGES:
  • framework-arduinoespressif32 @ 0.0.0+sha.d218e58
  • tool-esptoolpy @ 1.30200.211025 (3.2.0)
  • toolchain-riscv-esp @ 1.80400.0 (8.4.0)
  • toolchain-riscv32-esp @ 8.4.0+2021r2
    LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 32 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- Update @ 2.0.0
    |-- WebServer @ 2.0.0
    | |-- WiFi @ 2.0.0
    | |-- FS @ 2.0.0
    |-- EEPROM @ 2.0.0
    |-- WiFi @ 2.0.0
    |-- mavlink
    Building in debug mode
    Retrieving maximum program size .pio/build/esp32-c3-devkitm-1/firmware.elf
    Checking size .pio/build/esp32-c3-devkitm-1/firmware.elf
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM: [= ] 12.5% (used 41000 bytes from 327680 bytes)
    Flash: [== ] 24.5% (used 771396 bytes from 3145728 bytes)
    ========================= [SUCCESS] Took 5.22 seconds
    =========================

Environment Status Duration


esp32-c3-devkitm-1 SUCCESS 00:00:05.220
========================= 1 succeeded in 00:00:05.220

@.***:~/esp8266/Arduino/mavesp8266$

I will test it tomorrow, fix any bugs and send you a PR for this.

Thanks for your patience.

On Fri, Dec 9, 2022 at 3:04 AM Davide_Lentini @.***>
wrote:

@jafrado https://github.com/jafrado
Hi , very good , I'm glad you were able to solve your problem and get to
where I am.

So just started porting, it means we need to change:

#ifdef ARDUINO_ESP32_DEV

to:

#if defined(ARDUINO_ESP32_DEV) || defined(ARDUINO_ESP32C3_DEV)

and

#ifndef ARDUINO_ESP32_DEV

to:

#if !defined(ARDUINO_ESP32_DEV) || !defined(ARDUINO_ESP32C3_DEV)

And then debug the API changes.
Okay , I think I understand . This should be the easiest part right ? 😆

Anyhow, I will debug this tomorrow; looking forward to getting my board!
Fantastic , can't wait for us to start working on this project

Oh, you also asked a good question, the JSON file has all of the configs
and memory settings which may change from board to board. I have even
bought boards on Amazon that have claims of 4MB of FLASH and they have 1MB!

But you should do something like the below to study these files, they
control the memory map, toolchain, defines and linker script (like the mods
required above to compile for S3).

Yes I think so , but don't you think that first it is necessary for
platformio , to publish the necessary configuration to be included in
platformio.ini for the board we are mainly interested in ?
Namely this one : ESP32-S3-DevKitM-1-N8
Before we start porting just for this board ?
I wonder why they haven't published anything ...


Reply to this email directly, view it on GitHub
#90 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACXSUDE37NSGYRXVE7EJKHTWMMG5FANCNFSM5OMHU6QA
.
You are receiving this because you were mentioned.Message ID:
@.***>

@jafrado
Fantastic ! Very good .
So summarizing you will make a commit in your fork -in branch master- , which will contain the merge with the ardupilot(mavesp8266) changes + the changes you made to compile the esp32-c3-m1 .
At that point I will try to compile it too . And then if all goes well , we will switch to S3-M1 :)
Thank you very much for the help

@jafrado
Copy link
Author

jafrado commented Dec 11, 2022 via email

@jafrado
Copy link
Author

jafrado commented Dec 12, 2022 via email

@DavideLentini
Copy link

DavideLentini commented Dec 12, 2022

@jafrado
Great !
I didn't think you had gone this far with the development of the S3-MINI1 as well , I can't wait to try it TODAY in the lab.
I would like to fully understand the error that told you about uploading the S3-MINI1. So you managed to compile a firmware for the S3-MINI1 but from what I see , it started to do a memory erase but then crashed .
You still managed to compile a firmware.bin for the S3-MINI1 , you could try to upload with this program :
https://www.espressif.com/en/support/download/other-tools
This is "Flash Download Tool"
Maybe it might give the same error , but it is worth a try .
Today I make the repo clone and compile everything and try to upload . If the problem is only the upload , it will be solved quickly , the important thing is to have managed to compile the firmware . Thank you very much !

EDIT#######################################################################

So just try clone and compile esp32-s3-devkitm-1 . Everything went right , except two waring which i had also , when i was triyng the merge your version with ardupilot version .

In file included from src/main.cpp:53:
/home/davide/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/esp_event/include/esp_event_loop.h:2:2: warning: #warning "esp_event_loop.h is deprecated, please include esp_event.h instead" [-Wcpp]
 #warning "esp_event_loop.h is deprecated, please include esp_event.h instead"
  ^~~~~~~
In file included from src/mavesp8266_gcs.cpp:44:
/home/davide/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/tcpip_adapter/include/tcpip_adapter.h:15:2: warning: #warning "This header is deprecated, please use new network related API in esp_netif.h" [-Wcpp]
 #warning "This header is deprecated, please use new network related API in esp_netif.h"

They are just warning anyway . In few hours i'll try to upload on devboard with the tool i wrote you about.

@DavideLentini
Copy link

DavideLentini commented Dec 12, 2022

@jafrado
image
I compiled the esp32-s3-m1 (platformio run -e esp32-s3-devkitm-1)
So , I tried loading the compiled firmware via the tool , it seems to load it . I disconnected and reconnected the dev-kit to the usb .
I waited about a minute ( the time for the esp to create the AP network ) , but it doesn't seem to create any network...
Are you sure it can function as c-1 instead of m-1 ?

; ESP32-S3 Module - 8MB FLASH, 320kb built-in PSRAM
; Modules: ESP32-S3-MINI-1, ESP32-S3-MINI-1U
[env:esp32-s3-devkitm-1]
;platform = [email protected]
platform = https://github.com/platformio/platform-espressif32.git
framework = arduino
board = esp32-s3-devkitc-1
;debug_tool = esp_usb_jtag
;upload_protocol = esp_usb_jtag
;debug_tool = esp-prog
;upload_protocol=esp-prog

@jafrado
Copy link
Author

jafrado commented Dec 13, 2022 via email

@DavideLentini
Copy link

@jafrado
Well no , I never used it . I always work on the direct mavesp8266 code , so never use Esp Prog .
I made some test , try to use the RGB led on the Dev kit board (GPIO 48) . Try to turn it on and off , adding the code inside the function that is used when waiting for a client , but nothing happens .
So , I imagine that something goes wrong during the init of the board , or something is incompatible with the current board configuration we are using .

@jafrado
Copy link
Author

jafrado commented Dec 14, 2022 via email

@DavideLentini
Copy link

@jafrado
Hi ! Any news ?
Were you able to move forward on anything ? I stayed busy so I had little time .
We were down to the fact that on the esp32-devkits3-m1 we could load the compiled program but that seemed not to work .
Were you able to test anything on the boards you were supposed to get this weekend ?

@jafrado
Copy link
Author

jafrado commented Dec 19, 2022 via email

@DavideLentini
Copy link

@jafrado
Hey there ! How was your vacation ?
I wanted to tell you that I managed to test the RemoteID with the esp32-s3-m1 , following the directions of ardupilot and it is really a great tool .
In the meantime I have also been trying to get on with the development of porting the mavesp branch of ardupilot for the esp32-s3-m1 , asking around the forums a bit . Meanwhile I wanted to ask you , how is the development going ? I would like to start working together again to get to the development of the porting . Thank you very much

@jafrado
Copy link
Author

jafrado commented Jan 5, 2023 via email

@jafrado
Copy link
Author

jafrado commented Jan 5, 2023 via email

@jafrado
Copy link
Author

jafrado commented Jan 8, 2023 via email

@DavideLentini
Copy link

DavideLentini commented Jan 8, 2023

@jafrado
Fantastic , thanks ! How strange , in the ArduPilot guide they say to press under the boot button while plugging in the USB . However if you managed to load it , I see me of your procedure ! I will try tomorrow .
The tests I had done then might be wrong since I was loading the firmware.bin seems to be from the USB port and not from the UART
Wait , so you are telling me that you managed to load the firmware also on the esp32-S3-C1 and run the mavesp firmware correctly ? What about the m1 ? After loading the firmware did you get any results ?

@jafrado
Copy link
Author

jafrado commented Jan 8, 2023 via email

@DavideLentini
Copy link

DavideLentini commented Jan 9, 2023

@jafrado Really Amazing ! I'll try in few hours and I'll tell you my result with your Real Flight mavesp branch with all the esp32 mods

@DavideLentini
Copy link

@jafrado
Very good . I did the procedure successfully , but I would like to ask you several things and show you a video where I show a problem . Sorry but I think I missed your discord invitation , unfortunately with the time zone your messages come to me at night so the invitations expire quickly . Could you write me your username or id , if you want where I read it you can also delete it .

@jafrado
Copy link
Author

jafrado commented Jan 9, 2023 via email

@jafrado
Copy link
Author

jafrado commented Jan 9, 2023 via email

@markingle
Copy link

Hi guys! I am working to get a 3DR Solo working as a show drone and need mavesp8266 firmware to run on an ESP32-WROOM....Its hard to tell but does this PR allow for that?

@jafrado
Copy link
Author

jafrado commented Jan 11, 2023

@DavideLentini - please send me email when you'd like to review the failure.
@markingle - yes, this is the work for the mavesp8266. Ardupilot source base (with a few new features including C3 support) is here. Here is the PR for this work, feel free to test out and let me know what hardware you are using and post to the version you are running (this is PX4 only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants