logo elektroda
logo elektroda
X
logo elektroda

[Solved] ESP8266 Exception(3) error when using crc16.Modbus in an if condition

741 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18239983
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • Helpful post
    #2 18240383
    krzbor
    Level 27  
    The problem is unlikely to be an if. Do some experiments - e.g. assign a constant to crcCalculate and in the next instruction the result crc16.Modbus. See how the code behaves when you perform an operation on crcCalculate e.g. crcCalculate++

    I used to have a strange situation - a series of functions that returned "String" (in uppercase). In a couple of projects this works without problems, but in one there were strange reboots about 2 times a day. I thought it was interference or power problems. However, I had to change the code and after the corrections the processor rebooted almost continuously. I started to trace the problem and it came out that the String returned outside the function was no longer good. A strange issue as this works in many places. I rewrote all the code so that String is passed into the function (as a pointer) and the problems stopped. So far I don't know what was wrong - a compiler error or something in ESP.
    In summary - there is not necessarily a bug in your code.
  • ADVERTISEMENT
  • #3 18240409
    tos18
    Level 42  
    len-2 ... - are you by any chance inserting a negative string length?
  • ADVERTISEMENT
  • #4 18240519
    khoam
    Level 42  
    FreelancerPL wrote:
    I have an incomprehensible error in the ESP8266.
    .
    I suggest you first install yourself the Exception Stack Trace Decoder for ESP8266. Life will become easier ;) .
    What IDE are you using?
  • #5 18240713
    Anonymous
    Level 1  
ADVERTISEMENT