-->
Page 1 of 1

Fatal exception 0 (Illegal Instruction cause)

PostPosted: Wed Apr 17, 2019 7:04 am
by simonharvan
Hello guys,

I have a problem I am trying to write program for counting people with MLX90640 sensor, it uses a bit more memory and computational power, but reasonably for what is possible with ESP8266.

I am pushed the also not working version into git: https://github.com/simonharvan/counting-node

The process is:
  • Get frame from MLX90640
  • Is it trained (calculating average background temperature on X frames)?
  • If yes, use gaussian for noise
  • Thresholding
  • Find object in frame
Altough when I introduced function of finding object, it fails after trying to calculate the object position in frame with stacktrace:
Code: Select allException 0: Illegal instruction
PC: 0x3f800000
EXCVADDR: 0x00000000

Decoding stack results
0x40201a81: ExtractTgcParameters(unsigned short*, paramsMLX90640*) at /var/folders/m1/mggsqh2d7b36s8hdk82x33nw0000gn/T/arduino_build_834749/sketch/MLX90640_API.cpp line 745
0x40203543: loop() at /Users/simonharvan/Documents/Development/Arduino/counting-people/counting-people.ino line 188
0x402055d3: delay(unsigned long) at /Applications/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring.cpp line 54
0x402032f8: setupWiFi() at /Users/simonharvan/Documents/Development/Arduino/counting-people/counting-people.ino line 122
0x40204a1c: loop_wrapper() at /Applications/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp line 125
0x401000e8: app_entry() at /Applications/Arduino.app/Contents/Java/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp line 248


But this is at setup, even though I am already at loop and trying to calculate. Also this happens when I upload the code and then try to comment the line. It fails again. After trying to comment everything, it seems that memory is somehow corrupted and works with the old code.

My configuration:
  • OS: Mac
  • IDE: Arduino 1.8.7
  • Core: 2.6.0 - dev (same thing happens at 2.5.0)
  • Esspressif FW: pre 3.0 (same thing happens with 2.2.1)

If you need any more info, I would gladly provide.

Best,
Simon

Re: Fatal exception 0 (Illegal Instruction cause)

PostPosted: Fri Apr 19, 2019 5:40 am
by simonharvan
Meanwhile I was able to resolve, if anybody is wondering how, I had problem with memory assignment and after that everything went fine. You can check it out at github in link I wrote in question.