Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .metadata/.tirex/am62ax.content.tirex.json
Original file line number Diff line number Diff line change
Expand Up @@ -6557,6 +6557,72 @@
]
]
},
{
"resourceType": "project.ccs",
"resourceClass": [
"example"
],
"resourceSubClass": [
"example.gettingstarted"
],
"description": "A simple ThreadX hello world example. CPU is A53SS0-0 running THREADX-SMP.",
"name": "threadx_hello_world",
"location": "../../examples/kernel/threadx/hello_world/am62ax-sk/a53ss0-0_threadx-smp/gcc-aarch64/example.projectspec",
"devtools": [
"SK-AM62A-LP"
],
"kernel": [
"threadx-smp"
],
"compiler": [
"gcc"
],
"subCategories": [
"kernel",
"threadx",
"hello_world",
"a53ss0-0_threadx-smp"
],
"mainCategories": [
[
"Examples",
"Development Tools"
]
]
},
{
"resourceType": "project.ccs",
"resourceClass": [
"example"
],
"resourceSubClass": [
"example.gettingstarted"
],
"description": "ThreadX task switching example. CPU is A53SS0-0 running THREADX-SMP.",
"name": "threadx_task_switch",
"location": "../../examples/kernel/threadx/task_switch/am62ax-sk/a53ss0-0_threadx-smp/gcc-aarch64/example.projectspec",
"devtools": [
"SK-AM62A-LP"
],
"kernel": [
"threadx-smp"
],
"compiler": [
"gcc"
],
"subCategories": [
"kernel",
"threadx",
"task_switch",
"a53ss0-0_threadx-smp"
],
"mainCategories": [
[
"Examples",
"Development Tools"
]
]
},
{
"resourceType": "project.ccs",
"resourceClass": [
Expand Down
121 changes: 121 additions & 0 deletions .project/templates/am62ax/threadx/main_threadx_smp.c.xdt
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
%%{
let options = args.options;
let stackSize = 8192;
let taskPri = 4;
let entryFunction = "example_main";

if(options && options.entryFunction)
entryFunction = options.entryFunction;
if(options && options.stackSize)
stackSize = options.stackSize;
if(options && options.taskPri)
taskPri = options.taskPri;

%%}
/*
* Copyright (C) 2018-2024 Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdlib.h>
#include <kernel/dpl/DebugP.h>
#include "ti_drivers_config.h"
#include "ti_board_config.h"
#include "ti_drivers_open_close.h"
#include "ti_board_open_close.h"
#include <tx_api.h>
#include <tx_thread.h>

#define MAIN_TASK_PRI (`taskPri`)

#define MAIN_TASK_STACK_SIZE (`stackSize`U)

uint8_t main_thread_stack[MAIN_TASK_STACK_SIZE] __attribute__((aligned(32)));

TX_THREAD main_thread;

void `entryFunction`(ULONG arg);

void threadx_main(ULONG arg)
{
int32_t status = SystemP_SUCCESS;

/* Open drivers */
Drivers_open();
/* Open flash and board drivers */
status = Board_driversOpen();
DebugP_assert(status==SystemP_SUCCESS);

`entryFunction`(arg);

/* Close board and flash drivers */
Board_driversClose();
/* Close drivers */
Drivers_close();
}

int main(void)
{
/* init SOC specific modules */
System_init();
Board_init();

/* Enter the ThreadX kernel. */
if (0 == Armv8_getCoreId())
{
tx_kernel_enter();
} else {
/* Other cores wait for primary core to finish initialization. */
_tx_thread_smp_initialize_wait();
for(;;) {}
}

}

void tx_application_define(void *first_unused_memory)
{
UINT status;


status = tx_thread_create(&main_thread, /* Pointer to the main thread object. */
"main_thread", /* Name of the task for debugging purposes. */
threadx_main, /* Entry function for the main thread. */
0, /* Arguments passed to the entry function. */
main_thread_stack, /* Main thread stack. */
MAIN_TASK_STACK_SIZE, /* Main thread stack size in bytes. */
MAIN_TASK_PRI, /* Main task priority. */
MAIN_TASK_PRI, /* Highest priority level of disabled preemption. */
TX_NO_TIME_SLICE, /* No time slice. */
TX_AUTO_START); /* Start immediately. */

DebugP_assertNoLog(status == TX_SUCCESS);

}

45 changes: 45 additions & 0 deletions examples/kernel/threadx/hello_world/.project/project_am62ax.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ const includes_a53 = {
],
};

