| | legOS ... really a stack question
|
|
I'm still having reliability problems with legOS when using the task management routines. However, I think the problem has more to do with the stack than the tm routines. I think the problem is related to the direct-motor routines and the entries in (...) (26 years ago, 2-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) Hmmm ... good point. 0xf000 is memory mapped I/O for the motors, IIRC. Not sure whats above there, but I wouldn't be surprised to hear it isn't a good place to store things. I'd guess that setting the stack to 0xeffe should be equally good. (...) (26 years ago, 2-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) Looking at my memory map, it appears that there is space for the stack in on-chip memory between fdc0 and ff7e (or thereabouts). That's just about 450 bytes. If you need more stack space than that, you'll need to move the stack to off-chip (...) (26 years ago, 2-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) All off-chip accesses to f000 or higher are memory mapped to the motors. Because accesses to addresses above fb7f are all on-chip or invalid, the motors are effectively memory mapped to f000-fb7f. (...) What are your symptoms again? One (...) (26 years ago, 2-Jan-99, to lugnet.robotics)
|
|
| | RE: legOS ... really a stack question
|
|
(...) .bss also contains global data initialized to 0, which is even worse if it's not cleared. -Allen -- Did you check the web site first?: (URL) (26 years ago, 2-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) Correct, that is where the motor driver chips live. It isn't actually RAM. (...) The _stack symbol defined by the linker is normally used by crt0 to set the initial stack pointer. In this case, the stack pointer isn't changed by legOS (...) (26 years ago, 3-Jan-99, to lugnet.robotics)
|
|
| | RE: legOS ... really a stack question
|
|
(...) Good point, I will add the code to clear it to my crt0.s before calling constructors: mov.w #__bss,r2 mov.w #__end,r3 sub.b r0l,r0l cmp.w r3,r2 bhs .Lbss_done .Lmore_bss: mov.b r0l,@r2 adds #1,r2 cmp.w r3,r2 blo .Lmore_bss .Lbss_done: ... John (...) (26 years ago, 3-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) Changing globals to statics causes crashes. Cheers, Ben. -- "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition (...) (26 years ago, 3-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) Strange that this is the case, since I'm pretty sure both are handled identically, except possibly for the ordering of such variables in memory. My guess is that some unrelated bug is causing your problems. -Kekoa (26 years ago, 4-Jan-99, to lugnet.robotics)
|
|
| | Re: legOS ... really a stack question
|
|
(...) The point appears to be that statics end up somewhere completely different from globals in the memory map - so I agree that it is probably an unrelated bug that is revealed by changing the memory map. As it happens, because of alignment, the (...) (26 years ago, 5-Jan-99, to lugnet.robotics)
|