"misaligned long address access"/ cpu int 5, generated by Processor Expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"misaligned long address access"/ cpu int 5, generated by Processor Expert

3,311 Views
AgentK
Contributor III
Freescale 56f800 DSP & Codewarrior v8.2
 
I am trying to convert a working single tasking application to sit on top of uCos. An interrupt samples an ADC every time a pulse goes by. The pulse rate is 200kHz, and the single tasking code handled this. Under uCos, it works with 1 Hz pulses, but the main task slows down as the pulse rate goes up. With pulse rates of 100Hz, the application hangs after hitting cpu interrupt 5 in cpu.c (code generated by processor expert), the error message for which is "misaligned long address access". The interrupt disables itself until the ADC has had time to finish conversion i.e. the ADC On completion event re-enables the IRQ, so the interrupt shouldn't fire before the first one finishes. Servicing each pulse takes 0.5 millisecs from a scope & led measurment, but the ISR itself is much shorter - usecs, although I haven't measured it yet.
 
Anybody know anything more about what might cause "cpu interrupt 5"? I can't find any mention of it in the Processor Expert documentation.
 
 
Labels (1)
0 Kudos
4 Replies

717 Views
allawtterb
Contributor IV


AgentK wrote:
Anybody know anything more about what might cause "cpu interrupt 5"? I can't find any mention of it in the Processor Expert documentation.
 
 


Take a look at page 136 of the User's Manual for your DSP for the interrupt table, it appears it could be the result of a stack overflow if the interrupt number you are seeing is 0 indexed.
 
 
Edit: Link to User's Manual


Message Edited by allawtterb on 2008-06-03 08:44 AM
0 Kudos

717 Views
AgentK
Contributor III
I've found stack & heap size under Cpu bean\build options, but they are greyed out, and so I can't change the stack size from 200h.  Although this seems to be the default for  56f8356 & 66 CW projects, it doesn't seem to be under CW's control. 
0 Kudos

717 Views
ProcessorExpert
Senior Contributor III
Hello,
the stack size and also other parameters that influence the content of linker command file (extension .cmd) can be changed only if the property 'Generate linker file' in CPU bean inspector in build options tab is set to 'yes'.  
If it's set to 'no', the linker file is not generated by Processor Expert and the properties influencing linker file cannot be changed. However, this could be wanted behavior because of some manual changes that the user doesn't want to have overwritten. 
If you will re-enable the linker file generation, backup the linker command file and I also recommend to switch on the option 'Track changes' in Processor Expert Project options to see what changes in the generated file.
 
best regards
Petr Hradsky
Processor Expert Support Team
UNIS
 
 
 
0 Kudos

717 Views
AgentK
Contributor III
How do I increase the memory allocated to the HW stack? Presumably this is under the control of  codewarrior's linker settings, rather than a PE bean. Increasing the size of each of  uCos's tasks' stacks doesn't sound like the solution to a HW stack overflow, and all 4 tasks have hundreds of bytes left on their stack.
 
The offending interrupt now always happens just as Exit_Critical is called in TCB_Init in uCos's os_core.c. It feels like a pointer has overrun the end of an array, but I've not altered any code that does that, so I'm going to try switching tasks & blocks of code out, to localise the problem. 
0 Kudos