Modified by Osama Ashaikh

Fork of mbed-rtos by mbed official

Files at this revision

API Documentation at this revision

Comitter:
<>
Date:
Thu Sep 01 15:13:42 2016 +0100
Parent:
120:4dc938e301cc
Commit message:
RTOS rev121

Compatible with the mbed library v125

Changes:
- K64F: Revert to hardcoded stack pointer in RTX.
- Adding NCS36510 support.
- Add MAX32620 target support.
- Fix implicit declaration of function 'atexit'.

Changed in this revision

rtx/TARGET_ARM7/RTX_CM_lib.h Show annotated file Show diff for this revision Revisions of this file
rtx/TARGET_CORTEX_A/RTX_CM_lib.h Show annotated file Show diff for this revision Revisions of this file
rtx/TARGET_CORTEX_M/RTX_CM_lib.h Show annotated file Show diff for this revision Revisions of this file
rtx/TARGET_CORTEX_M/RTX_Conf_CM.c Show annotated file Show diff for this revision Revisions of this file
diff -r 4dc938e301cc -r 3da5f554d8bf rtx/TARGET_ARM7/RTX_CM_lib.h
--- a/rtx/TARGET_ARM7/RTX_CM_lib.h	Thu Aug 18 14:38:56 2016 +0100
+++ b/rtx/TARGET_ARM7/RTX_CM_lib.h	Thu Sep 01 15:13:42 2016 +0100
@@ -329,6 +329,7 @@
 
 #elif defined (__GNUC__)
 
+extern int atexit(void (*func)(void));
 extern void __libc_fini_array(void);
 extern void __libc_init_array (void);
 extern int main(int argc, char **argv);
diff -r 4dc938e301cc -r 3da5f554d8bf rtx/TARGET_CORTEX_A/RTX_CM_lib.h
--- a/rtx/TARGET_CORTEX_A/RTX_CM_lib.h	Thu Aug 18 14:38:56 2016 +0100
+++ b/rtx/TARGET_CORTEX_A/RTX_CM_lib.h	Thu Sep 01 15:13:42 2016 +0100
@@ -485,6 +485,7 @@
 #endif
 
 #elif defined (__GNUC__)
+extern int atexit(void (*func)(void));
 extern void __libc_fini_array(void);
 extern void __libc_init_array (void);
 extern int main(int argc, char **argv);
diff -r 4dc938e301cc -r 3da5f554d8bf rtx/TARGET_CORTEX_M/RTX_CM_lib.h
--- a/rtx/TARGET_CORTEX_M/RTX_CM_lib.h	Thu Aug 18 14:38:56 2016 +0100
+++ b/rtx/TARGET_CORTEX_M/RTX_CM_lib.h	Thu Sep 01 15:13:42 2016 +0100
@@ -351,7 +351,8 @@
 /* Main Thread definition */
 extern void pre_main (void);
 
-#if defined(TARGET_MCU_NRF51822) || defined(TARGET_MCU_NRF52832)
+#if defined(TARGET_MCU_NRF51822) || defined(TARGET_MCU_NRF52832) || defined (TARGET_STM32F334R8) ||\
+    defined(TARGET_STM32F302R8) || defined(TARGET_STM32F303K8) || defined (TARGET_STM32F334C8)
 static uint32_t thread_stack_main[DEFAULT_STACK_SIZE / sizeof(uint32_t)];
 #else
 static uint32_t thread_stack_main[DEFAULT_STACK_SIZE * 2 / sizeof(uint32_t)];
@@ -420,12 +421,8 @@
 #define INITIAL_SP            (0x20003000UL)
 
 #elif defined(TARGET_K64F)
-#if defined(__GNUC__) && !defined(__CC_ARM)     /* GCC */
-extern uint32_t __StackTop[];
-#define INITIAL_SP            (__StackTop)
-#else
 #define INITIAL_SP            (0x20030000UL)
-#endif
+
 #if defined(__CC_ARM) || defined(__GNUC__)
 #define ISR_STACK_SIZE        (0x1000)
 #endif
@@ -523,7 +520,7 @@
 #elif (defined(TARGET_STM32F746NG) || defined(TARGET_STM32F746ZG))
 #define INITIAL_SP            (0x20050000UL)
 
-#elif defined(TARGET_MAX32610) || defined(TARGET_MAX32600)
+#elif defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_MAX32620)
 #define INITIAL_SP            (0x20008000UL)
 
 #elif defined(TARGET_TEENSY3_1)
@@ -602,6 +599,9 @@
 #error "no toolchain defined"
 #   endif
 
+#elif defined(TARGET_NCS36510)
+#define INITIAL_SP            (0x40000000UL)
+
 #else
 #error "no target defined"
 
@@ -789,6 +789,7 @@
 osMutexDef(env_mutex);
 static osMutexId env_mutex_id;
 
+extern int atexit(void (*func)(void));
 extern void __libc_fini_array(void);
 extern void __libc_init_array (void);
 extern int main(int argc, char **argv);
