espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.52k stars 7.39k forks source link

ERROR - Connect ESP32 to Emstat Pico module #9209

Closed OrelBatito closed 1 month ago

OrelBatito commented 8 months ago

Board

ESP32

Device Description

ESP32 Dev Module

Hardware Configuration

Scheme Of Our Connection Pico-ESP32.pdf

Version

latest master (checkout manually)

IDE Name

Arduino IDE 2.2.1

Operating System

Windows 11

Flash frequency

80-240 MHz

PSRAM enabled

no

Upload speed

230400

Description

Mention that when we tried to run the following code with an Arduino Uno board, the code verification succeeded: Arduino_uno_ToPico.txt

BUT, this code verification failed when we tried to run it with an ESP32 Dev Module board. We received the following note:

"c:\Users\1000o\OneDrive\Documents\Arduino\libraries\MethodSCRIPTComm\MSComm.c:253:14: error: conflicting types for 'GetUnitPrefixValue' const double GetUnitPrefixValue(char charPrefix) ^~~~~~ In file included from c:\Users\1000o\OneDrive\Documents\Arduino\libraries\MethodSCRIPTComm\MSComm.c:38: c:\Users\1000o\OneDrive\Documents\Arduino\libraries\MethodSCRIPTComm\MSComm.h:366:8: note: previous declaration of 'GetUnitPrefixValue' was here double GetUnitPrefixValue(char charPrefix); ^~~~~~

exit status 1

Compilation error: exit status 1"

We believe that this error occurred because the libraries and the main code are not compatible with the ESP32, but we have not been successful in resolving this issue.

Sketch

The code provided in the following link:
https://github.com/PalmSens/MethodSCRIPT_Examples/tree/master/MethodSCRIPTExample_Arduino

There are 2 folders: 'MethodSCRIPTComm' and 'MathHelperLibrary' that we installed as libraries in Arduino IDE 2.2.1. We used the 'MethodSCRIPTExample' and tried to run the code with an ESP32.

Debug Message

c:\Users\1000o\OneDrive\Documents\Arduino\libraries\MethodSCRIPTComm\MSComm.c:253:14: error: conflicting types for 'GetUnitPrefixValue'
 const double GetUnitPrefixValue(char charPrefix)
              ^~~~~~~~~~~~~~~~~~
In file included from c:\Users\1000o\OneDrive\Documents\Arduino\libraries\MethodSCRIPTComm\MSComm.c:38:
c:\Users\1000o\OneDrive\Documents\Arduino\libraries\MethodSCRIPTComm\MSComm.h:366:8: note: previous declaration of 'GetUnitPrefixValue' was here
 double GetUnitPrefixValue(char charPrefix);
        ^~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

Other Steps to Reproduce

Emstat Pico Module Datasheet: EmStat Pico Brochure.pdf PSDAT-ESP-EmStat-Pico-Datasheet.pdf

I have checked existing issues, online documentation and the Troubleshooting Guide

lbernstone commented 8 months ago

This is an error in the 3rd party library. In the .h file, it is defined as a double, in the .c it is redefined as const double. Change the header to match. Please note, this forum is for issues with the code contained here. Open an issue on the 3rd party repo for issues with their code.

OrelBatito commented 8 months ago

Thank you! We fixed this error, but we received the following ERROR: "A fatal error occurred: Failed to connect to ESP32: Download mode successfully detected, but no sync reply was received: The serial TX path seems to be down. For troubleshooting steps, visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html Failed uploading: uploading error: exit status 2" Despite the connections being as shown in the scheme file and double-checking our board, the error persists.

lbernstone commented 8 months ago

esp32 expects to be the only device on the uart line while uploading firmware. You have made a poor choice to use those same pins for another device. There are many other pins that could be used for a uart connection to your pico.

VojtechBartoska commented 1 month ago

Hello, there is nothing to be fixed on Arduino core side, closing this ticket as wontfix. Thanks for understanding.