jamming of code
Beginer
Posts: 21
Could You advise me please why is my code malfunction? I have program in assy what is full functional, but only when its running alone.
I need call this code from main program (in spin). Main program were running good earlier too. But when I call from this code assy code,
propeller gets jamed. Its maybe heavy say it so uncertainly, but how possibles there are to hapend this state?
Its due to bad writing to main memory? Or maybe bad strating or stoping cogs? Is possible to hapend some "crossing" cogs id?
I think, I dont use full count of cogs. I dont know where is reason.
Thanks a lot
I need call this code from main program (in spin). Main program were running good earlier too. But when I call from this code assy code,
propeller gets jamed. Its maybe heavy say it so uncertainly, but how possibles there are to hapend this state?
Its due to bad writing to main memory? Or maybe bad strating or stoping cogs? Is possible to hapend some "crossing" cogs id?
I think, I dont use full count of cogs. I dont know where is reason.
Thanks a lot
Comments
A completely open guess from one who knows little, would be that the "stack" and/or general memory is bleeding away. They are the same thing, as there is no separate stack area (I think).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
You main has the whole free HUB-RAM as stack. But a program started in another COG only has the stack you give it. If your program is calling functions and having local variables it might need more stack than you gave it an mess up code.
the BEST way to get help here in the forum is to attach your COMPLETE code to a posting.
Even if your program is REALLY BIG this will take only 0,1MB. Half a peanut on the forum server.
look at the attached picture how you create an archive with ALL files needed in your project right away with the propellertool itself
and how you can attach it to a posting.
Without attaching your code it will take FIVE times longer until you have your program running.
best regards
Stefan
Thanks
this archive function adds a readme.txt-file that shows the hirarchical structures of the objects
now I have to GUESS wich is your top-object
and as you use names that are not english it is even harder
so if I would like to find it out I have to load EVERY single file and do a compile looking when has the structure the most complexity
No I won't do that
add another post with the archive created with the PROPELLER-Tool
please add a comment that describes IN DETAIL wich programs are working and if you do WHAT exactly so it stops working
and what SYMPTOMS you see does it just stop or what EXACTLY is happening
As your code is not in english it is much harder to understand what your code is doing
add as much additional information as you can
best regards
Stefan
Post Edited (StefanL38) : 1/17/2010 1:26:56 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
You should define your variables with wich you communicate between the PASM-cog and SPIN-cogs
as first variables as a BLOCK and then you should start the PASM-cog with the second parameter containing the adress
to the FIRST of these variable
instead of
I guess that is DelkaPuls_L but I can't find a corresponding variable in the SPIN-code
so this means the program should calculate the adresses at RUN-time
to make sure that you are using the right adresses.
take a look into the PASM-driver of FullDuplexSerial how the adress-caclulating is done (for a long add 4)
Somehow the adress of this spin-variable-block has to be transported down to
the object code2.spin which does start the PASM-cog.
For this I would add a paremeter to the start-method
best regards
Stefan
One idea what MIGHT causes the problem is the fact that,
if you add the PASM-code, the adresses in HUB-RAM are changing.
And then if your PASM-code does a WRLONG to HUB-RAM it is overwriting something else and that this storing the value at an adress that is occupid by something different makes the program crash.
So INSTEAD of using hardcodes adresses you should use adresspointers that are calculated at RUNTIME to make sure that the adresses are still valid
regardless of any changes in the SPIN-code or the PASM-code.
You don't need to use the same names in SPIN and PASM. It is just ME that I don't know what the "DelkaPuls_L"-label is good for.
As you provided only very little information I was GUESSING that the label "DelkaPuls_L" corresponds with a SPIN-variable.
Without providing MUCH MORE information about your software what it is doing especially about PASM-cog and SPIN-cog communication over HUB-RAM
the forum won't be able to help you.
best regards
Stefan
Post Edited (StefanL38) : 1/17/2010 6:19:21 PM GMT