From 41b6a39b952b571455dbbd1d88c33a46c69b2ea3 Mon Sep 17 00:00:00 2001
From: EDI Systems <644580703@qq.com>
Date: Thu, 22 Feb 2018 18:27:37 -0500
Subject: [PATCH] cleaned up
---
.../Benchmark/Platform/test_STM32F767IG_RVM.h | 126 +++++++++---------
MProkaron/Benchmark/test.h | 2 +-
.../CortexM_RVM/platform_cmx_RVM_conf.h | 2 +-
MProkaron/Include/Platform/RMP_platform.h | 2 +-
.../RVMDK-STM32F767IGT6-RVM/RMP_platform.h | 15 +++
.../RTOS-Mutate.uvprojx | 6 +-
Project/RVMDK-STM32F767IGT6-RVM/copy.bat | 3 +
.../platform_cmx_RVM_conf.h | 15 +++
Project/RVMDK-STM32F767IGT6-RVM/test.h | 15 +++
9 files changed, 114 insertions(+), 72 deletions(-)
create mode 100644 Project/RVMDK-STM32F767IGT6-RVM/RMP_platform.h
create mode 100644 Project/RVMDK-STM32F767IGT6-RVM/copy.bat
create mode 100644 Project/RVMDK-STM32F767IGT6-RVM/platform_cmx_RVM_conf.h
create mode 100644 Project/RVMDK-STM32F767IGT6-RVM/test.h
diff --git a/MProkaron/Benchmark/Platform/test_STM32F767IG_RVM.h b/MProkaron/Benchmark/Platform/test_STM32F767IG_RVM.h
index cb556377..87131f94 100644
--- a/MProkaron/Benchmark/Platform/test_STM32F767IG_RVM.h
+++ b/MProkaron/Benchmark/Platform/test_STM32F767IG_RVM.h
@@ -1,18 +1,34 @@
-#include "RMP.h"
-
-//#define RUN_IN_VM /* Run this test in RVM virtual machine? */
+/******************************************************************************
+Filename : test_STM32F767IG_RVM.h
+Author : pry
+Date : 22/07/2017
+Licence : LGPL v3+; see COPYING for details.
+Description : The testbench for STM32F767IG, running in the RVM.
+******************************************************************************/
-/* When running these tests, we assume that the counting timer is already enabled */
-#define TEST_YIELD /* Make yield tests */
-#define TEST_MAIL /* Do mailbox tests */
-#define TEST_SEM /* Do semaphore tests */
-#define TEST_MAIL_INT /* Do mailbox interrupt tests */
-#define TEST_SEM_INT /* Do semaphore interrupt tests */
+/* Includes ******************************************************************/
+#include "RMP.h"
+/* End Includes **************************************************************/
+/* Defines *******************************************************************/
/* How to read counter */
-#define COUNTER_READ() (TIM2->CNT)
+#define COUNTER_READ() ((TIM2->CNT)<<1)
+/* Are we doing minimal measurements? */
+/* #define MINIMAL_SIZE */
+/* The STM32F7 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];
+struct RMP_Thd Thd_1={0};
+ptr_t Stack_2[256];
+struct RMP_Thd Thd_2={0};
+struct RMP_Sem Sem_1={0};
-#ifdef RUN_IN_VM
+/* Page table stuff */
const struct RVM_Hdr_Pgtbl RMP_Pgtbl[1]=
{
/* The first page table */
@@ -54,73 +70,51 @@ const struct RVM_Image RMP_Image=
RMP_Pgtbl /* const struct RVM_Hdr_Pgtbl* Pgtbl */,
0 /* const struct RVM_Image* const * const Next_Image; */
};
-#endif
-
-ptr_t Stack_1[256];
-struct RMP_Thd Thd_1={0};
-ptr_t Stack_2[256];
-struct RMP_Thd Thd_2={0};
-struct RMP_Sem Sem_1={0};
-ptr_t Time;
-//TIM_HandleTypeDef TIM2_Handle={0};
-//TIM_HandleTypeDef TIM4_Handle={0};
+/* 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)
{
-// /* Initialize timer 2 to run at the same speed as the CPU */
-// TIM2_Handle.Instance=TIM2;
-// TIM2_Handle.Init.Prescaler=0;
-// TIM2_Handle.Init.CounterMode=TIM_COUNTERMODE_UP;
-// TIM2_Handle.Init.Period=(unsigned int)(-1);
-// TIM2_Handle.Init.ClockDivision=TIM_CLOCKDIVISION_DIV1;
-// HAL_TIM_Base_Init(&TIM2_Handle);
-// __HAL_RCC_TIM2_CLK_ENABLE();
-// __HAL_TIM_ENABLE(&TIM2_Handle);
+ /* Timer is initialized on startup by the M7M1 kernel */
}
+/* 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)
{
-// /* Initialize timer 2 to run at the same speed as the CPU */
-// TIM4_Handle.Instance=TIM4;
-// TIM4_Handle.Init.Prescaler=0;
-// TIM4_Handle.Init.CounterMode=TIM_COUNTERMODE_UP;
-// TIM4_Handle.Init.Period=10000;
-// TIM4_Handle.Init.ClockDivision=TIM_CLOCKDIVISION_DIV1;
-// TIM4_Handle.Init.RepetitionCounter=0;
-// HAL_TIM_Base_Init(&TIM4_Handle);
-// __HAL_RCC_TIM4_CLK_ENABLE();
-// __HAL_TIM_ENABLE(&TIM4_Handle);
-// /* Clear interrupt pending bit, because we used EGR to update the registers */
-// __HAL_TIM_CLEAR_IT(&TIM4_Handle, TIM_IT_UPDATE);
-// HAL_TIM_Base_Start_IT(&TIM4_Handle);
+ /* Interrupt generation is initialized too, here we only register our handler */
+ RMP_Vect[2]=(ptr_t)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 timer 4 interrupt */
- NVIC_DisableIRQ(TIM4_IRQn);
-}
-
-//void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim)
-//{
-// if(htim->Instance==TIM4)
-// {
-// /* Set the interrupt priority */
-// NVIC_SetPriority(TIM4_IRQn,0xFF);
-// /* Enable timer 4 interrupt */
-// NVIC_EnableIRQ(TIM4_IRQn);
-// /* Enable timer 4 clock */
-// __HAL_RCC_TIM4_CLK_ENABLE();
-// }
-//}
-
-void Int_Handler(void);
-
-void TIM4_IRQHandler(void)
-{
- TIM4->SR=~TIM_FLAG_Update;//TIM_FLAG_UPDATE;
- Int_Handler();
+ /* Reverse registration */
+ RMP_Vect[2]=0;
}
+#endif
+/* End Function:Int_Disable **************************************************/
+/* End Of File ***************************************************************/
+/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/
diff --git a/MProkaron/Benchmark/test.h b/MProkaron/Benchmark/test.h
index 8e3e5d18..4f7fea81 100644
--- a/MProkaron/Benchmark/test.h
+++ b/MProkaron/Benchmark/test.h
@@ -7,7 +7,7 @@ Description: The configuration file for testing program.
******************************************************************************/
/* Config Includes ***********************************************************/
-#include "Platform/test_STM32F405RG.h"
+#include "Platform/test_STM32F767IG_RVM.h"
/* End Config Includes *******************************************************/
/* End Of File ***************************************************************/
diff --git a/MProkaron/Include/Platform/CortexM_RVM/platform_cmx_RVM_conf.h b/MProkaron/Include/Platform/CortexM_RVM/platform_cmx_RVM_conf.h
index 4fddb89d..22f38e5a 100644
--- a/MProkaron/Include/Platform/CortexM_RVM/platform_cmx_RVM_conf.h
+++ b/MProkaron/Include/Platform/CortexM_RVM/platform_cmx_RVM_conf.h
@@ -1,5 +1,5 @@
/******************************************************************************
-Filename : platform_cmx_RVM_conf.h
+Filename : platform_cmx_conf.h
Author : pry
Date : 24/06/2017
Licence : LGPL v3+; see COPYING for details.
diff --git a/MProkaron/Include/Platform/RMP_platform.h b/MProkaron/Include/Platform/RMP_platform.h
index bd9d63c9..33fac910 100644
--- a/MProkaron/Include/Platform/RMP_platform.h
+++ b/MProkaron/Include/Platform/RMP_platform.h
@@ -7,7 +7,7 @@ Description : The platform specific types for RMP.
******************************************************************************/
/* Platform Includes *********************************************************/
-#include "Platform/CortexM/platform_cmx.h"
+#include "Platform/CortexM_RVM/platform_cmx_RVM.h"
/* End Platform Includes *****************************************************/
/* End Of File ***************************************************************/
diff --git a/Project/RVMDK-STM32F767IGT6-RVM/RMP_platform.h b/Project/RVMDK-STM32F767IGT6-RVM/RMP_platform.h
new file mode 100644
index 00000000..33fac910
--- /dev/null
+++ b/Project/RVMDK-STM32F767IGT6-RVM/RMP_platform.h
@@ -0,0 +1,15 @@
+/******************************************************************************
+Filename : RMP_platform.h
+Author : pry
+Date : 22/07/2017
+Licence : LGPL v3+; see COPYING for details.
+Description : The platform specific types for RMP.
+******************************************************************************/
+
+/* Platform Includes *********************************************************/
+#include "Platform/CortexM_RVM/platform_cmx_RVM.h"
+/* End Platform Includes *****************************************************/
+
+/* End Of File ***************************************************************/
+
+/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/
diff --git a/Project/RVMDK-STM32F767IGT6-RVM/RTOS-Mutate.uvprojx b/Project/RVMDK-STM32F767IGT6-RVM/RTOS-Mutate.uvprojx
index 32517469..95e0e64f 100644
--- a/Project/RVMDK-STM32F767IGT6-RVM/RTOS-Mutate.uvprojx
+++ b/Project/RVMDK-STM32F767IGT6-RVM/RTOS-Mutate.uvprojx
@@ -69,9 +69,9 @@
0
- 0
+ 1
0
-
+ copy.bat
0
0
@@ -334,7 +334,7 @@
STM32F767xx,USE_HAL_DRIVER
- ..\..\MProkaron\Include;..\..\..\..\Library\STM32F7xx_HAL_Driver\Core;..\..\..\..\Library\STM32F7xx_HAL_Driver\Inc;..\..\..\..\Library\STM32F7xx_HAL_Driver\Inc\Conf
+ ..\..\MProkaron\Include;..\..\..\M0P0_Library\STM32F7xx_HAL_Driver\Core;..\..\..\M0P0_Library\STM32F7xx_HAL_Driver\Inc;..\..\..\M0P0_Library\STM32F7xx_HAL_Driver\Inc\Conf
diff --git a/Project/RVMDK-STM32F767IGT6-RVM/copy.bat b/Project/RVMDK-STM32F767IGT6-RVM/copy.bat
new file mode 100644
index 00000000..228bed2f
--- /dev/null
+++ b/Project/RVMDK-STM32F767IGT6-RVM/copy.bat
@@ -0,0 +1,3 @@
+copy platform_cmx_RVM_conf.h ..\..\MProkaron\Include\Platform\CortexM_RVM\platform_cmx_RVM_conf.h
+copy RMP_platform.h ..\..\MProkaron\Include\Platform\RMP_platform.h
+copy test.h ..\..\MProkaron\Benchmark\test.h
\ No newline at end of file
diff --git a/Project/RVMDK-STM32F767IGT6-RVM/platform_cmx_RVM_conf.h b/Project/RVMDK-STM32F767IGT6-RVM/platform_cmx_RVM_conf.h
new file mode 100644
index 00000000..22f38e5a
--- /dev/null
+++ b/Project/RVMDK-STM32F767IGT6-RVM/platform_cmx_RVM_conf.h
@@ -0,0 +1,15 @@
+/******************************************************************************
+Filename : platform_cmx_conf.h
+Author : pry
+Date : 24/06/2017
+Licence : LGPL v3+; see COPYING for details.
+Description: The configuration file for Cortex-M HAL.
+******************************************************************************/
+
+/* Config Includes ***********************************************************/
+#include "Platform/CortexM_RVM/Chips/STM32F767IG/platform_STM32F767IG_RVM.h"
+/* End Config Includes *******************************************************/
+
+/* End Of File ***************************************************************/
+
+/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/
diff --git a/Project/RVMDK-STM32F767IGT6-RVM/test.h b/Project/RVMDK-STM32F767IGT6-RVM/test.h
new file mode 100644
index 00000000..4f7fea81
--- /dev/null
+++ b/Project/RVMDK-STM32F767IGT6-RVM/test.h
@@ -0,0 +1,15 @@
+/******************************************************************************
+Filename : test.h
+Author : pry
+Date : 24/06/2017
+Licence : LGPL v3+; see COPYING for details.
+Description: The configuration file for testing program.
+******************************************************************************/
+
+/* Config Includes ***********************************************************/
+#include "Platform/test_STM32F767IG_RVM.h"
+/* End Config Includes *******************************************************/
+
+/* End Of File ***************************************************************/
+
+/* Copyright (C) Evo-Devo Instrum. All rights reserved ***********************/