Closed Bascy closed 4 years ago
@Bascy really? What about this? HardwareSerial::write()
Chuck.
You are right, but It misses the override
directive
It seems that only the C++ indexer in Eclipse is complaining about it, it actually does compile
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Preface, I'm not the most seasoned in dealing with code handling hardware interfaces, but I'm working on Sr. Design and I have no other option. I believe my case here is relevant. It will compile, but I'm trying to rewrite a library for a display that is type casting to uint8_t as a write. If it was functional on the hardware, I would have slept last night.
line 368 (first place it references in trace) reads : ... deviceSerial->write((uint8_t)GENIE_READ_OBJ); ...
@kbickham
07:34:59.197 -> Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
is telling you that a memory storage location was referenced that is inaccessible.
Usually it means a pointer has a null value.
What is GENIE_READ_OBJ
? You are telling the compiler to treat it as a single byte.
Please post enough code to show your declaration, and the current value stored in it.
Memory map from page 25 of the ESP32 Technical reference manual V4.0
Only addresses in these range are valid to access. basically 0x3ffb0000 to 0x400c1FFF and 0x50000000 to 0x50001fff.
Chuck.
Well I feel a little dumb. I'm not that experienced, but I'm learning... I genuinely thank you for the response. The genie library is basically a uart protocol for commands to the display. I've invested so much into the interface design that I'm tied to it c. It sends/receives data in 8 bit chunks, wasn't my design. I've seen some ported libraries handling everything in 2 byte chunks (I actually can't find where they shift anything before output, as I don't think they're spending half their bandwidth transmitting zeros?).
The READOBJECT returns a couple bytes each for object id, index... the exact values in base 10 are. I realize this may not be related not the issue now, but I see it worthy of adequately responding to your question:
// reserved for magic functions 34
My code, the event handler and control system functions are really what's important (pretty messy, it's the first version of my code that I have got to compile for the esp32). Within my timeframe I think switching IDE's might be a mistake. This is basically firmware for a drying device that runs off of a scale, infrared sensors, and to be implemented...a spectrometer using a AS7263 chip. I was using an AVR and trying to communicate with the ESP32 via uart (as well as the display), but I've had so many problems ...I figured I mine as well try and port everything to the ESP if I have to deal with the uart situation. '
@kbickham Ok, I tracked down the meaning of GENIE_READ_OBJ
here
If I am understanding your code, it simplifies down to:
#define GENIE_READ_OBJ 0
Serial.write((uint8_t) GENIE_READ_OBJ );
But, I don't think that is your problem. I scanned through your code, you redefine GENIE::BEGIN()
// ######################################
// ## Setup #############################
// ######################################
bool Genie::Begin(Stream &serial) {
deviceSerial = &serial;
display_uptime = millis(); // start uptime timer (ms)
genieStart = 1; // start form request on startup
ReadObject(GENIE_OBJ_FORM, (uint8_t)0x00); // send form request
uint32_t timeout_start = millis(); // timeout timer
while ( millis() - timeout_start <= 250 ) { // blocking loop, releases after 150ms to timeout, or sooner if display's detected.
if ( DoEvents() == GENIE_REPORT_OBJ && !genieStart ) return 1; // form is updated.
}
displayDetected = 0;
return 0; // timeout occured, status offline.
}
But, I never see anywhere in your code you actually call it? so the deviceSerial()
stream pointer is null?
deviceSerial->write()
would generate this error if deviceSerial
is NULL.
This is not a problem with arduino-esp32, your code has issues.
Chuck.
It's basically a hex command code define in a library I have to use for comms to display.I'm not I'm actually not utilizing that specific function,instead I used an event based approach sending flags from display...thank god. I found a work around, I apologize for borderline thread jacking. My compiler agrees with you. I should have initially turned the compiler flags all the way up and done work before posting. That thing gives warnings for unrelated libraries in the same parent directory that are missing returns without void type. It's working now. Appreciate your time.
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
Using Eclipse, an error is shown in HardwareSerial.h stating that it instantiates HardwareSerial objects while Print::write(uint8_t) is not implemented.
Print.h indeed contains a pure virtual definition of write:
virtual size_t write(uint8_t) = 0;
Neither Stream.h nor HardwareSerial.h implement this method.