Skip to content

Latest commit

 

History

History
267 lines (199 loc) · 12.8 KB

README.md

File metadata and controls

267 lines (199 loc) · 12.8 KB

TQ-MBaX4XxL

Description

This repository contains the Board Support Package (BSP) and further examples for the R5 core(s) present in the TQMa24XxL and TQMa64XxL modules.

Table of Contents

[[TOC]]

Requirements

ATTENTION: Use the exact versions described here unless otherwise indicated by a symbol. Other versions may lead to unexpected behavior.

NOTE: This repository requires the TI toolchain from Code Composer Studio and associated TI tools. Access the API guide from TI for more information on the toolchain.

Hardware Requirements

Hardware Description Pin Reference
Micro USB cable Required for connecting the board to your computer for communication or flashing. X2
XDS110 Used for debugging and programming the board. X47
Personal Computer Required for programming and interacting with the board. -
Power Supply A power supply with a voltage of 24V is required to power the board. X40

NOTE: These requirements are specific to the MBaX4XxL board using the TQMaX4XxL module.

Repository

Here is a short description of all top level dirs and it's content:

Folder Description
application All files relevant for the BSP application.
demo_projects Adapted examples from TI.
sbl Adapted secondary boot loader.
scripts Scripts for automated build tests.
templates Patches and configuration templates.
uniflash The uniflash tool contaning example configurations.

Preparation

Set up Toolchain

  • Download the specified version of Code Composer Studio (CCS).
  • Download the TI MCU-PLUS-SDK-AM64X SDK.
    • NOTE: The recommended installation directory is C:\ti.
  • Install the required tools while setting up the SDK.
  • Patch the toolchain.
  • Import the project:
    • Open CCS.
    • Click File in the upper left corner of the IDE and select Import.
    • Navigate to Code Composer Studio > CCS Projects.
    • Browse to this repository's path on your machine.
    • Select the TQMaX4XxL.MCU.bsp project and click Finish.
      • NOTE: Errors may occur if the C/C++ configuration isn't set yet. Try importing this file under:
        Project -> Properties -> C/C++ General -> Paths and Symbols
    • Right-click on the project in the Project Explorer and select Properties.
    • Verify the requirements under CCS General.
    • You should now be able to build the target.

Building Target

You can build the target by clicking on build when using the CCS-IDE. It is also possible to build a target using CLI using following commands:

cd <project_path>

eclipsec -noSplash -data "<workspace_dir>" -application com.ti.ccstudio.apps.projectCreate -ccs.projectSpec "./TQMaX4XxL.MCU.BSP.projectspec"

eclipsec -noSplash -data "<workspace_dir>" -application com.ti.ccstudio.apps.projectBuild -ccs.workspace

NOTE: The com.ti.ccstudio.apps.projectCreate-command creates a new workspace that imports the projectSpec settings. <workspace_dir> is therefore the location where the new workspace directory shall be placed.
The com.ti.ccstudio.apps.projectBuild-command then builds the target.

Patching

ATTENTION: Ensure all necessary tools are installed.

  • Copy the ccs folder into the Code Composer Studio installation path.
  • Copy the SDK patch into the SDK installation path.
    • NOTE: This adds the qspi patch, DDR-Configuration, and the older version of the sysfw.
  • Rebuild the library following these instructions. Rebuild for both debug and release profiles.
    • Note: Adjust the imports.mak file as necessary if your CCS version differs or if you've installed the tools in a different location. This file is located in the <SDK installation path>.

Debugging and Booting

  • Connect all necessary hardware to your board.
  • Select your project.
  • Set up the target configuration.
  • Choose a boot medium and follow the corresponding instructions.
  • Select the R5 core you wish to use. Reset it.
  • Click on the menu Run in the upper menu bar and click on Load.
  • Browse and run your application.
    • NOTE: For reloading the program, pause the execution and load it again after a CPU reset.
    • NOTE: If you hard reset the board, redo the steps for your booting medium.
  • Only for GP boards:

Setting up Target Configuration

