Does anybody has a boot sequence in assembler source code (boot sequence) at hand, which configures any of the Sharp micro controllers of type LH75400, LH75401, LH75410 or LH75411 ?
Best would be for LH75411!
I am using a "selfmade" board.
thanks for any help!
Daniel
Didn't find your answer? Ask the community — no account required.
J
John Devereux
I assume the Sharp "bluestreak library" supports these chips? (I use the LH79520). It's a useful resource for getting things up and running, pinching initialisation sequences, register names etc.
John Devereux
D
Daniel
Hi,
yes, this is right. Actually I am trying to use the startup sequence given in the library. Nevertheless, I am facing some problems. I compiled the kev..._startup.asm and linked it to my C programme. The assembly source shows this:
Disassembly of section .text:
00000000 ea000006 b 00000020
00000004 ea000004 b 0000001c
00000008 ea000003 b 0000001c
0000000c ea000002 b 0000001c
00000010 ea000001 b 0000001c
00000014 e1a00000 nop (mov r0,r0)
00000018 e51ffff0 ldr pc, [pc, #-4080] ; fffff030
I am loading this into the internal SRAM via JTAG and step through it. Since my FlashRam is not working yet, I have to start the programme at address 0x0 manually (BTW: which processor mode should I use?). As you see in the code, from adress 0x0 it jumps to 0x20 which holds the instruction "ldr r0, [pc, #232]". Actually, this instruction fails! The JTAG programme (OCD Debugger) says: "Processor running" and if I halt the device, the cpu shows an undefined state (Processor mode is
0x0).
How this? Did I forget something? Stack settings probably? But all this should be handled by the startup sequence!
Any help is appreciated!
Daniel
J
John Devereux
Sounds more like a problem with the debugger to me. My code starts like this (remember it's for the LH79520 though!):
-----------------------------------
.equ MODE_USR ,0x10 .equ Mode_FIQ ,0x11 .equ Mode_IRQ ,0x12 .equ Mode_SVC ,0x13 .equ Mode_ABT ,0x17 .equ Mode_UNDEF ,0x1B .equ Mode_SYS ,0x1F /* only available on ARM Arch. v4 */ .equ I_Bit ,0x80 .equ F_Bit ,0x40
/* Locations of our memory system */ .equ MEMORY_Limit ,0x60008000 .equ RuntimeStackTop ,0+__ram_size /* svc mode stack (our main runtime stack)
_runtime: _reset: b init_stacks _undefined: b _undefined _swi: b osSWIint _prefetch_abort: b _prefetch_abort _data_abort: b _data_abort nop /* reserved location */ _irq: /* take vectored interrupt */ ldr pc,[pc,#-0xff0] _fiq: b _fiq_handler init_stacks: /* --- Initialize stack pointer registers */ /* Enter IRQ mode and set up the IRQ stack pointer */ MOV r0, #Mode_IRQ orr r0,r0,#I_Bit orr r0,r0,#F_Bit /* No interrupts */ MSR cpsr_c, r0 LDR sp, =IRQ_Stack
/* Enter FIQ mode and set up the FIQ stack pointer */ MOV r0, #Mode_FIQ orr r0,r0,#I_Bit orr r0,r0,#F_Bit /* No interrupts */ MSR cpsr_c, r0 LDR sp, =FIQ_Stack
/* Enter ABT mode and set up the ABT stack pointer */ MOV r0, #Mode_ABT orr r0,r0,#I_Bit orr r0,r0,#F_Bit /* No interrupts */ MSR cpsr_c, r0 LDR sp, =ABT_Stack
/* Enter IRQ mode and set up the IRQ stack pointer */ MOV r0, #Mode_UNDEF orr r0,r0,#I_Bit orr r0,r0,#F_Bit /* No interrupts */ MSR cpsr_c, r0 LDR sp, =UNDEF_Stack
/* Set up the SVC stack pointer last and return to SVC mode */ MOV r0, #Mode_SVC orr r0,r0,#I_Bit orr r0,r0,#F_Bit /* No interrupts */ MSR cpsr_c, r0 LDR sp, =SVC_Stack
John Devereux
D
Daniel
John,
thanks! I will try your stack setup. I am still supsecting the stack...
stack) */
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.