BIOS MCSDK 2.0 Learning Note (ii) ———— to create a project using the Platform library

Source: Internet
Author: User

The Platform library provides a set of API functions for development boards. We can use it to quickly start the Development Board.

  1. Start CCS and build an empty project
  2. Add the Include path: "C:\Program files\texas instruments\pdk_c### #_1_0_0_xx \packages", added as shown:
  3. Add the following link libraries to the file Search Path in the C6000 Linker section:
    1. "C:\ti\pdk_c667x_2_0_3\packages\ti\platform\evmc6678l\platform_lib\lib\debug\ti.platform.evm6678l.ae66"
    2. "C:\ti\pdk_c667x_2_0_3\packages\ti\csl\lib\c6678\c66\release\ti.csl.ae66"
    3. "C:\ti\pdk_c667x_2_0_3\packages\ti\csl\lib\c6678\c66\release\ti.csl.intc.ae66"
  4. Specify a lookup path for the library:
    1. "C:\ti\pdk_c667x_2_0_3\packages\ti\csl\lib\c6678\c66\release"
    2. "C:\ti\pdk_c667x_2_0_3\packages\ti\platform\evmc6678l\platform_lib\lib\debug"

  5. Open project->properties, options->predefined Symbol in build->c6000 compiler->advanced Add soc_c6678 in
  6. Write the code, here to the LED_PLAY.C code in MCSDK,Note: The Osal functions for Platform Library in the code is not commented out! (Osal_platformmalloc and other functions are used in the platform.c of Platform_lib, but there is no implementation in Lib engineering, so it can be implemented in engineering.) Otherwise, the function is not defined when linker, and the implementation and declaration are placed in Lib to generate Lib. )
    #include <cerrno>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "ti\platform\platform.h"#include "Ti\platform\resource_mgr.h"/* Osal functions for Platform Library */uint8_t*osal_platformmalloc(uint32_t num_bytes,uint32_t Alignment){ReturnMalloc(num_bytes);}void Osal_platformfree(uint8_t*dataptr,uint32_t num_bytes){/* Free up the memory */If(dataptr){Free(dataptr);}}void Osal_platformspicsenter(void){/* Get the hardware semaphore. * * Acquire Multi Core CPPI synchronization Lock * *While((Csl_semacquiredirect(Platform_spi_hw_sem))==0);Return;}void Osal_platformspicsexit(void){/* Release the hardware semaphore * * Release multi-core lock. */Csl_semreleasesemaphore(Platform_spi_hw_sem);Return;}void Main(void){Platform_init_flags Init_flags; Platform_init_config Init_config; Platform_info P_info;uint32_t Led_no=0;Char message[]="\ r\nhello world .....\ r\ n ";uint32_t length=Strlen((Char*) message);uint32_t I;/* Initialize platform with default values */Memset(&init_flags,0x01,sizeof(Platform_init_flags));Memset(&init_config,0,sizeof(Platform_init_config));If(Platform_init(&init_flags,&init_config)! = Platform_eok){Return;} platform_uart_init(); Platform_uart_set_baudrate(115200); Platform_get_info(&p_info);/* Write to the UART */For(I=0; I< length; I++){If(Platform_uart_write(Message[I])! = Platform_eok){Return;}}/* Play Forever */While (1) {platform_led (LED _no)  (30000 =  (++led_no) % p_info. Led[platform_user_led_class]. Count}}            /span>                
  7. Add linker command Script. The linker command script defines the memory map for the platform (where internal, shared and external memory start, etc.) And where we want our code and data sections to be placed. We is going to put them in the shared memory region on the processor.
    1. Select file->new->file from Template, enter the File Name as XXXX. Cmd and hit finish.
    2. Paste following linker command file in the editor
      -C-heap0x41000-Stack0xa000/* Memory Map*/memory{L1psram(RWX): org =0x0e00000, Len =0x7FFF L1dsram(RWX): org =0x0f00000, Len =0x7FFF L2sram(RWX): org =0x0800000, Len =0x080000 Msmcsram(RWX): org =0xc000000, Len =0x200000 DDR3(RWX): org =0x80000000, Len =0x10000000} sections{.csl_vect > Msmcsram .text > Msmcsram group  (NEAR_DP  {.neardata .rodata  "load > Msmcsram . Stack > Msmcsram .cinit > Msmcsram .cio > Msmcsram .data > Msmcsram .switch > Msmcsram .far > Msmcsram .testmem > Msmcsram }        
  8. Compile...

BIOS MCSDK 2.0 Learning Note (ii) ———— to create a project using the Platform library

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.