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] Sitara AM263x/AM273x MCAL - Getting Started Guide

Part Number: AM2634
Other Parts Discussed in Thread: UNIFLASH

This FAQ aims to address the following Questions:

  • How should MCAL package,  FMEDA and other Safety related documents be requested for Sitara MCU+ devices (AM263x, AM273x)?
  • What is the folder structure of MCAL package and how should we compile a simple MCAL application?
  • How to use EB Tresos to generate the Configuration files?
  • How to add custom EB Tresos or Vector DE configuration generated files to MCAL projects?
  • How to create Multicore appimage with MCAL binary and rest of the cores to include SDK generated binaries?
  • How to debug MCAL generated binaries on the Evaluation kit or Custom board using CCS Studio?
  • Where to find more details about Compiler qualification and tools?
  • How should MCAL package,  FMEDA and other Safety related documents be requested for Sitara MCU+ devices (AM63x, AM273x)? Should the user pay for getting the MCAL drivers?

    All safety related documents for the Sitara MCU+ devices can be requested from the below links

    https://www.ti.com/licreg/docs/swlicexportcontrol.tsp?form_id=339047&prod_no=PROCESSOR-SDK-MCAL-EB-TRESOS&ref_url=EP-Proc-Sitara-MPU

    There is no cost associated in receiving the MCAL drivers AT THE MOMENT .

    What is the folder structure of MCAL package and how should we compile a simple MCAL application?

    The folder structure of MCAL is very intuitive. The MCAL package has 

    Directory Name
    Description
    Build   Holds all the top-level makefiles, bootimage generation scripts. (This folder is only present in the AM263x MCAL package)

    mcal

    Contains driver files, examples codes and example project's EB tresos configurations

    mcal_config

    Contains template files for GUI tools i.e., XDM, arxml and Generated Configuration files

    mcal_docs

    User guides for MCAL Modules

    Update the "Rules.make" file with the appropriate paths to the CCS Studio and the compiler tool chain paths as shown below



    To compile AM263x - Open a command prompt inside the "build" folder and run the following commands.

    To compile for AM273x - Use the same commands BUT inside the "mcal" folder.

    gmake -s all                /*To compile all modules*/
    gmake -s <moduleName>_app   /*To compile pwm example code use gmake -s pwm_app */
    gmake -s allclean           /*To clean the binary folder where the executables are created*/

    Once the compilation is completed, the executable or ".out" which can be used to load into the MCU is present under the "mcal\binary\<module_name>_app\bin\am263" directory.

    How to use EB Tresos to generate the Configuration files?

    To use the MCAL plugins from the TI's package, user must have a User license for the EB tresos. If it is not available, user can request it by sending a mail request to this ID eb_tresos_license_approvals@list.ti.com. (Please note that the licenses are distributed/shared ONLY after performing due diligence on the customer)

    Once the user is equipped with the license follow the below steps to create a new MCAL project for the SoC in the GUI tool.

    1. Copy all the folders under the directory mcal_config and paste them in the EB tresos's plugins folder. Do not delete any existing .jar or java files present in the plugins folder of EB Tresos, paste in this folder as is.



    2. Once the contents are copied, launch the EB tresos and Click on "File → Configuration Project" then enter the project name and ECU ID as AM263x, Target as ARM/AM263x as shown below



    3. Then select all the modules the user needs to add to the project, by selecting and clicking on the   button as shown below and Click on "Finish"to create the project.


    4. Double click on the Module to open the detailed configurations for the module, once all the options are selected Right click on the project name, select "Verify Project" and "Generate Project" to generate all the header files and configuration source files which are stored under the output folder. All the compiler related macros, pointers to the configuration structures etc., are present in the header files present in the include, and the structure definitions used by the application or driver are generated in the files under the src  folder (Cfg.c, PBCfg.c and LCfg.c extensions)



    How to add custom EB Tresos or Vector DE configuration generated files to MCAL projects?

    The files generated in the previous section are present in the "workspace → <project_name> → output → Include/src". Copy these files and place them in the respective module's include and src folders inside the
    "examples_config\<module_name>_Demo_Cfg\soc\am263\r5f0_0\" 



    This will update the configurations used by MCAL example codes and driver with the files generated by user through EB Tresos and any application compiled moving forward will use these updated files.

    How to create Multicore appimage with MCAL binary and rest of the cores to include SDK generated binaries?

    The current outputs after compilation of an example app also generates an multi-core appimage that can be loaded onto the QSPI flash and the SBL can boot it as a normal application. However, currently the appimage generated consists only the R50_0 core's application data and the other cores are not present. To add them, please use the below script and pass the paths to the .rprc files generated from the MCU+SDK examples from the CCS Studio compilation.

    There is a Readme.txt present in the below zip file which has all the data to get the script running and an example showing how to run the script. It majorly expects the name of the output file and Extension of the output file i.e., this script accepts both ".xer5f (MCAL generated binaries)" and ".out (MCU+SDK generated binaries)" or any other elf format extensions. 

    To know more about how to flash the SBL and the appimage into the MCU, please refer to either of these documentations
    UART UNIFLASH - https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/TOOLS_FLASH.html#TOOLS_FLASH_UART_UNIFLASH
    JTAG UNIFLASH - https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/EXAMPLES_DRIVERS_SBL_JTAG_UNIFLASH.html

    Sample output from the script is shown below.

     

    5670.bootimage_gen_script.7z

    How to debug MCAL generated binaries on the Evaluation kit or Custom board using CCS Studio?

    The process of loading, Debugging the MCAL binaries is exactly same as how the .out's generated through the MCU+SDK too. The first step is to create and launch a target configuration in the CCS Studio. More details on how to create a target configuration and setting up CCS studio are detailed in this link https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/CCS_SETUP_PAGE.html 

    The executable extension for the MCAL applications are named with ".xer5f" which expands to "Executable for R5F CPU's". This is also an Executable and Loadable format like *.out file in MCU_PLUS_SDK. For more information on this format - https://en.wikipedia.org/wiki/Executable_and_Linkable_Format



    Where to find more details about Compiler qualification and tools?

    All the details regarding this Compiler qualification kit - https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_safeTI-compiler-qkit.html