RageKage
04-15-07, 03:02 AM
Back Again,
This time I am having trouble creating arrays on the 2138.
I am trying to create one relatively large 2d array and am having troubles.
As an Example:
char array[262][1024] = {0};
I have also tried:
char array[1024][262] = {0};
In both cases when I start getting to far into the indexing the ARM just freezes and a reset is required. I know the array itself should fit into the memory on the 2138, but its possible my stack isn't set correctly.
My start.s file:
@// code originally from phillips appnote 10254
@ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
@ Assembler Directives
@ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
.section asm_code,"ax" @ New Code section
@ CODE32 @ ARM code
.extern __main @ main not defined
@ in this section
.global _start @ global symbol
@ referenced in
@ ivt.s
@ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
_start:
@ Set SP for Supervisor mode. Depending upon
@ the stack the application needs this value
@ needs to be set.
@ stack is already set by bootloader
@ but if this point is entered by any
@ other means than reset, the stack pointer
@ needs to be set explicity
LDR SP,=0x40001000
@ Setting up SP for IRQ and FIQ mode.
@ Change mode before setting each one
@ move back again to Supervisor mode
@ Each interrupt has its own link
@ register, stack pointer and program
@ counter The stack pointers must be
@ initialized for interrupts to be
@ used later.
@ setup for fiq and irq interrupt stacks to run
@ below current stack by 1000.
mov r0, sp @ copy current stack pointer
sub r0, r0, #1000 @ make irq stack pointer
sub r1, r0, #1000 @ make fiq stack pointer
msr cpsr_c, #0x12 @ switch to irq mode
mov sp, r0 @ set irq stack pointer
msr cpsr_c, #0x11 @ fiq mode
mov sp, r1 @ set fiq stack pointer
msr cpsr_c, #0x13 @ supervisor mode F,I enabled
@ Jump to C code
LDR lr, =__main
MOV pc, lr
Any ideas on what I can do to get this array to work?
This time I am having trouble creating arrays on the 2138.
I am trying to create one relatively large 2d array and am having troubles.
As an Example:
char array[262][1024] = {0};
I have also tried:
char array[1024][262] = {0};
In both cases when I start getting to far into the indexing the ARM just freezes and a reset is required. I know the array itself should fit into the memory on the 2138, but its possible my stack isn't set correctly.
My start.s file:
@// code originally from phillips appnote 10254
@ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
@ Assembler Directives
@ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
.section asm_code,"ax" @ New Code section
@ CODE32 @ ARM code
.extern __main @ main not defined
@ in this section
.global _start @ global symbol
@ referenced in
@ ivt.s
@ ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
_start:
@ Set SP for Supervisor mode. Depending upon
@ the stack the application needs this value
@ needs to be set.
@ stack is already set by bootloader
@ but if this point is entered by any
@ other means than reset, the stack pointer
@ needs to be set explicity
LDR SP,=0x40001000
@ Setting up SP for IRQ and FIQ mode.
@ Change mode before setting each one
@ move back again to Supervisor mode
@ Each interrupt has its own link
@ register, stack pointer and program
@ counter The stack pointers must be
@ initialized for interrupts to be
@ used later.
@ setup for fiq and irq interrupt stacks to run
@ below current stack by 1000.
mov r0, sp @ copy current stack pointer
sub r0, r0, #1000 @ make irq stack pointer
sub r1, r0, #1000 @ make fiq stack pointer
msr cpsr_c, #0x12 @ switch to irq mode
mov sp, r0 @ set irq stack pointer
msr cpsr_c, #0x11 @ fiq mode
mov sp, r1 @ set fiq stack pointer
msr cpsr_c, #0x13 @ supervisor mode F,I enabled
@ Jump to C code
LDR lr, =__main
MOV pc, lr
Any ideas on what I can do to get this array to work?