diff -r 4dc938e301cc -r 3da5f554d8bf rtx/TARGET_CORTEX_M/RTX_Conf_CM.c
--- a/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c	Thu Aug 18 14:38:56 2016 +0100
+++ b/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c	Thu Sep 01 15:13:42 2016 +0100
@@ -50,10 +50,10 @@
 #ifndef OS_TASKCNT
 #  if   defined(TARGET_LPC1768) || defined(TARGET_LPC2368)   || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) || defined(TARGET_LPC4330) || defined(TARGET_LPC4337) || defined(TARGET_LPC1347) || defined(TARGET_K64F) || defined(TARGET_K66F)|| defined(TARGET_STM32F401RE)\
    || defined(TARGET_STM32F410RB) || defined(TARGET_KL46Z) || defined(TARGET_KL43Z)  || defined(TARGET_STM32F407) || defined(TARGET_F407VG)  || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_LPC11U68) \
-   || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F207ZG) || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F401VC) || defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_TEENSY3_1) \
+   || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F207ZG) || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F401VC) || defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_MAX32620) || defined(TARGET_TEENSY3_1) \
    || defined(TARGET_STM32L152RE) || defined(TARGET_STM32F446RE) || defined(TARGET_STM32F446VE) || defined(TARGET_STM32F446ZE) || defined(TARGET_STM32L432KC) || defined(TARGET_STM32L476VG) || defined(TARGET_STM32L476RG) || defined(TARGET_STM32F469NI) || defined(TARGET_STM32F746NG) || defined(TARGET_STM32F746ZG) || defined(TARGET_STM32L152RC) \
    || defined(TARGET_EFM32GG_STK3700) || defined(TARGET_EFM32WG_STK3800) || defined(TARGET_EFM32LG_STK3600) || defined(TARGET_EFM32PG_STK3401) || defined(TARGET_STM32F767ZI) \
-   || defined(TARGET_NUMAKER_PFM_NUC472)
+   || defined(TARGET_NUMAKER_PFM_NUC472) || defined(TARGET_NCS36510)
 #    define OS_TASKCNT         14
 #  elif defined(TARGET_LPC11U24) || defined(TARGET_STM32F303RE) || defined(TARGET_STM32F303K8) || defined(TARGET_LPC11U35_401)  || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) \
    || defined(TARGET_LPC812)   || defined(TARGET_KL25Z)         || defined(TARGET_KL26Z)       || defined(TARGET_KL27Z)         || defined(TARGET_KL05Z)        || defined(TARGET_STM32F100RB)  || defined(TARGET_STM32F051R8) \
@@ -86,10 +86,10 @@
 #ifndef OS_MAINSTKSIZE
 #  if   defined(TARGET_LPC1768) || defined(TARGET_LPC2368)   || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) || defined(TARGET_LPC4330) || defined(TARGET_LPC4337) || defined(TARGET_LPC1347)  || defined(TARGET_K64F) || defined(TARGET_K66F) ||defined(TARGET_STM32F401RE)\
    || defined(TARGET_STM32F410RB) || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F407) || defined(TARGET_F407VG)  || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_LPC11U68) \
-   || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F401VC) || defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_TEENSY3_1) \
+   || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F401VC) || defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_MAX32620) || defined(TARGET_TEENSY3_1) \
    || defined(TARGET_STM32L152RE) || defined(TARGET_STM32F446RE) || defined(TARGET_STM32F446VE) || defined(TARGET_STM32F446ZE) || defined(TARGET_STM32L432KC) || defined(TARGET_STM32L476VG) || defined(TARGET_STM32L476RG) || defined(TARGET_STM32F469NI) || defined(TARGET_STM32F746NG) || defined(TARGET_STM32F746ZG) || defined(TARGET_STM32L152RC) \
    ||defined(TARGET_EFM32GG_STK3700) || defined(TARGET_STM32F767ZI) || defined(TARGET_STM32F207ZG) \
-   || defined(TARGET_NUMAKER_PFM_NUC472)
+   || defined(TARGET_NUMAKER_PFM_NUC472) || defined(TARGET_NCS36510)
 #      define OS_MAINSTKSIZE    256
 #  elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401)  || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO)  || defined(TARGET_LPC1114) \
    || defined(TARGET_LPC812)   || defined(TARGET_KL25Z)         || defined(TARGET_KL26Z)        || defined(TARGET_KL27Z)        || defined(TARGET_KL05Z)        || defined(TARGET_STM32F100RB)  || defined(TARGET_STM32F051R8) \
@@ -221,7 +221,7 @@
 #elif defined(TARGET_STM32F302R8)
 #    define OS_CLOCK       72000000
 
-#elif defined(TARGET_STM32L031K6) || defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) || defined(TARGET_STM32L073RZ)
+#elif defined(TARGET_STM32L031K6) || defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) || defined(TARGET_STM32L073RZ) 
 #    define OS_CLOCK       32000000
 
 #elif defined(TARGET_STM32F401VC)
@@ -233,6 +233,9 @@
 #elif defined(TARGET_MAX32610) || defined(TARGET_MAX32600)
 #    define OS_CLOCK       24000000
 
+#elif defined(TARGET_MAX32620)
+#    define OS_CLOCK       96000000
+
 #elif defined(TARGET_NZ32_SC151)
 #    define OS_CLOCK       32000000
 
@@ -270,6 +273,9 @@
 #elif defined(TARGET_NUMAKER_PFM_NUC472)
 #    define OS_CLOCK       84000000
 
+#elif defined(TARGET_NCS36510)
+#    define OS_CLOCK       32000000
+
 #  else
 #    error "no target defined"
 #  endif