Using B-core (4) in uClinux for bf561: Writing B-core code

Source: Internet
Author: User
  From the implementation of corebld, we can see that corebld itself does not Code This is similar to running in a core. Program Different. This requires that when compiling a program to be run in the B-core, the linker must set the location of the code of each section in the absolute address space. To achieve this goal, you must specify the location of the target code through the LDs file when writing the B-core program.

The following code is the content in user/blkfin-apps/corebld/coreb. LDS. When linking the B-core program, you can modify the makefile to link the file. Include bf561.lds Phdrs { Text pt_load; Data pt_load; BSS pt_load; } Sections { Entry (start) . = Sizeof_headers; . Text: {. = align (4); * (. Text)}> mem_l1_code_a: Text . Data: {. = align (4); * (. Data)}> mem_l1_data_a: Data . BSS: {. = align (4); * (. BSS) . = Align (4); _ stack_bottom = .; . = 0x1000; _ stack_top = .; }> Mem_l1_data_ B: BSS } For the compilation of the main program, refer to user/blkfin-apps/corebld/coreb. s and modify one of the jump commands as needed: . Global _ real_start; _ Real_start: /* Enable interrupts */ [-- Sp] = reti; R0 = [Sp ++]; /* Disable watchdog */ CMDL = (wdogb_ctl & 0 xFFFF ); Export H = (wdogb_ctl> 16 ); R0 = (0xad <4) | (0x3 <1) (z ); W [P0] = R0; // Insert a jump command here Do_nothing: Idle; Jump do_nothing;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.