For booting, a target configuration is needed:

  • In the menu bar, go to View > Target Configuration.
  • Right-click on User defined and select New Target Configuration.
  • Name the new configuration, e.g., TQMa64xxL.ccxml or TQMa24xxL.ccxml.
  • Open the target configuration.
    • Select AM64x_TQ or AM243x_TQ depending on your board.
    • NOTE: On the GP board take one of the tagert configurations for the AMx4X_SK board, if DDR initialization does not work.
    • NOTE: If those options aren't available, review the patching steps.

Booting

Booting via JTAG

NOTE: To boot from the internal SRAM, it is necessary to initialize the DMSC and perform the secure boot routine. For further information, read the developers guide offered by TI.

  • Set up the target configuration if not done.

  • Power off the board and set it to NOBOOT mode:

    1 2 3 4
    S4 ON ON OFF ON
    S5 ON ON ON OFF
    S6 OFF ON ON OFF
    S7 ON ON OFF OFF
  • Power on the board, open CCS.

  • Select the user-defined target configuration, right-click on it, and select Launch Target Configuration.

    • ATTENTION: Do this every time before debugging to avoid any confusion or CCS selecting other target configurations.
  • Using the Initialization Script

    • Use the load_dmsc.js or the load_dmsc_hsfs.js script depending on your architecture:
      • Open the Script Console under the View menu and type into the console:

          loadJSfile '<SDK installation path>\\tools\\ccs_load\\gp\\load_dmsc.js'
      • NOTE: Please mind the architecture of your chip. For HS_FS devices, use the load_dmsc_hsfs.js script.

      • The script will wait for an SBL; you can either load one SBL of your choice or skip it by pausing execution.

  • Using SBL_NULL

  • Now you can load a program into the SRAM without using the JS-script.

Booting from Flash

To boot from flash, first load an application into the flash.

  • Power off the board and set it to OSPI BOOT:

    1 2 3 4
    S4 ON ON OFF OFF
    S5 ON ON ON OFF
    S6 OFF ON OFF OFF
    S7 OFF OFF OFF OFF
  • Power on; if the application loaded in the flash is valid, the boot should be complete.

Flashing

Before flashing, follow the instructions on how to initialize the OSPI.

Here are the necessary steps and possibilities listed in order to flash an image into the device's flash.

Set up Terminal

To communicate with the board, connect it to your computer using a USB cable (micro-USB to USB 2.0). Open a terminal application such as "Tera Term" and use the following settings:

Setting Value
Baud Rate 115200 bps
Data Bits 8 bits
Parity None
Stop Bits 1
Flow Control None
New Line Char CR+LF
Local Echo Enabled (Recommended)

Application Note

Second Boot Loader (SBL)

In a nutshell, an SBL is an application like any other that is loaded into address 0x0 of the boot medium. After the primary boot is executed through the ROM code, the R5 executes the SBL to set up the DMSC and peripherals that are absolutely necessary for the application. Further information about the SBL can be found here.

This repository contains modified SBL. The modified SBLs are used for OSPI-Booting and Uniflash on the MBaX4XxL.

Initializing Flash

To flash an image into the flash of the MBax4xXL or to use it, it is first necessary to configure the driver of the OSPI because the hardware only supports QSPI.

  • Patch the OSPI driver and rebuild the library of the SDK.

  • NOTE: Set the hardware's register OSPI_RD_DATA_CAPTURE_REG_ADD = 0x05 before using the OSPI in your code. The register is located at 0x0FC40010. This is already done with the patch in the nor-flash-driver.

    • Example:
        #define OSPI_RD_DATA_CAPTURE_REG_ADD  (0x0FC40010)
        /*...*/
        /* DELAY_FD = 2 and BYPASS_FLD = enable
        * The default DELAY_FD = 4 does not work with QSPI flash, so DELAY_FD = 2 must be used.
        * This has to be implemented while OSPI is idle. The best practice would be to do it after initialization.
        */
        *(uint32_t*) OSPI_RD_DATA_CAPTURE_REG_ADD = 0x05;

Initializing DDR-RAM

  • DDR Initialization should typically be done by the SBL or by your application.

  • If the DDR-RAM was not initialized:

    • Reset the CPU.
    • Select scripts in the scripts menu and click on AMx4_DDR_Initialization_ECC_Disabled.
    • Now the DDR-RAM should be available.

License

For license information, see the license documentation LICENSE.md.