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.

请问OMAP-L138 ARM ubl.cmd中的-e boot是什么意思呀?

Other Parts Discussed in Thread: OMAP-L138

请问-e boot是什么意思呀?
OMAP-L138 ARM  ubl.cmd
-e boot

IRAMStart  = 0x80000000;
IRAMSize   = 0x00008000;
DRAMStart  = 0x80000000;
DRAMSize   = 0x00008000;

ASYNC_MEM_START    = 0x62000000;

INTERNAL_RAM_START = 0x80000000;
INTERNAL_RAM_SIZE  = 0x00008000;

STACK_START = INTERNAL_RAM_START + INTERNAL_RAM_SIZE;

MEMORY
{
  ARM_I_IVT       (RX)  : origin = 0xFFFFD000   length = 0x00000020

  UBL_TEXT        (RWX) : origin = 0x80000000   length = 0x00006800
  UBL_DATA        (RWX) : origin = 0x80006800   length = 0x00000800

  UBL_BSS         (RW)  : origin = 0x80007000   length = 0x00000800
  UBL_STACK       (RW)  : origin = 0x80007800   length = 0x00000800
  UBL_DRAM        (RWX) : origin = 0xC0000000   length = 0x10000000
}

SECTIONS
{

  .text :
  {
    *(.boot)
    . = align(4);
    *(.text)
    . = align(4);
  } > UBL_TEXT

  .data :
  {
    *(.const)
  } > UBL_DATA

  .bss :
  {
    *(.bss)
    . = align(4);
  } > UBL_BSS
 
  .ddr_mem :
  {
    . += 0x10000000;
  } run = UBL_DRAM, type=DSECT, RUN_START(EXTERNAL_RAM_START), RUN_END(EXTERNAL_RAM_END), SIZE(EXTERNAL_RAM_SIZE)
 
  .stack :
  {
    .+=0x0400;
  } run = UBL_STACK, type=DSECT, SIZE(STACK_SIZE)
   
}

  • -e boot表示代码入口地址entry point address为boot
  • 谢谢!编译时为什么总时说boot没有定义??
    undefined first referenced
    symbol in file
    --------- ----------------
    boot

    error #10234-D: unresolved symbols remain


    代码如下:
    #define _TMS470_

    #if defined(__TMS470__)
    #pragma TASK(boot);
    #pragma NO_HOOKS(boot);
    #pragma CODE_SECTION(boot,".boot");
    #endif
    void boot(void)
    {
    asm(" .global STACK_START");
    asm(" .global _stack");
    asm(" .global main");
    asm(" NOP");
    asm(" MRS r0, cpsr");
    asm(" BIC r0, r0, #0x1F"); // CLEAR MODES
    asm(" ORR r0, r0, #0x13"); // SET SUPERVISOR mode
    asm(" ORR r0, r0, #0xC0"); // Disable FIQ and IRQ
    asm(" MSR cpsr, r0");
    asm(" NOP");

    // Set the IVT to low memory, leave MMU & caches disabled
    asm(" MRC p15,#0,r0,c1,c0,#0");
    asm(" BIC r0,r0,#0x00002300");
    asm(" BIC r0,r0,#0x00000087");
    asm(" ORR r0,r0,#0x00000002");
    asm(" ORR r0,r0,#0x00001000");
    asm(" MCR p15,#0,r0,c1,c0,#0");
    asm(" NOP");

    // Setup the stack pointer
    asm(" LDR sp,_stack");
    asm(" SUB sp,sp,#4");
    asm(" BIC sp, sp, #7");

    // Call to main entry point
    main();

    asm("_stack:");
    asm(" .word STACK_START");
    }
  • 谢谢!编译时为什么总时说boot没有定义??
    undefined first referenced
    symbol in file
    --------- ----------------
    boot

    error #10234-D: unresolved symbols remain


    代码如下:
    #define _TMS470_

    #if defined(__TMS470__)
    #pragma TASK(boot);
    #pragma NO_HOOKS(boot);
    #pragma CODE_SECTION(boot,".boot");
    #endif
    void boot(void)
    {
    asm(" .global STACK_START");
    asm(" .global _stack");
    asm(" .global main");
    asm(" NOP");
    asm(" MRS r0, cpsr");
    asm(" BIC r0, r0, #0x1F"); // CLEAR MODES
    asm(" ORR r0, r0, #0x13"); // SET SUPERVISOR mode
    asm(" ORR r0, r0, #0xC0"); // Disable FIQ and IRQ
    asm(" MSR cpsr, r0");
    asm(" NOP");

    // Set the IVT to low memory, leave MMU & caches disabled
    asm(" MRC p15,#0,r0,c1,c0,#0");
    asm(" BIC r0,r0,#0x00002300");
    asm(" BIC r0,r0,#0x00000087");
    asm(" ORR r0,r0,#0x00000002");
    asm(" ORR r0,r0,#0x00001000");
    asm(" MCR p15,#0,r0,c1,c0,#0");
    asm(" NOP");

    // Setup the stack pointer
    asm(" LDR sp,_stack");
    asm(" SUB sp,sp,#4");
    asm(" BIC sp, sp, #7");

    // Call to main entry point
    main();

    asm("_stack:");
    asm(" .word STACK_START");
    }
  • boot前面少了个"."吧,改成-e .boot

    看到你cmd文件里对boot的定义
    .text :
    {
    *(.boot)
    . = align(4);
    *(.text)
    . = align(4);
    } > UBL_TEXT
  • 不好意思,加了"." 改成 -e .boot还是同样出错了。
    >> Compilation failure
    undefined first referenced
    symbol in file
    --------- ----------------
    .boot

    error #10234-D: unresolved symbols remain
  • #pragma TASK这个伪指令我在编译器手册里没找到。