BeyondRobotix / mavesp8266

ESP8266 WiFi Access Point and MAVLink Bridge
Other
182 stars 173 forks source link

support for ESP32 #90

Open jafrado opened 2 years ago

DavideLentini commented 1 year ago

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

jafrado commented 1 year ago

ESP32-WROOM-32UE

DavideLentini commented 1 year ago

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 commented 1 year ago

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

DavideLentini commented 1 year ago

Thanks !

jafrado commented 1 year ago

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

DavideLentini commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Thanks. I did a diff. I see they use the mavlink library directly, added a raw (non Mav) mode (presumably for FGW upgrade), added some serial performance fixes and web mods (version, macaddr). Once I get back to testing this I will merge this code into the branch and post a new PR.

Send me the link to the HW you want me to test - does the mini have a uFL? I am using ESP-WROOM so I can use uFL and mount an external antenna. Range baby, range :-)

On Fri, Nov 25, 2022 at 11:33 AM Davide_Lentini @.***> wrote:

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 :) . By the way you can test your version on a esp32-s3-mini1 ? It would be wonderful

— Reply to this email directly, view it on GitHub https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1327832748, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXSUDBPKFUHGJU4SACP2XDWKEIBHANCNFSM5OMHU6QA . You are receiving this because you authored the thread.Message ID: @.***>

DavideLentini commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

hi David, you sent me the link to the hardware on Friday. I would still have to order the board and I need a link to some thing which has an external antenna.Besides, this PR is for the ESP32-WROOM. I would need to make a new PR for the Ardupilot changes and then any changes needed for the S3.Is there some reason you’re not using the ESP 32 module I already referenced? it works, it’s been tested (hence this PR). If you’re flying a drone, you probably want the external antenna anyhow.please post these requests to my fork instead of adding additional work to an already pending PR.separately, can you please send me a link to a board that has an external antenna? I’m well aware of the part and I don’t see the reason and using this versus the WROOM. What is the rationale?On Nov 28, 2022, at 4:45 AM, Davide_Lentini @.***> wrote: @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 ! :)

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

jafrado commented 1 year ago

Davide?On Nov 28, 2022, at 7:19 AM, James Dougherty @.> wrote:hi David, you sent me the link to the hardware on Friday. I would still have to order the board and I need a link to some thing which has an external antenna.Besides, this PR is for the ESP32-WROOM. I would need to make a new PR for the Ardupilot changes and then any changes needed for the S3.Is there some reason you’re not using the ESP 32 module I already referenced? it works, it’s been tested (hence this PR). If you’re flying a drone, you probably want the external antenna anyhow.please post these requests to my fork instead of adding additional work to an already pending PR.separately, can you please send me a link to a board that has an external antenna? I’m well aware of the part and I don’t see the reason and using this versus the WROOM. What is the rationale?On Nov 28, 2022, at 4:45 AM, Davide_Lentini @.> wrote: @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 ! :)

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

DavideLentini commented 1 year ago

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 commented 1 year ago

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: @.***>

DavideLentini commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

thanks! I will order that one!hey come check out Discord with me https://discord.gg/fprSn3s5On Dec 6, 2022, at 11:59 PM, Davide_Lentini @.***> wrote: @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

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

jafrado commented 1 year ago

anyhow, I will merge the ardupilot code this weekend and send you a link to the Pull requestOn Dec 7, 2022, at 6:29 AM, James Dougherty @.> wrote:thanks! I will order that one!hey come check out Discord with me https://discord.gg/fprSn3s5On Dec 6, 2022, at 11:59 PM, Davide_Lentini @.> wrote: @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

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

jafrado commented 1 year ago

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

jafrado commented 1 year ago

@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 commented 1 year ago

@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

jafrado commented 1 year ago

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: @.***>

jafrado commented 1 year ago

I see you want OpenDroneIDuav_electronic_ids/id_open at main · sxjack/uav_electronic_idsgithub.comOn Dec 7, 2022, at 11:37 PM, James Dougherty @.> wrote: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: @.***>

DavideLentini commented 1 year ago

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 commented 1 year ago

OK I can’t even get that far, do you have to install the ESPSDK first? when I run platform I/O with the boards, command line option the S3 is not listed!So what we need to do is figure out what the define is for esp32 S3…The reason you’re getting this compile errors is because the ESP 32 defines for WROOM are different!On Dec 7, 2022, at 11:57 PM, Davide_Lentini @.***> wrote:

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: @.>

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 .

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

DavideLentini commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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: toolchain-riscv-esp@1.80400.0 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: https://github.com/platformio/platform-espressif32/issues/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: espressif32@3.3.1+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: toolchain-riscv32-esp@8.4.0+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: framework-arduinoespressif32@0.0.0+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: tool-esptoolpy@1.30200.211025 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 commented 1 year ago

