simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] ATMega48 Crash


From: Michael N. Moran
Subject: Re: [Simulavr-devel] ATMega48 Crash
Date: Mon, 13 Apr 2009 07:49:04 -0400
User-agent: Thunderbird 2.0.0.5 (X11/20070727)

Knut Schwichtenberg wrote:
Michael N. Moran wrote:
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.
To be honest I think to use numbers instead of defines is
a bad coding style. But I don't bite the hand that feeds
me ;-).

Yes, I could not agree more, however, the
hwmega48extirq.{h,cpp} files are essentially clones of
the of hwmegaextirq.{h,cpp}.

There are *many* things that I would change
stylistically about the simulavrxx if it were my own
code ... but my goal was to scratch my itch and contribute
a bit and *not* to become a big-time contributer ;)

It is difficult to come into a project as a newb and expect
to be granted the ability to change the "flavor" of the
project. Just look what happened when I changed the
object composition style :)

When my patches were first rejected and then not merged in
a timely manner, and my professional priorities changed,
my interest in simulavrxx ... waned.

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 expect it runs, BUT there is another example named SPI
and that does not have the problems. It works on the M128
and could it be a problem with the different ways of
initializing (pointer vs. member)?

I don't see a connection. For example the HWMegaSpi member
in the M128 and M48 are both pointers.

While debugging both avr / simulavrxx I saw this error to
come at line 115 of main.cpp (avr). Here the SPCR
register is referenced! Now your solution is: drop the
originally in atmega48.cpp created SPI-object and replace
it by the object dynamically created - that's a solution
but does it handle the problem? ;-)

I don't understand. There is no object creation/destruction
involved at this stage. The HWMegaSpi objects in both the
M128 and M48 case are dynamically allocated in their
constructors (not initailizers).

My change had to do with adding those objects to the
"CycleList", which, although I do not claim a complete
understanding of its intended usage and restrictions,
is just a list of "Hardware" components that need to
periodically be given some CPU time.

This is the stack trace at
"AvrDevice::AddToCycleList(Hardware *hw) {" and SPCR = in
main():

I did not glean anything useful from the trace, though
I have set my share of breakpoints in the AddToCycleList
operation over the last few days :)

I do not claim to actually understand the use of the
CycleList family of calls and any "documentation"/ comments is ... well ... missing. ;)
Well as usual for lots of PD-projects we can be glad to
have a user manual. A German colleague always says: The
code is the documentation - but means the German "Kot",
which is spoke like code and has a little different
meaning...

Feel free to start with programmers documentation :-).

:)
Been there done that. However, I only have limited time
to spend with this. That's why I'm asking the more
experienced developers.


--
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"So often times it happens, that we live our lives in chains
 and we never even know we have the key."
"Already Gone" by Jack Tempchin (recorded by The Eagles)

The Beatles were wrong: 1 & 1 & 1 is 1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]