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.

FAQ: How do I create a CCS project for AM335x/AM437x bare-metal (no SYS/BIOS) application based on the PDK?

Other Parts Discussed in Thread: AM3359, TEST

I'm developing a bare-metal (no SYS/BIOS or TI-ROTS) application based on the AM335x/AM437x PDK. How can I get started with a CCS project?

  • Steps below describe how to create a CCS project for bare-metal application based on AM335x/AM437x PDK from scratch.

    1. Assuming you already have an EVM board, the first step is to create a blank CCS project for your board using the CCS project wizard. Go to CCS > File > New > Project > CCS Project, then click Next.

    2. Fill in the necessary fields for the new project:

    • This example uses ICE_AM3359 EVM for testing.
    • For compiler version, choose GNU 7.2.1 (linaro) which is used by PDK 1.0.17.
    • Click “Finish” and the project should be created.

    3. Add PDK product to the project, assuming PDK has been installed to CCS. Go to Project Properties -> General -> Products and click Add… Choose am335x PDK and version 1.0.17.

    4. Add PDK to compiler include path. Go to Project Properties -> Build -> GNU Compiler -> Directories. Choose ${COM_TI_PDK_INCLUDE_PATH} and click edit (this variable is used by BIOS configuration and needs to be modified for bare-metal project).

    Then click “Variables…” and find COM_TI_PDK_INSTALL_DIR and click ok. Then add “\packages” after ${ COM_TI_PDK_INSTALL_DIR}. That's the base for all PDK header include paths.

    5. Add PDK libraries to linker search path. Go to Project Properties -> Build -> GNU Linker -> Libraries. Remove what’s there already: ${COM_TI_PDK_LIBRARIES} and ${COM_TI_PDK_LIBRARY_PATH} which are used for BIOS based project. Then add libraries that’re needed by the application. 

    In this example, we would need uart, csl, osal, board, gpio. Even though i2c is not needed by the example, it is needed by board, so we need to add i2c as well. Please note that for osal, we need to use ti\osal\lib\nonos\am335x\a8\release instead of ti\osal\lib\nonos\a8\release.

    6. Use hard floating point ABI to compile the code because PDK libraries use that. Also specify floating point format to vfpv3-d16 which is for ARM v7 architecture. 

    7. Add SOC_AM335x to compiler symbols. This symbol is needed by PDK header files.

    8. Add Board_init() to main(). This requires the application to provide UART configuration. We’ll just use an example configuration from the PDK, pdk_am335x_1_0_17\packages\ti\drv\uart\soc\am335x\UART_soc.c, and add it to the project.

    9. Add GPIO configuration for the application to use GPIO. We’ll just use an example configuration from the PDK, pdk_am335x_1_0_17\packages\ti\drv\gpio\soc\am335x\GPIO_soc.c and pdk_am335x_1_0_17\packages\ti\drv\gpio\test\led_blink\src\am335x\GPIO_icev2AM335x_board.c. Add these two source files to the project.

    10. Add GPIO_init(), GPIO_wrtie(), GPIO_toggle, etc to main. Add a simple while(1) loop to toggle an LED.

    5516.Blink_LED_baremetal.zip Attached is the complete CCS project for reference. It has a pre-built executable Debug\Blink_LED_baremetal.out which can be loaded to and run on the AM3359 ICE V2 EVM. When it runs, the Ethernet LED D1 on the board will blink.