const includes_a53_smp = {
common: [
"${MCU_PLUS_SDK_PATH}/source/kernel/threadx/threadx_src/common_smp/inc",
"${MCU_PLUS_SDK_PATH}/source/kernel/threadx/ports/ti_arm_gcc_clang_cortex_a53_smp/inc",
],
};

const libdirs = {
common: [
"${MCU_PLUS_SDK_PATH}/source/kernel/threadx/lib",
Expand Down Expand Up @@ -101,12 +108,26 @@ const libs_a53 = {
],
};

const libs_a53_smp = {
common: [
"threadx.am62ax.a53-smp.gcc-aarch64.${ConfigName}.lib",
"drivers.am62ax.a53.gcc-aarch64.${ConfigName}.lib",
],
};

const lnkfiles = {
common: [
"linker.cmd",
]
};

const defines_a53_smp = {
common: [
"SMP_FREERTOS",
"SMP_QUADCORE_FREERTOS",
],
};

const syscfgfile = "../example.syscfg";

const readmeDoxygenPageTag = "EXAMPLES_ECLIPSE_THREADX_THREADX_HELLO_WORLD";
Expand Down Expand Up @@ -182,11 +203,28 @@ const templates_a53 =
},
];


const templates_a53_smp =
[
{
input: ".project/templates/am62ax/common/linker_a53_smp.cmd.xdt",
output: "linker.cmd",
},
{
input: ".project/templates/am62ax/threadx/main_threadx_smp.c.xdt",
output: "../main.c",
options: {
entryFunction: "threadx_hello_world_main",
},
},
];

const buildOptionCombos = [
{ device: device, cpu: "mcu-r5fss0-0", cgt: "ti-arm-clang", board: "am62ax-sk", os: "threadx"},
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am62ax-sk", os: "threadx"},
{ device: device, cpu: "c75ss0-0", cgt: "ti-c7000", board: "am62ax-sk", os: "threadx"},
{ device: device, cpu: "a53ss0-0", cgt: "gcc-aarch64", board: "am62ax-sk", os: "threadx"},
{ device: device, cpu: "a53ss0-0", cgt: "gcc-aarch64", board: "am62ax-sk", os: "threadx-smp"},
];

function getComponentProperty() {
Expand Down Expand Up @@ -233,6 +271,13 @@ function getComponentBuildProperty(buildOption) {
build_property.includes = includes_a53;
build_property.templates = templates_a53;
build_property.libs = libs_a53;
if(buildOption.os.match("threadx-smp"))
{
build_property.templates = templates_a53_smp;
build_property.includes = includes_a53_smp;
build_property.libs = libs_a53_smp;
build_property.defines = defines_a53_smp;
}
}

return build_property;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "AM62Ax" --package "AMB" --part "Default" --context "a53ss0-0" --product "[email protected]"
* @versions {"tool":"1.18.0+3266"}
*/

/**
* Import the modules used in this configuration.
*/
const debug_log = scripting.addModule("/kernel/dpl/debug_log");
const mmu_armv8 = scripting.addModule("/kernel/dpl/mmu_armv8", {}, false);
const mmu_armv81 = mmu_armv8.addInstance();
const mmu_armv82 = mmu_armv8.addInstance();
const mmu_armv83 = mmu_armv8.addInstance();

/**
* Write custom configuration values to the imported modules.
*/
debug_log.enableCssLog = false;
debug_log.enableUartLog = true;
debug_log.uartTrace = true;
debug_log.uartLog.$name = "CONFIG_UART_CONSOLE";
debug_log.uartLog.UART.$assign = "USART0";

mmu_armv81.size = 0x80000000;
mmu_armv81.$name = "SOC_MEM_REGION";

mmu_armv82.vAddr = 0x70000000;
mmu_armv82.pAddr = 0x70000000;
mmu_armv82.size = 0x200000;
mmu_armv82.attribute = "MAIR7";
mmu_armv82.$name = "SHM_MEM_REGION";

mmu_armv83.vAddr = 0x80000000;
mmu_armv83.pAddr = 0x80000000;
mmu_armv83.size = 0x80000000;
mmu_armv83.attribute = "MAIR7";
mmu_armv83.$name = "DDR_REGION";

/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD";
debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD";
Loading