world leader in high performance signal processing
Trace:

Differences

This shows you the differences between two versions of the page.

load_application_running_in_bf561_core_b [2008/06/19 09:17]
adamliyi document how to find default linker script
load_application_running_in_bf561_core_b [2010/09/09 22:02] (current)
Line 9: Line 9:
 ===== Load standalone program to Core B in uClinux ===== ===== Load standalone program to Core B in uClinux =====
  
-You can create a ELF program to run on core B using **bfin-elf-gcc**. When linux booted on core A, you can use the utility "corebldto load the binary to memory and start core B for execution.+You can create a ELF program to run on core B using **bfin-elf-gcc**. When linux booted on core A, you can use the utility **corebld** to load the binary to memory and start core B for execution.
  
 By default, the linux kernel running on core A manages all HW resources, except L2 memory and L1 memory on core B. Core B can only utilize L2 and its L1 memory. You can change linux kernel setting to give control of some HW resource (like part of SDRAM) to core B of course. But please note core A and core B cannot share the same resource, since there is no synchronization between the two cores. By default, the linux kernel running on core A manages all HW resources, except L2 memory and L1 memory on core B. Core B can only utilize L2 and its L1 memory. You can change linux kernel setting to give control of some HW resource (like part of SDRAM) to core B of course. But please note core A and core B cannot share the same resource, since there is no synchronization between the two cores.
Line 17: Line 17:
 Linker script controls linker to create binary with expected memory layout. **bfin-elf-gcc** uses some arch specific options to make linker choose special linker script and start file. Here we care about two options: **-mmulticore** and **mcoreb**. The detailed meaning can be found in [[http://gcc.gnu.org/onlinedocs/gcc/Blackfin-Options.html | GCC manual ]]. To find out the default linker script used: Linker script controls linker to create binary with expected memory layout. **bfin-elf-gcc** uses some arch specific options to make linker choose special linker script and start file. Here we care about two options: **-mmulticore** and **mcoreb**. The detailed meaning can be found in [[http://gcc.gnu.org/onlinedocs/gcc/Blackfin-Options.html | GCC manual ]]. To find out the default linker script used:
 <code> <code>
-host:~> bfin-elf-gcc -Wl,--verbose -mcpu=bf561-0.3 -mmulticore -mcoreb test_c.o -o test_c > test_c.map+host:~> bfin-elf-gcc -Wl,--verbose -mcpu=bf561-0.3 -mmulticore -mcoreb test_c.o -o test_c
 GNU ld version 2.17 GNU ld version 2.17
   Supported emulations:   Supported emulations:
Line 75: Line 75:
 === Load a simple C program === === Load a simple C program ===
  
-<source trunk/user/blkfin-apps/corebld/example/test.c c uclinux-dist>+<source trunk/user/blkfin-apps/corebld/example/test_c.c c uclinux-dist>
  
 This can be built using: This can be built using:
Line 88: Line 88:
 [snip] [snip]
 Program Headers: Program Headers:
 +
   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
   LOAD           0x001000 0xff400000 0xff400000 0x00840 0x0089c RW  0x1000   LOAD           0x001000 0xff400000 0xff400000 0x00840 0x0089c RW  0x1000
Line 110: Line 111:
  
 If we are to load a C++ program to coreb:  If we are to load a C++ program to coreb: 
-<source trunk/user/blkfin-apps/corebld/example/test.cpp c uclinux-dist>+<source trunk/user/blkfin-apps/corebld/example/test_cpp.cpp c uclinux-dist>
  
 The default linker script puts everything into L1. However, the binary of test.cpp is too big to fit into L1. We have to customize the linker script, to make use of L2. <code> The default linker script puts everything into L1. However, the binary of test.cpp is too big to fit into L1. We have to customize the linker script, to make use of L2. <code>