i got a message "PC,DADDR or FADDR holds an invalid address " in the visual dsp++5.0 on 1dsp 21062. platform.
how to find the bug in the problem and rectify it.
any help would be appreciated.
It definitely looks like the stack is being corrupted, though I haven't been able to pin-point why yet. Some points to get you started, though:
In your LDF the Stack is defined as being 4K words:
RESERVE(heaps_and_stack, heaps_and_stack_length = 8K)
INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))
ldf_stack_space = heaps_and_stack;
ldf_stack_end = ldf_stack_space + ((heaps_and_stack_length * 4K) / 8K);
ldf_stack_length = ldf_stack_end - ldf_stack_space;
ldf_heap_space = ldf_stack_end;
ldf_heap_end = ldf_heap_space + ((heaps_and_stack_length * 4K) / 8K);
ldf_heap_length = ldf_heap_end - ldf_heap_space;
} > seg_dmda
Stepping through the code in your application, just as an initial example I can see that in "uu_mil_preamble()" you are allocating huge amounts of data locally, from the stack:
That's ~5400 words by my calculation, not including any preceding allocations such as the large buffers declared in main(), which would blow through the stack and corrupt it. I recommend first allocating more stack space. You might also want to check your code in case of out-of-bounds accesses which could corrupt the stack pointer.
Although this error occurs 'in building' your project - does it actually occur then, or does it occur when your DXE is loaded and run to main? Can you disable "Run to main after load" under 'Settings: Preferences: General', and load the DXE.
If it loads without incident, step through the code until the failure occurs. This may give a better idea where/why the failure is occurring.
This error typically indicates that the stack has become corrupted which can occur when allocating very large local arrays (that exceed the stack size). It may occur if you are trying to access a peripheral which is not supported by the simulator.
If you are unable to trace it, can you provide an example? Can you also confirm whether you are still using the Simulator?
yes i am still using the simulator.
this error appears after the build is complete , and after i click on the run button.
i am attaching my sample project with this. please take a look.
I'm out of time to look at this further at the moment, but I tracked the problem to this call at the end of uu_mil_preamble():
If you comment this out, the function returns normally. If you comment out the other 4 calls to uu_mil_mod() at the end of uu_mil_preamble(), leaving only that call, the application crashes.
Hopefully that's enough to help you track down the underlying problem.
Retrieving data ...