Hi,
I finally found the time to continue with a project which was laying around for about 6 months. To refresh my memory, UI loaded the code into SimulIDE, but it crashed.
I updated SimulIDE (my OS was already updated) and all libraries used.
The code is quite large, so I inserted breaks to pinpoint where the crash occurred.
I am on Debian 5.10.140-1 (2022-09-02), named bullseye (version 11)
I am currently using SimulIDE_0.4.15-SR10.AppImage
When I start SimulIDE from the CLI, load the schematics, and run the arduino code, it crashes with the following showing on the CLI (green text is output from my arduino code):
./SimulIDE_0.4.15-SR10.AppImage
" Loading Component sets at:"
"/tmp/.mount_SimulIJD4uAf/simulide/share/simulide/data"
" Loaded Component set: " "arduinos.xml"
" Loaded Component set: " "avrs.xml"
" Loaded Component set: " "ic74.xml"
" Loaded Component set: " "icCD.xml"
" Loaded Component set: " "keys.xml"
" Loaded Component set: " "led_display.xml"
" Loaded Component set: " "pics.xml"
" Loaded Component set: " "ternary.xml"
" Loaded Component set: " "tools.xml"
" Loaded Component set: " "unsorted.xml"
" Loaded Component set: " "ussr.xml"
Simulation Stopped
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Initializing "Arduino Mega-28" ...
UART 0
UART 1
UART 2
UART 3
AvrProcessor::setDevice Avr Init: "atmega2560" true
"/tmp/.mount_SimulIJD4uAf/simulide/share/simulide/data/images/mega_board.png"
... "Arduino Mega-28" OK
AvrCompBase::attachPins Found SDA SCL
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Starting Circuit Simulation...
Initializing 233 eElements
Initializing 0 Buses
Initializing 41 eNodes
Circuit Matrix looks good
Simulation Running...
0;255;3;0;14;Gateway startup complete..
0;255;0;0;17;2.3.2.
setup() started.....
The Magic from EEPROM is: -1..
Forcing defaults in EEPROM..
Filling EEPROM with defaults..
Display 1 Address is set to 3C..
AvrCompBase::twenChanged Enable: 1
AvrCompBase::twenChanged i2cFreq: 100000
Segmentation fault
The arduino code triggering this is display1.begin(...), as you can see below:
The DEBUG, DEBUGLN2 and ERRORLN are macro's around Serial.print
It is very well possible -even likely- that my Arduino code is far from perfect, but my understanding is that this should result in a non-functioning simulation. It should NOT lead to a crash of the simulator itself.
I also made a strace from this crash, but I lack the knowledge (and experience) to correctly interpret the output. For completeness is included the last lines from the strace output below:
...
Display Address is set to 3C..
poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
writev(4, [{iov_base=";\3o\1\r\0\0\1\0\0\0\0D\2(\0\216\1\27\0\234\4\373\2\224\0d\08\5\373\2"..., iov_len=1524}], 1) = 1524
poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
writev(4, [{iov_base="+\0\1\0", iov_len=4}], 1) = 4
futex(0x7ffcad7b2ad8, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x10f7c98, FUTEX_WAKE_PRIVATE, 1) = 0
AvrCompBase::twenChanged Enable: 1
AvrCompBase::twenChanged i2cFreq: 100000
+++ killed by SIGSEGV +++
As far as I understand the above info, something goes wrong when starting the i2c bus. I even disconnected the i2c pins in the circuit just to make sure it wasn't wrongly connected, but the simulator still crashes.
I'm going to perform 2 more tests:
* I will try the above on a windows system with the windows version of SimulIDE
* I will try different versions of SimulIDE
Any help and insight is truly appreciated.
Marcel
I finally found the time to continue with a project which was laying around for about 6 months. To refresh my memory, UI loaded the code into SimulIDE, but it crashed.
I updated SimulIDE (my OS was already updated) and all libraries used.
The code is quite large, so I inserted breaks to pinpoint where the crash occurred.
I am on Debian 5.10.140-1 (2022-09-02), named bullseye (version 11)
I am currently using SimulIDE_0.4.15-SR10.AppImage
When I start SimulIDE from the CLI, load the schematics, and run the arduino code, it crashes with the following showing on the CLI (green text is output from my arduino code):
./SimulIDE_0.4.15-SR10.AppImage
" Loading Component sets at:"
"/tmp/.mount_SimulIJD4uAf/simulide/share/simulide/data"
" Loaded Component set: " "arduinos.xml"
" Loaded Component set: " "avrs.xml"
" Loaded Component set: " "ic74.xml"
" Loaded Component set: " "icCD.xml"
" Loaded Component set: " "keys.xml"
" Loaded Component set: " "led_display.xml"
" Loaded Component set: " "pics.xml"
" Loaded Component set: " "ternary.xml"
" Loaded Component set: " "tools.xml"
" Loaded Component set: " "unsorted.xml"
" Loaded Component set: " "ussr.xml"
Simulation Stopped
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Initializing "Arduino Mega-28" ...
UART 0
UART 1
UART 2
UART 3
AvrProcessor::setDevice Avr Init: "atmega2560" true
"/tmp/.mount_SimulIJD4uAf/simulide/share/simulide/data/images/mega_board.png"
... "Arduino Mega-28" OK
AvrCompBase::attachPins Found SDA SCL
Frames/Sec: 20 Frames per Sec
Steps/Fram: 50000 Simul. Steps
Speed PER: 100%
Speed SPS: 1000000 Steps Per Sec
Simul Step: 1000 nanoSeconds
React Rate: 50 Simul. Steps
Starting Circuit Simulation...
Initializing 233 eElements
Initializing 0 Buses
Initializing 41 eNodes
Circuit Matrix looks good
Simulation Running...
0;255;3;0;14;Gateway startup complete..
0;255;0;0;17;2.3.2.
setup() started.....
The Magic from EEPROM is: -1..
Forcing defaults in EEPROM..
Filling EEPROM with defaults..
Display 1 Address is set to 3C..
AvrCompBase::twenChanged Enable: 1
AvrCompBase::twenChanged i2cFreq: 100000
Segmentation fault
The arduino code triggering this is display1.begin(...), as you can see below:
- Code:
...
// Instance is globally created
ifdef WiWo_DISPLAY1_USES_SSD1306
Adafruit_SSD1306 display1(SCREEN1_WIDTH, SCREEN1_HEIGHT, &Wire, SCREEN1_RESET);
#endif // WiWo_DISPLAY1_USES_SSD1306
...
void setup () {
...
// S11: Start the display
#ifdef WiWo_DISPLAY1_ENABLED // Enable this when the system has a display
DEBUG(F("Display 1 Address is set to ")); DEBUGLN2(SCREEN1_ADDRESS,HEX);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display1.begin(SSD1306_SWITCHCAPVCC, SCREEN1_ADDRESS))
{
ERRORLN(F("1:SSD1306 allocation failed"));
}
...
The DEBUG, DEBUGLN2 and ERRORLN are macro's around Serial.print
It is very well possible -even likely- that my Arduino code is far from perfect, but my understanding is that this should result in a non-functioning simulation. It should NOT lead to a crash of the simulator itself.
I also made a strace from this crash, but I lack the knowledge (and experience) to correctly interpret the output. For completeness is included the last lines from the strace output below:
...
Display Address is set to 3C..
poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
writev(4, [{iov_base=";\3o\1\r\0\0\1\0\0\0\0D\2(\0\216\1\27\0\234\4\373\2\224\0d\08\5\373\2"..., iov_len=1524}], 1) = 1524
poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}])
writev(4, [{iov_base="+\0\1\0", iov_len=4}], 1) = 4
futex(0x7ffcad7b2ad8, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0x10f7c98, FUTEX_WAKE_PRIVATE, 1) = 0
AvrCompBase::twenChanged Enable: 1
AvrCompBase::twenChanged i2cFreq: 100000
+++ killed by SIGSEGV +++
As far as I understand the above info, something goes wrong when starting the i2c bus. I even disconnected the i2c pins in the circuit just to make sure it wasn't wrongly connected, but the simulator still crashes.
I'm going to perform 2 more tests:
* I will try the above on a windows system with the windows version of SimulIDE
* I will try different versions of SimulIDE
Any help and insight is truly appreciated.
Marcel