Gentlemen,
Thanks to Kurt's inspiration, I looked into the
sefaulting of the atmega48 and "solved" the problem
using this patch.
Index: hwmega48extirq.cpp
===================================================================
RCS file: /sources/simulavr/simulavrxx/src/hwmega48extirq.cpp,v
retrieving revision 1.1
diff -r1.1 hwmega48extirq.cpp
123c123
< for (int tt =0; tt<4; tt++) {
---
> for (int tt =0; tt<2; tt++) {
Apparently, we were iterating beyond the bounds
of the initialized portion of the pinI vector.
It seems that only the first two slots were
initialized in the constructor for p0, and p1.
I have not, however, taken the time to understand
what the code is trying to accomplish. Therefore,
I don't know if this is a "correct" fix.
Either way, this "fixed" the segfault.
However, after this was fixed, the SPI code caused
a "crash" with the following message:
"device would be twice in cycle list"
Apparently, the HWSpi was adding itself to
the CycleList when it was already in the
cycle list. I added the following patch to
"fix" the problem. Apparently, when I originally
developed the HWSpi, the AddCycleList implementation
was not so ... picky.
Index: hwspi.cpp
===================================================================
RCS file: /sources/simulavr/simulavrxx/src/hwspi.cpp,v
retrieving revision 1.8
diff -r1.8 hwspi.cpp
99a100
> core->RemoveFromCycleList(this);
Basically, I (HWSpi) now removes itself from the
cycle list before adding itself. The act of removing
an element from the list does *not* fail if the element
was not already in the list.
I do not claim to actually understand the use of
the CycleList family of calls and any "documentation"/
comments is ... well ... missing. ;)
May I have *your* comments?