@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 commented 1 year ago

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)

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 https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1344162760, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXSUDE37NSGYRXVE7EJKHTWMMG5FANCNFSM5OMHU6QA . You are receiving this because you were mentioned.Message ID: @.***>

DavideLentini commented 1 year ago

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 https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1344162760, 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 commented 1 year ago

That’s the plan, although I still have to support the hardware with the WROOM moduleMore later todayOn Dec 11, 2022, at 1:20 AM, Davide_Lentini @.***> wrote:

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 , 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

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

jafrado commented 1 year ago

Ok, I haven't opened a PR yet, but this repo here contains all of the changes in the original, plus all of the ESP32 modules supported. The ESP32, ESP32-S3, ESP32-S3-MINI, and a build for ESP32-C3-Mini.

Your original Mouser board (the S3-MINI), I received it, tried to flash it, but it fails as below. The instructions I sent you were wrong, they were for the C3 Mini (RISCV). The S3-Mini is a different form-factor module from the ESP32-S3 so it should be the same build (the configuration is a different pin-out also on the two dev-boards). Anyhow, I tried to flash my board below, but it does not work. Maybe you should have a try:

$ platformio run -e esp32-s3-devkitm-1 -t upload Processing esp32-s3-devkitm-1 (platform: https://github.com/platformio/platform-espressif32.git; framework: arduino; board: esp32-s3-devkitc-1)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html PLATFORM: Espressif 32 (5.2.0+sha.fee4b73) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM) HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, 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:

Auto-detected: /dev/ttyACM0 Uploading .pio/build/esp32-s3-devkitm-1/firmware.bin esptool.py v4.4 Serial port /dev/ttyACM0 Connecting... Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: f4:12:fa:81:3b:18 Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Flash will be erased from 0x00000000 to 0x00003fff... Flash will be erased from 0x00008000 to 0x00008fff... Flash will be erased from 0x0000e000 to 0x0000ffff... Flash will be erased from 0x00010000 to 0x000c9fff... Compressed 15040 bytes to 10364... Writing at 0x00000000... (100 %) Wrote 15040 bytes (10364 compressed) at 0x00000000 in 0.2 seconds (effective 689.4 kbit/s)... Hash of data verified. Compressed 3072 bytes to 129... Writing at 0x00008000... (100 %) Wrote 3072 bytes (129 compressed) at 0x00008000 in 0.0 seconds (effective 664.3 kbit/s)...

A fatal error occurred: Packet content transfer stopped (received 25 bytes) *** [upload] Error 2 ========================= [FAILED] Took 10.74 seconds

Environment Status Duration


esp32-s3-devkitm-1 FAILED 00:00:10.735 ==================== 1 failed, 0 succeeded in 00:00:10.735

Separately, I totally re-tested the new ESP32-WROOM (esp32dev) build today, based on master Ardupilot variant of the original firmware, here is the build of it using esp-prog:

platformio run -e espwroom32 -t uploadProcessing espwroom32 (platform: espressif32; framework: arduino; board: esp32dev)

Tool Manager: Installing espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3 Downloading [####################################] 100% Unpacking [####################################] 100% Tool Manager: @.***+2021r2-patch3 has been installed! Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html PLATFORM: Espressif 32 (5.2.0+sha.fee4b73) > Espressif ESP32 Dev Module HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (esp-prog) External (cmsis-dap, esp-bridge, 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:

adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release. adapter speed: 5000 kHz

Warn : Not full dbg stub table 1 of 2 Programming Started Programming Finished in 9168 ms Verify Started Verify OK Programming Started Programming Finished in 1106 ms Verify Started Verify OK Programming Started Programming Finished in 781 ms Verify Started Verify OK Programming Started Programming Finished in 867 ms Verify Started Verify OK shutdown command invoked ======================== [SUCCESS] Took 610.78 seconds

Environment Status Duration


espwroom32 SUCCESS 00:10:10.776 ========================= 1 succeeded in 00:10:10.776

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

Just got back from flying a previous build. Looks really good!! I love the new Ardupilot fixes, they are great!

On Sun, Dec 11, 2022 at 8:08 AM James Dougherty @.***> wrote:

That’s the plan, although I still have to support the hardware with the WROOM module More later today

On Dec 11, 2022, at 1:20 AM, Davide_Lentini @.***> wrote:



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 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)

https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1344162760 , or unsubscribe

https://github.com/notifications/unsubscribe-auth/ACXSUDE37NSGYRXVE7EJKHTWMMG5FANCNFSM5OMHU6QA . You are receiving this because you were mentioned.Message ID: @.***>

@jafrado https://github.com/jafrado Fantastic ! Very good . So summarizing you will make a commit in your fork , 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

— Reply to this email directly, view it on GitHub https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1345500942, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXSUDGFSCILITDA37ETHLDWMWMGVANCNFSM5OMHU6QA . You are receiving this because you were mentioned.Message ID: @.***>

DavideLentini commented 1 year ago

@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 commented 1 year ago

@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 = espressif32@2.0.5
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 commented 1 year ago

thanks, Davide, I will take a look later this week and get back to you. Do you have ESP Prog? That’s probably the next step is to run the debugger and figure out where it’s hanging I know I had to do that in the past for the WROOM module.The links to all that hardware are on the wiki page on my branchOn Dec 12, 2022, at 2:04 AM, Davide_Lentini @.***> wrote: @jafrado

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...

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

DavideLentini commented 1 year ago

@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 commented 1 year ago

thanks David for trying; I will order the other board and debug more this weekend.Yes, you’re right there’s probably something wrong with the initialization, but do check how other people start with a configuration and override the existing setting things like flash size and memory are usually configurable in the platform.iniThank you and more laterOn Dec 14, 2022, at 8:44 AM, Davide_Lentini @.***> wrote: @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 .

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

DavideLentini commented 1 year ago

@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 commented 1 year ago

hi David, I’ll pick it up next week. I had a busy weekend because of the holidays.On Dec 19, 2022, at 3:09 AM, Davide_Lentini @.***> wrote: @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 ?

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

DavideLentini commented 1 year ago

@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 commented 1 year ago

thanks, DavidLast night I tuned the input, and output, buffers on the ardupilot firmware. I am using a long range radio on my new board. I think that my change to a 1K receive buffer got me better latency without the continual heartbeat message delay.I suspect what’s wrong is that the S3 flash file system layout is different than the S3 mini. I ordered the S3 board. It should be here this week. I would like to compare the two and see what the difference is.That’s great you got remote ID working! Let me know if there is a branch I can pull to try it out; I will pick up the Debug again this weekendThank you very much!On Jan 5, 2023, at 1:31 AM, Davide_Lentini @.***> wrote: @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

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

jafrado commented 1 year ago

by the way last night, I had an idea about a new board. You should ping me on discord sometime this weekend and let’s talk about it. I’m going to do a couple minor revs and possibly one new revision board before CNY.On Jan 5, 2023, at 7:25 AM, James Dougherty @.> wrote:thanks, DavidLast night I tuned the input, and output, buffers on the ardupilot firmware. I am using a long range radio on my new board. I think that my change to a 1K receive buffer got me better latency without the continual heartbeat message delay.I suspect what’s wrong is that the S3 flash file system layout is different than the S3 mini. I ordered the S3 board. It should be here this week. I would like to compare the two and see what the difference is.That’s great you got remote ID working! Let me know if there is a branch I can pull to try it out; I will pick up the Debug again this weekendThank you very much!On Jan 5, 2023, at 1:31 AM, Davide_Lentini @.> wrote: @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

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

jafrado commented 1 year ago

Hi Davide

I studied the code and the ESP32-S3-DevkitM-1 board. The code should work for either on my port.

So I figured the issue was the FLASHING, I scoped the boot and reset and I found that this is the issue!

To FLASH either board, you MUST follow this procedure:

  1. Press and Hold BOTH RESET AND BOOT buttons.
  2. Plug the MicroUSB into port labeled UART (not USB).
  3. Release the RESET BUTTON and continue holding the BOOT button so it stays in bootloader mode.

Run this command:

platformio run -e esp32-s3-devkitm-1 -t upload

Processing esp32-s3-devkitm-1 (platform: https://github.com/platformio/platform-espressif32.git; framework: arduino; board: esp32-s3-devkitc-1)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html PLATFORM: Espressif 32 (5.2.0+sha.fee4b73) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM) HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, 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:

Warning! Your /etc/udev/rules.d/99-platformio-udev.rules are outdated. Please update or reinstall them. More details: https://docs.platformio.org/en/latest/core/installation/udev-rules.html

Auto-detected: /dev/ttyUSB1 Uploading .pio/build/esp32-s3-devkitm-1/firmware.bin esptool.py v4.4 Serial port /dev/ttyUSB1 Connecting.... Chip is ESP32-S3 (revision v0.1) Features: WiFi, BLE Crystal is 40MHz MAC: f4:12:fa:81:3b:18 Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Flash will be erased from 0x00000000 to 0x00003fff... Flash will be erased from 0x00008000 to 0x00008fff... Flash will be erased from 0x0000e000 to 0x0000ffff... Flash will be erased from 0x00010000 to 0x000c8fff... Compressed 15040 bytes to 10364... Writing at 0x00000000... (100 %) Wrote 15040 bytes (10364 compressed) at 0x00000000 in 0.4 seconds (effective 278.7 kbit/s)... Hash of data verified. Compressed 3072 bytes to 129... Writing at 0x00008000... (100 %) Wrote 3072 bytes (129 compressed) at 0x00008000 in 0.0 seconds (effective 517.0 kbit/s)... Hash of data verified. Compressed 8192 bytes to 47... Writing at 0x0000e000... (100 %) Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 746.5 kbit/s)... Hash of data verified. Compressed 757584 bytes to 492237... Writing at 0x00010000... (3 %) Writing at 0x0001b89a... (6 %) Writing at 0x0002644a... (9 %) Writing at 0x00031c6d... (12 %) Writing at 0x00037ef8... (16 %) Writing at 0x0003da8c... (19 %) Writing at 0x000437d3... (22 %) Writing at 0x00048ea1... (25 %) Writing at 0x0004e51a... (29 %) Writing at 0x000535e3... (32 %) Writing at 0x000584eb... (35 %) Writing at 0x0005d38a... (38 %) Writing at 0x000623b2... (41 %) Writing at 0x0006725c... (45 %) Writing at 0x0006c10d... (48 %) Writing at 0x00071293... (51 %) Writing at 0x000763e7... (54 %) Writing at 0x0007c0e4... (58 %) Writing at 0x00080f0f... (61 %) Writing at 0x00085f7b... (64 %) Writing at 0x0008aef7... (67 %) Writing at 0x00090422... (70 %) Writing at 0x0009588d... (74 %) Writing at 0x0009b51f... (77 %) Writing at 0x000a0a8d... (80 %) Writing at 0x000a65aa... (83 %) Writing at 0x000af5f6... (87 %) Writing at 0x000b71f9... (90 %) Writing at 0x000bd5e4... (93 %) Writing at 0x000c2ce3... (96 %) Writing at 0x000c8b00... (100 %) Wrote 757584 bytes (492237 compressed) at 0x00010000 in 11.9 seconds (effective 508.4 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin... ========================= [SUCCESS] Took 29.31 seconds

Environment Status Duration


esp32-s3-devkitm-1 SUCCESS 00:00:29.309 ========================= 1 succeeded in 00:00:29.309

I also got my ESP32-S3-DevkitC-1 board today. I flashed it with the top of my Ardupilot branch same as above and successfully flew and hovered in my garage with my F550 running TOT PX4 on FMU3 (it is raining right now so couldn't do exhaustive test). It seems all of my time was making a level converter and serial adapter for the Telemetry port :-)

Anyhow, please try the above procedure and let me know if it works for you.

Ciao!

On Thu, Jan 5, 2023 at 7:32 AM James Dougherty @.***> wrote:

by the way last night, I had an idea about a new board. You should ping me on discord sometime this weekend and let’s talk about it. I’m going to do a couple minor revs and possibly one new revision board before CNY.

On Jan 5, 2023, at 7:25 AM, James Dougherty @.***> wrote:

 thanks, David

Last night I tuned the input, and output, buffers on the ardupilot firmware. I am using a long range radio on my new board. I think that my change to a 1K receive buffer got me better latency without the continual heartbeat message delay.

I suspect what’s wrong is that the S3 flash file system layout is different than the S3 mini. I ordered the S3 board. It should be here this week. I would like to compare the two and see what the difference is.

That’s great you got remote ID working! Let me know if there is a branch I can pull to try it out; I will pick up the Debug again this weekend

Thank you very much!

On Jan 5, 2023, at 1:31 AM, Davide_Lentini @.***> wrote:



@jafrado https://github.com/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

— Reply to this email directly, view it on GitHub https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1371978211, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXSUDEKGSMBBEQNWYCHLDDWQ2IFJANCNFSM5OMHU6QA . You are receiving this because you were mentioned.Message ID: @.***>

DavideLentini commented 1 year ago

@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 commented 1 year ago

Hi Davide,

That's right, Now I have the ESP32-WROOM (original ESP32), the ESP32-S3-DevkitM-1, and the ESP32-S3-DevkitC-1 all working from this branch. Time for a party!

-james

On Sun, Jan 8, 2023 at 12:42 AM Davide_Lentini @.***> wrote:

@jafrado https://github.com/jafrado Fantastic , thanks ! How strange , in the ArduPilot guide they say to press under the boot button and then plug in the USB . However if you managed to load it , I see me of your procedure ! I will try tomorrow . 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 ?

— Reply to this email directly, view it on GitHub https://github.com/dogmaphobic/mavesp8266/pull/90#issuecomment-1374761503, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXSUDEJ5DA6PN7NT5DUZF3WRJ4WXANCNFSM5OMHU6QA . You are receiving this because you were mentioned.Message ID: @.***>

DavideLentini commented 1 year ago

@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