Skip to content

RTOS - fix Cortex-M version - add macros required for new kernel #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2016
Merged
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
5 changes: 5 additions & 0 deletions libraries/rtos/rtx/TARGET_CORTEX_M/cmsis_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@

#define CMSIS_OS_RTX

// __MBED_CMSIS_RTOS_CM captures our changes to the RTX kernel
#define __MBED_CMSIS_RTOS_CM
// we use __CMSIS_RTOS version, which changes some API in the kernel
#define __CMSIS_RTOS

// The stack space occupied is mainly dependent on the underling C standard library
#if defined(TOOLCHAIN_GCC) || defined(TOOLCHAIN_ARM_STD) || defined(TOOLCHAIN_IAR)
# define WORDS_STACK_SIZE 512
Expand Down
6 changes: 4 additions & 2 deletions libraries/rtos/rtx/TARGET_CORTEX_M/rt_CMSIS.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#error "Missing __CORTEX_Mx definition"
#endif

// This affects cmsis_os only, as it's not used anywhere else. This was left by kernel team
// to suppress the warning in rt_tid2ptcb about incompatible pointer assignment.
#define os_thread_cb OS_TCB

#include "rt_TypeDef.h"
#include "RTX_Config.h"
#include "rt_System.h"
Expand All @@ -62,8 +66,6 @@
#include "rt_Memory.h"
#include "rt_HAL_CM.h"

#define os_thread_cb OS_TCB

#include "cmsis_os.h"

#if (osFeature_Signals != 16)
Expand Down
2 changes: 2 additions & 0 deletions libraries/rtos/rtx/TARGET_CORTEX_M/rt_Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

/* Definitions */

#include "cmsis_os.h"

/* Values for 'state' */
#define INACTIVE 0U
#define READY 1U
Expand Down
1 change: 1 addition & 0 deletions libraries/rtos/rtx/TARGET_CORTEX_M/rt_Timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "RTX_Config.h"
#include "rt_Timer.h"
#include "rt_MemBox.h"
#include "cmsis_os.h"

#ifndef __CMSIS_RTOS

Expand Down
16 changes: 8 additions & 8 deletions workspace_tools/toolchains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ class mbedToolchain:
VERBOSE = True

CORTEX_SYMBOLS = {
"Cortex-M0" : ["__CORTEX_M0", "ARM_MATH_CM0", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M0+": ["__CORTEX_M0PLUS", "ARM_MATH_CM0PLUS", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M1" : ["__CORTEX_M3", "ARM_MATH_CM1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M3" : ["__CORTEX_M3", "ARM_MATH_CM3", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M4" : ["__CORTEX_M4", "ARM_MATH_CM4", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M4F" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M7" : ["__CORTEX_M7", "ARM_MATH_CM7", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M7F" : ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
"Cortex-M0" : ["__CORTEX_M0", "ARM_MATH_CM0"],
"Cortex-M0+": ["__CORTEX_M0PLUS", "ARM_MATH_CM0PLUS"],
"Cortex-M1" : ["__CORTEX_M3", "ARM_MATH_CM1"],
"Cortex-M3" : ["__CORTEX_M3", "ARM_MATH_CM3"],
"Cortex-M4" : ["__CORTEX_M4", "ARM_MATH_CM4"],
"Cortex-M4F" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1"],
"Cortex-M7" : ["__CORTEX_M7", "ARM_MATH_CM7"],
"Cortex-M7F" : ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1"],
"Cortex-A9" : ["__CORTEX_A9", "ARM_MATH_CA9", "__FPU_PRESENT", "__CMSIS_RTOS", "__EVAL", "__MBED_CMSIS_RTOS_CA9"],
}

Expand Down