This repository contains the Board Support Package (BSP) and further examples for the R5 core(s) present in the TQMa24XxL and TQMa64XxL modules.
[[TOC]]
ATTENTION: Use the exact versions described here unless otherwise indicated by a symbol. Other versions may lead to unexpected behavior.
- TI Code Composer Studio: v12.5.0^
- TI MCU-PLUS-SDK-AM64X: v09.01.00.41
- TI SysConfig: v1.18.0
- TI Clang: v3.2.0.LTS (Included with Code Composer Studio).
- Python: v3.10.4^
- Patch
- The patch also requires:
- gcc-arm-7-2017q4
- gcc-arm-aarch64-none-eabi
- ATTENTION: Both need to be installed in your TI-directory (e.g. "C/ti/").
- The patch also requires:
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 | 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.
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. |
- 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
.
- NOTE: The recommended installation directory is
- 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 selectImport
. - Navigate to
Code Composer Studio
>CCS Projects
. - Browse to this repository's path on your machine.
- Select the
TQMaX4XxL.MCU.bsp
project and clickFinish
.- 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
- NOTE: Errors may occur if the C/C++ configuration isn't set yet. Try importing this
file under:
- 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.
- Open
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.
ATTENTION: Ensure all necessary tools are installed.
- Copy the ccs folder into the
Code Composer Studio
installation path.- NOTE: This step integrates the appropriate target configuration.
- Copy the SDK patch into the SDK installation path.
- NOTE: This adds the
qspi patch
,DDR-Configuration
, and the older version of thesysfw
.
- NOTE: This adds the
- Rebuild the library following these instructions.
Rebuild for both debug and release profiles.
- Note: Adjust the
imports.mak
file as necessary if yourCCS
version differs or if you've installed the tools in a different location. This file is located in the<SDK installation path>
.
- Note: Adjust the
- 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 onLoad
. - 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:
- Follow the steps for DDR-Initialization if you wish to use the lpddr.
For booting, a target configuration
is needed:
- In the menu bar, go to
View
>Target Configuration
. - Right-click on
User defined
and selectNew Target Configuration
. - Name the new configuration, e.g.,
TQMa64xxL.ccxml
orTQMa24xxL.ccxml
. - Open the target configuration.
- Select
AM64x_TQ
orAM243x_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.
- Select
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 theload_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.
-
- Use the
-
Using SBL_NULL
- Alternatively, you can also load the sbl_null image into the flash:
- Flash the sbl_null image.
- Use the
tq_sbl_null.cfg
. - Boot.
- Use the
- Flash the sbl_null image.
- Alternatively, you can also load the sbl_null image into the flash:
-
Now you can load a program into the SRAM without using the JS-script.
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.
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.
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) |
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.
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.
-
NOTE: Set the hardware's register
OSPI_RD_DATA_CAPTURE_REG_ADD = 0x05
before using the OSPI in your code. The register is located at0x0FC40010
. 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;
-
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 onAMx4_DDR_Initialization_ECC_Disabled
. - Now the DDR-RAM should be available.
For license information, see the license documentation LICENSE.md.