ESP8266-01S- Rebooting Issue if Serial.print is removing

Hi guys,

i got a terrible issue where i am not able to find a solution for....

I want to read/write some sensor datas with the help of a customized struct datatyp to an FRAM chip. Writing can be done without any issues now and the data saving is validated - so this part is OK. But the reading part makes some issues to me:
If i started the project - reading was done exactly the same as writing in the other direction - you not say?!?
I tryed it with several lines of code - and it works fine!
Now for the final solution i cleaned the code up and i am now struggeling at a line, where i print the data for debbuing purpose. If i delete this line- the code is not runnable any more and the esp runs into restart routine!

I will post the code here of the reading purpose:

/*-----------------------------------------------------------------------------
 * Read Sensor Data from FRAM
 * ----------------------------------------------------------------------------
*/
PowerValues ConvertSensorDataFromFRam(uint16_t Pos){
  /* Format to Read FRAM Data:
   * 4Byte UNIX Time Stamp // 4Byte Current Data // 4Byte Power Data // 4 Byte Load Voltage Data // 4byte dT //4Byte Current Data // 4Byte Power Data // 4Byte dt
   * Epoch Time wird nur in der ersten Iteration geschrieben! Dann wird nur mehr das dT verwendet aus current millis()!!!
   */
  PowerValues _data;
  Serial.println("Creating Structur Element done!");
  Serial.println(ESP.getFreeHeap());

for (uint8_t _i = 1; _i < 5; _i++) {
    _data.timestamp.b[_i] = (byte)fram.read(Pos+_i);
    _data.current.b[_i] = (byte)fram.read(Pos+_i+4);
    _data.power.b[_i] = (byte)fram.read(Pos+_i+8);
    _data.loadvoltage.b[_i] = (byte)fram.read(Pos+_i+12);
    Serial.print("\n For Debugging------------------>>>>"); Serial.print(_data.timestamp.b[_i], HEX); Serial.print("\n"); //<<--- This is the line which makes the issue!!!
    Serial.println(_i);
  }
  Serial.println(_data.current.f);
  //Serial.println(_data.timestamp.ul);

  return _data;
}

If I uncomment the line of the mentioned serial.print() routine in the Serial Output I become the following error message:

19:02:46.688 -> User exception (panic/abort/assert)
19:02:46.688 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
19:02:46.688 ->
19:02:46.688 -> Panic core_esp8266_main.cpp:215 loop_task
19:02:46.688 ->

I can not found the root cause of the deletion of this special line of code.How should this serial print command influences the code in such a way that it causes a restart of the ESP?

Maybe someone can help me here...

Great Regards!
Jojo

Hi Guy,
Did you solve this issue? I got the same error message and is searching for solution.
Thanks

hard to provide any suggestions without seeing more of the code.

i've recently had some cases where the processor has an exception that was easily explained by some bad memory request

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.