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.

Can't boot on omap-l137, because of a fail in jump to _c_int00.

Other Parts Discussed in Thread: OMAP-L137

Hello, in my project I was trying to boot from the flash memory and faced the problem. So, I decided to observe a booting process without a GEL file.

I am using ARM9_intvecs.asm, ARM9_initstack.asm, ARM9_handler.asm and boot.asm for booting routine. I am trying to debug my program from the very beginning (from the entry point). My entry point in linker config file is _init_stack. And I found the problem - in this code  all is ok, untill the jump to c_int00. On the instruction "LDR PC, c_int00" debugger says that "No source available for "0x0". What am I doing wrong?

(I have omap-l137 evm from spectrum digital and use CSL macros.)

;*-----------------------------------------------------------------------------
;* Source Location: OMAPL1x/support/src/
;* File: ARM9_initstack.asm
;*
;* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
......
......
;*
;*	initstack.asm
;*
;*		If using the RTS library from the TMS470 Code Generation Tools 4.6.3 or
;*		earlier, include this file (use function _init_stack as an entry point)
;*		to initialize the privileged mode stacks.
;*
;*		This module performs the following actions:
;*			1) Allocates the stack and initializes the stack pointer for SVC,
;*			   IRQ, & FIQ mode
;*			2) Calls the normal initial boot routine (_c_int00)
;*
;*-----------------------------------------------------------------------------

; Global symbols defined here
   .global _c_int00
   .global _init_stack


;****************************************************************************
;* DEFINE PRIVILEGED MODE STACKS: SVC, IRQ, & FIQ
;****************************************************************************
__SVC_STACK_SIZE:.set 0x1000
__IRQ_STACK_SIZE:.set 0x1000
__FIQ_STACK_SIZE:.set 0x1000
__svc_stack:.usect	".svcstack", __SVC_STACK_SIZE, 4
__irq_stack:.usect	".irqstack", __IRQ_STACK_SIZE, 4
__fiq_stack:.usect	".fiqstack", __FIQ_STACK_SIZE, 4




;****************************************************************************
;* FUNCTION DEF: _init_stack
;****************************************************************************
_init_stack:.asmfunc
	; SET TO SVC MODE
	MRS		R0, CPSR
	BIC		R0, R0, #0x1F
	ORR		R0, R0, #0x13
	MSR		CPSR_CF, R0

	; INITIALIZE THE SVC MODE STACK
	LDR		SP, c_svc_stack
	LDR		R0, c_SVC_STACK_SIZE
	ADD		SP, SP, R0

	; SET TO IRQ MODE
	MRS		R0, CPSR
	BIC		R0, R0, #0x1F
	ORR		R0, R0, #0x12
	MSR		CPSR_CF, R0

	; INITIALIZE THE IRQ MODE STACK
	LDR		SP, c_irq_stack
	LDR		R0, c_IRQ_STACK_SIZE
	ADD		SP, SP, R0

	; SET TO FIQ MODE
	MRS		R0, CPSR
	BIC		R0, R0, #0x1F
	ORR		R0, R0, #0x11
	MSR		CPSR_CF, R0

	; INITIALIZE THE FIQ MODE STACK
	LDR		SP, c_fiq_stack
	LDR		R0, c_FIQ_STACK_SIZE
	ADD		SP, SP, R0

	; Continue to _c_int00
	LDR		PC, c_int00
	.endasmfunc


;****************************************************************************
;* CONSTANTS USED BY THIS MODULE
;****************************************************************************
c_int00 .long _c_int00
c_svc_stack .long __svc_stack
c_irq_stack .long __irq_stack
c_fiq_stack .long __fiq_stack
c_SVC_STACK_SIZE .long __SVC_STACK_SIZE
c_IRQ_STACK_SIZE .long __IRQ_STACK_SIZE
c_FIQ_STACK_SIZE .long __FIQ_STACK_SIZE

  • Hi Denis,

    Denis said:
    Hello, in my project I was trying to boot from the flash memory and faced the problem. So, I decided to observe a booting process without a GEL file.

    What were you trying to boot? From which memory? You flashed ubl??

    If you are using CCS, you have to use the GEL file. You cannot initialize the target without GEL file and you need emulator to load the app into the target. Describe step by step what do you want to do and what you actually got.....

    ----------------

  • I wanted my board to work without jtag emulation, so I was trying to write my ARM application(.out file) to SPI flash memory (processors.wiki.ti.com/.../Boot_Images_for_OMAP-L137). But it didn't work.
    So, to find the reason why, I've started to run my program in a debugger (with jtag emulator) from the very beginning (from the entry point _init_stack.) I am executing my application in a debugger step-by-step till "LDR PC, c_int00" command, where my debugger says "No source available for "0x0". But _c_int00 is defined in boot.asm file, which is compiled and linked with other project files.
    I use CCS, but I removed all initialization from the GEL file, except memory mapping. I do all the initialization using CSL macros. The key point here is that during execution my program can't jump to the main function (or to _c_int00) and I can't understand why.
  • Hi,
    If you want to run any ARM app on OMAPL137 then you need to connect DSP first with gel file then connect ARM.
    Now load the ARM application into ARM code then see if your code stop at "main()"

    If not, attach your ARM code here, I will try it and let you know.
  • I found the problem. I tried new version of CCS, and now my program jumps to _c_int00 during debug. And I also found the silly mistake - I didn't noticed, that I have to use a specified address for my entry point, because DSP makes ARM to execute code from that address. So, I remapped .text section to the defined  address  (defined in macro "DEVICE_ARM_UBL_LOAD_ADDR") and now it works (though, I didn't understand how to specify the address of a specific asm function, _init_stack in my case).

  • Hi Denis,
    Sounds good.
    Thanks for your update.