This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

stack issue

Other Parts Discussed in Thread: TMS570LS3137

Code composer studio version 5.4.01

processor TMS570LS3137.


Hi,

I am running into an issue where two variables of the same value being compared in the
"IF" loop and returns "FALSE" instead of "TRUE"

I copied the function parameters into the local variables then it started to work.
I thought this could be because of stack issue, I verified stack allocation in Boot
and in *.cmd and it looks fine.

Can anyone please provide me an idea where I can find out the root cause.

Please refer the *.cmd, *.map and snap shots for your reference.


Thanks
Sanjeev

Does not work as expected in below image:

It works as expected in the below image after copying function arguments into the local parameters

BT_Stack_Create.asm


ldr R0, btctadd
ldr R2, [R0, #BT_TBL_StackTop] ; load the stack start location from configuration table
add R2, R2, #0x00001000 ; start address for user defined stack
add R3, R2, #0x00000100 ; start address for svc stack
add R4, R3, #0x00000100 ; start address for fiq stack
add R5, R4, #0x00000100 ; start address for irq stack
add R6, R5, #0x00000100 ; start aborted
add R7, R6, #0x00000100 ; start is undefined

msr cpsr_c, #0xD1 ;load reference for the stack top and fiq stack creation instruction
mov sp, R4 ;load fiq stack start address
msr cpsr_c, #0xD2 ;load reference for the stack top and irq stack creation instruction
mov sp, R5 ;load irq stack start address
msr cpsr_c, #0xD7 ;load reference for the stack top and abort stack instruction
mov sp, R6 ;load stack abort address
msr cpsr_c, #0xDB ;load reference for the stack top and undefined stack instruction
mov sp, R7 ;load stack undefined address
msr cpsr_c, #0xDF ;load reference for the stack top and user stack creation instruction
mov sp, R2 ;load user defined stack start address
msr cpsr_c, #0xD3 ;load reference for the stack top and svc stack creation instruction
mov sp, R3 ;load svc stack start address
bx lr

.endasmfunc

*.cmd file :-

STACKS   (RW)   : origin = 0x08000000, length = 0x001500

.stack             : > STACKS