Skip to content

Commit

Permalink
🏁add Cortex-R4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
EDI-Systems committed Mar 21, 2018
1 parent 8bd8e48 commit c411465
Show file tree
Hide file tree
Showing 21 changed files with 614 additions and 7 deletions.
91 changes: 91 additions & 0 deletions MProkaron/Benchmark/Platform/test_TMS570LS0432.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/******************************************************************************
Filename : test_TMS570LC4357.h
Author : pry
Date : 22/07/2017
Licence : LGPL v3+; see COPYING for details.
Description : The testbench for TMS570LC4357.
******************************************************************************/

/* Includes ******************************************************************/
#include "RMP.h"
/* End Includes **************************************************************/

/* Defines *******************************************************************/
/* Where are the initial stacks */
#define THD1_STACK (&Stack_1[215])
#define THD2_STACK (&Stack_2[215])
/* How to read counter */
#define COUNTER_READ() ((rtiREG1->CNT[0].FRCx)<<3)
/* Are we testing the memory pool? */
#define TEST_MEM_POOL 6144
/* Are we doing minimal measurements? */
/* #define MINIMAL_SIZE */
/* The TMS570LS timers are all 32 bits, so */
typedef ptr_t tim_t;
/* End Defines ***************************************************************/

/* Globals *******************************************************************/
#ifndef MINIMAL_SIZE
void Int_Handler(void);
ptr_t Stack_1[256];
ptr_t Stack_2[256];
/* End Globals ***************************************************************/

/* Begin Function:Timer_Init **************************************************
Description : Initialize the timer for timing measurements. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Timer_Init(void)
{
/* RTI/FRC0 clock = 1/8 CPU clock, already initialized. Disable compare 1 */
rtiREG1->INTFLAG = 2U;
}
/* End Function:Timer_Init ***************************************************/

/* Begin Function:Int_Init ****************************************************
Description : Initialize an periodic interrupt source. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Int_Init(void)
{
/* RTI/FRC1 clock = 1/8 CPU clock */
rtiREG1->INTFLAG = 2U;
rtiStopCounter(rtiCOUNTER_BLOCK1);
rtiSetPeriod(rtiCOMPARE1, 4000);
rtiEnableNotification(rtiNOTIFICATION_COMPARE1);
rtiStartCounter(rtiCOUNTER_BLOCK1);
}
volatile int Acc_Count=0;
/* The interrupt handler */
void rtiInterrupt(void)
{
Acc_Count++;
Int_Handler();
}
/* End Function:Int_Init *****************************************************/

/* Begin Function:Int_Disable *************************************************
Description : Disable the periodic interrupt source. This function needs
to be adapted to your specific hardware.
Input : None.
Output : None.
Return : None.
******************************************************************************/
void Int_Disable(void)
{
/* Disable channel 1 interrupt */
rtiDisableNotification(rtiNOTIFICATION_COMPARE1);
rtiStopCounter(rtiCOUNTER_BLOCK1);
}
#endif
/* End Function:Int_Disable **************************************************/

/* End Of File ***************************************************************/

/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/
2 changes: 1 addition & 1 deletion MProkaron/Benchmark/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: The configuration file for testing program.
******************************************************************************/

/* Config Includes ***********************************************************/
#include "Platform/test_STM32F767IG_RVM.h"
#include "Platform/test_TMS570LS0432.h"
/* End Config Includes *******************************************************/

/* End Of File ***************************************************************/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/******************************************************************************
Filename : platform_TMS570LS0432.h
Author : pry
Date : 24/06/2017
Licence : LGPL v3+; see COPYING for details.
Description: The configuration file for TMS570LS0432.
******************************************************************************/

/* Defines *******************************************************************/
/* The HAL library */
#include "sys_common.h"
#include "system.h"
#include "rti.h"
#include "sci.h"

/* The maximum number of preemption priority levels in the system.
* This parameter must be divisible by the word length - 32 is usually sufficient */
#define RMP_MAX_PREEMPT_PRIO 32
/* The maximum number of slices allowed */
#define RMP_MAX_SLICES 100000
/* The maximum number of semaphore counts allowed */
#define RMP_SEM_MAX_NUM 1000
/* Are we using custom hooks? */
#define RMP_USE_HOOKS RMP_FALSE
/* The stzck size of the init thread */
#define RMP_INIT_STACK_SIZE 1024
/* The mask/unmask interrupt operations */
#define RMP_MASK_INT() RMP_Disable_Int()
#define RMP_UNMASK_INT() RMP_Enable_Int()

#define RMP_CRX_SYSTICK_VAL 10000

/* Other low-level initialization stuff - clock and serial */
#define RMP_CRX_LOW_LEVEL_INIT() \
do \
{ \
/* The TI library is in charge of all the initialization of interrupts and clocks */\
rtiInit(); \
rtiSetPeriod(rtiCOMPARE0, RMP_CRX_SYSTICK_VAL); \
rtiEnableNotification(rtiNOTIFICATION_COMPARE0); \
rtiStartCounter(rtiCOUNTER_BLOCK0); \
/* Enable SCI */ \
sciInit(); \
} \
while(0)

/* This is for debugging output */
#define RMP_CRX_PUTCHAR(CHAR) \
do \
{ \
sciSendByte(scilinREG,(CHAR)); \
} \
while(0)
/* End Defines ***************************************************************/

/* End Of File ***************************************************************/

/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/
2 changes: 1 addition & 1 deletion MProkaron/Include/Platform/CortexR/platform_crx_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: The configuration file for Cortex-R HAL.
******************************************************************************/

/* Config Includes ***********************************************************/
#include "Platform/CortexR/Chips/TMS570LC4357/platform_TMS570LC4357.h"
#include "Platform/CortexR/Chips/TMS570LS0432/platform_TMS570LS0432.h"
/* End Config Includes *******************************************************/

/* End Of File ***************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion MProkaron/Include/Platform/RMP_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description : The platform specific types for RMP.
******************************************************************************/

/* Platform Includes *********************************************************/
#include "Platform/CortexM_RVM/platform_cmx_RVM.h"
#include "Platform/CortexR/platform_crx.h"
/* End Platform Includes *****************************************************/

/* End Of File ***************************************************************/
Expand Down
16 changes: 16 additions & 0 deletions Project/CCS-TMS570LS0432PZQQ1/RMP/.ccsproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?ccsproject version="1.0"?>
<projectOptions>
<ccsVersion value="7.4.0"/>
<deviceVariant value="Cortex R.TMS570LC43xx"/>
<deviceFamily value="TMS470"/>
<deviceEndianness value="be32"/>
<codegenToolVersion value="16.9.6.LTS"/>
<isElfFormat value="true"/>
<rts value="libc.a"/>
<createSlaveProjects value=""/>
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate,"/>
<filesToOpen value="main.c,"/>
<isTargetManual value="false"/>
<connection value="common/targetdb/connections/TIXDS100v2_Connection.xml"/>
</projectOptions>
Loading

0 comments on commit c411465

Please sign in to comment.