Skip to content

Commit

Permalink
Merge pull request #7 from Tencent/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Mculover666 authored Jun 5, 2020
2 parents 15538ed + 5861290 commit bd78b9a
Show file tree
Hide file tree
Showing 531 changed files with 130,855 additions and 7,642 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
## 1、TencentOS tiny整体架构

![](./doc/image/introduction/TencentOS_tiny_Architecture.png)

TencentOS tiny 主体架构图,从下到上主要包括:

**CPU 库** :TencentOS tiny 支持的 CPU IP 核架构,当前主要支持 ARM Cortex M0/3/4/7。
**CPU 库** :TencentOS tiny 支持的 CPU IP 核架构,当前主要支持 ARM Cortex M0/3/4/7,Cortex A7,RISC-V、MSP430、AVR、STM8等

**驱动管理层** :包括板级支持包(BSP,主要由 MCU 芯片厂家开发与维护)、硬件抽象(HAL,主要由 TencentOS tiny提供,方便不同芯片的适配与移植)、设备驱动(Drivers,例如 Wi-Fi、GPRS、LoRa 等模块的驱动程序)。

Expand Down Expand Up @@ -60,7 +61,9 @@ TencentOS tiny 主体架构图,从下到上主要包括:

![](./doc/image/introduction/Partners.png)

TencentOS tiny目前支持STM32、NXP、华大半导体、国民技术、GD32、Nordic、TI等主流MCU。当前已完成两套官方定制开发板设计,支持全系列STM32 NUCLEO官方评估板内核移植。TencentOS tiny 将携手合作伙伴为物联网终端厂家提供更优质的IoT终端软件解决方案,方便各种物联网设备快速接入腾讯云,共同扩展IoT生态,更好地支撑智慧城市、智能水表、智能家居、智能穿戴、车联网等多种行业应用。
TencentOS tiny自开源发布以来也在努力发展合作伙伴,期待合作共赢,共同扩展IoT应用生态。目前已经与多家MCU/IP核厂家达成了合作,包括意法半导体、恩智浦半导体、兆易半导体、ARM、华大半导体、芯来科技等;也与无线SOC和模组厂家达成了广泛的合作关系,包括瑞兴恒方、国民技术、Nordic蓝牙、亮牛半导体、有人物联网等,

除了MCU和模组外,TencentOS tiny也积极推进终端产品及项目的落地,目前已经形成了AI智慧农业、智能货柜、智慧会议室等方案,并且在腾讯内部与AI 平台部、腾讯微瓴、QQ family达成内部合作,共同扩展行业生态;同时也开始积极发展外部客户,目前与深圳光合显示科技的墨水屏零售标签、鑫悦购充电桩等达成业务合作。TencentOS tiny 将携手合作伙伴为物联网终端厂家提供更优质的IoT终端软件解决方案,方便各种物联网设备快速接入腾讯云,共同扩展IoT生态,更好地支撑智慧城市、智能水表、智能家居、智能穿戴、车联网等多种行业应用。

欢迎IoT相关项目合作,有合作需求的请邮件联系TencentOS tiny官方工作人员,邮箱地址 : [email protected]

Expand Down
28 changes: 19 additions & 9 deletions arch/arm/arm-v6m/cortex-m0/armcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
k_fault_log_writer("fault diagnosis is not supported in CORTEX M0\n");
}

/*------------------ RealView Compiler -----------------*/
Expand All @@ -90,10 +90,16 @@ __PORT__ __ASM__ void HardFault_Handler(void)
IMPORT fault_backtrace

MOV r0, lr
TST lr, #0x04
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
MOVS r1, #0x04
TST r0, r1
BEQ _LD_MSP
MRS r1, PSP
B _EXIT

_LD_MSP
MRS r1, MSP

_EXIT
BL fault_backtrace
}

Expand All @@ -104,10 +110,14 @@ __PORT__ void __NAKED__ HardFault_Handler(void)
{
__ASM__ __VOLATILE__ (
"MOV r0, lr\n\t"
"TST lr, #0x04\n\t"
"ITE EQ\n\t"
"MRSEQ r1, MSP\n\t"
"MRSNE r1, PSP\n\t"
"MOVS r1, #0x04\n\t"
"TST r0, r1\n\t"
"BEQ _LD_MSP\n\t"
"MRS r1, PSP\n\t"
"B _EXIT\n\t"
"_LD_MSP:\n\t"
"MRS r1, MSP\n\t"
"_EXIT:\n\t"
"BL fault_backtrace\n\t"
);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/arm-v6m/cortex-m0/gcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
k_fault_log_writer("fault diagnosis is not supported in CORTEX M0\n");
}

/*------------------ RealView Compiler -----------------*/
Expand Down
39 changes: 12 additions & 27 deletions arch/arm/arm-v6m/cortex-m0/iccarm/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,43 +76,28 @@ __PORT__ void port_standby_mode_enter(void)
#endif

#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
}

/*------------------ RealView Compiler -----------------*/
/* V5 */
#if defined(__CC_ARM)

__PORT__ __ASM__ void HardFault_Handler(void)
__PORT__ void port_fault_diagnosis(void)
{
IMPORT fault_backtrace

MOV r0, lr
TST lr, #0x04
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
BL fault_backtrace
k_fault_log_writer("fault diagnosis is not supported in CORTEX M0\n");
}

/*------------------ ARM Compiler V6 -------------------*/
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)

__PORT__ void __NAKED__ HardFault_Handler(void)
{
__ASM__ __VOLATILE__ (
"MOV r0, lr\n\t"
"TST lr, #0x04\n\t"
"ITE EQ\n\t"
"MRSEQ r1, MSP\n\t"
"MRSNE r1, PSP\n\t"
"BL fault_backtrace\n\t"
"MOVS r1, #0x04\n\t"
"TST r0, r1\n\t"
"BEQ _LD_MSP\n\t"
"MRS r1, PSP\n\t"
"B _EXIT\n"
"_LD_MSP:\n\t"
"MRS r1, MSP\n"
"_EXIT:\n\t"
"LDR r2, =fault_backtrace\n\t"
"BX r2\n\t"
);
}

#endif /* ARMCC VERSION */

#endif /* TOS_CFG_FAULT_BACKTRACE_EN */

2 changes: 1 addition & 1 deletion arch/arm/arm-v7a/cortex-a7/gcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
// k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
// k_fault_log_writer("fault diagnosis is not supported in CORTEX a7\n");
}

#if 0
Expand Down
28 changes: 19 additions & 9 deletions arch/arm/arm-v7m/cortex-m0+/armcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
k_fault_log_writer("fault diagnosis is not supported in CORTEX M0+\n");
}

/*------------------ RealView Compiler -----------------*/
Expand All @@ -107,10 +107,16 @@ __PORT__ __ASM__ void HardFault_Handler(void)
IMPORT fault_backtrace

MOV r0, lr
TST lr, #0x04
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
MOVS r1, #0x04
TST r0, r1
BEQ _LD_MSP
MRS r1, PSP
B _EXIT

_LD_MSP
MRS r1, MSP

_EXIT
BL fault_backtrace
}

Expand All @@ -121,10 +127,14 @@ __PORT__ void __NAKED__ HardFault_Handler(void)
{
__ASM__ __VOLATILE__ (
"MOV r0, lr\n\t"
"TST lr, #0x04\n\t"
"ITE EQ\n\t"
"MRSEQ r1, MSP\n\t"
"MRSNE r1, PSP\n\t"
"MOVS r1, #0x04\n\t"
"TST r0, r1\n\t"
"BEQ _LD_MSP\n\t"
"MRS r1, PSP\n\t"
"B _EXIT\n\t"
"_LD_MSP:\n\t"
"MRS r1, MSP\n\t"
"_EXIT:\n\t"
"BL fault_backtrace\n\t"
);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/arm-v7m/cortex-m0+/gcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
k_fault_log_writer("fault diagnosis is not supported in CORTEX M0+\n");
}

/*------------------ RealView Compiler -----------------*/
Expand Down
39 changes: 12 additions & 27 deletions arch/arm/arm-v7m/cortex-m0+/iccarm/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,43 +93,28 @@ __PORT__ void port_standby_mode_enter(void)
#endif

#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
}

/*------------------ RealView Compiler -----------------*/
/* V5 */
#if defined(__CC_ARM)

__PORT__ __ASM__ void HardFault_Handler(void)
__PORT__ void port_fault_diagnosis(void)
{
IMPORT fault_backtrace

MOV r0, lr
TST lr, #0x04
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
BL fault_backtrace
k_fault_log_writer("fault diagnosis is not supported in CORTEX M0+\n");
}

/*------------------ ARM Compiler V6 -------------------*/
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)

__PORT__ void __NAKED__ HardFault_Handler(void)
{
__ASM__ __VOLATILE__ (
"MOV r0, lr\n\t"
"TST lr, #0x04\n\t"
"ITE EQ\n\t"
"MRSEQ r1, MSP\n\t"
"MRSNE r1, PSP\n\t"
"BL fault_backtrace\n\t"
"MOVS r1, #0x04\n\t"
"TST r0, r1\n\t"
"BEQ _LD_MSP\n\t"
"MRS r1, PSP\n\t"
"B _EXIT\n"
"_LD_MSP:\n\t"
"MRS r1, MSP\n"
"_EXIT:\n\t"
"LDR r2, =fault_backtrace\n\t"
"BX r2\n\t"
);
}

#endif /* ARMCC VERSION */

#endif /* TOS_CFG_FAULT_BACKTRACE_EN */

24 changes: 2 additions & 22 deletions arch/arm/arm-v7m/cortex-m4/iccarm/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,6 @@ __PORT__ void port_fault_diagnosis(void)
port_fault_do_diagnosis(&regs);
}

/*------------------ RealView Compiler -----------------*/
/* V5 */
#if defined(__CC_ARM)

__PORT__ __ASM__ void HardFault_Handler(void)
{
IMPORT fault_backtrace

MOV r0, lr
TST lr, #0x04
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
BL fault_backtrace
}

/*------------------ ARM Compiler V6 -------------------*/
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)

__PORT__ void __NAKED__ HardFault_Handler(void)
{
__ASM__ __VOLATILE__ (
Expand All @@ -271,11 +252,10 @@ __PORT__ void __NAKED__ HardFault_Handler(void)
"ITE EQ\n\t"
"MRSEQ r1, MSP\n\t"
"MRSNE r1, PSP\n\t"
"BL fault_backtrace\n\t"
"LDR r2, =fault_backtrace\n\t"
"BX r2\n\t"
);
}

#endif /* ARMCC VERSION */

#endif /* TOS_CFG_FAULT_BACKTRACE_EN */

24 changes: 2 additions & 22 deletions arch/arm/arm-v7m/cortex-m7/iccarm/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,25 +227,6 @@ __PORT__ void port_fault_diagnosis(void)
port_fault_do_diagnosis(&regs);
}

/*------------------ RealView Compiler -----------------*/
/* V5 */
#if defined(__CC_ARM)

__PORT__ __ASM__ void HardFault_Handler(void)
{
IMPORT fault_backtrace

MOV r0, lr
TST lr, #0x04
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
BL fault_backtrace
}

/*------------------ ARM Compiler V6 -------------------*/
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)

__PORT__ void __NAKED__ HardFault_Handler(void)
{
__ASM__ __VOLATILE__ (
Expand All @@ -254,11 +235,10 @@ __PORT__ void __NAKED__ HardFault_Handler(void)
"ITE EQ\n\t"
"MRSEQ r1, MSP\n\t"
"MRSNE r1, PSP\n\t"
"BL fault_backtrace\n\t"
"LDR r2, =fault_backtrace\n\t"
"BX r2\n\t"
);
}

#endif /* ARMCC VERSION */

#endif /* TOS_CFG_FAULT_BACKTRACE_EN */

2 changes: 1 addition & 1 deletion arch/arm/arm-v8m/cortex-m23/armcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
k_fault_log_writer("fault diagnosis is not supported in CORTEX M23\n");
}

/*------------------ RealView Compiler -----------------*/
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/arm-v8m/cortex-m23/gcc/port_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*---------------------------------------------------------------------------*/

#include "tos_k.h"
#include "core_cm0plus.h"
#include "core_cm23.h"

__PORT__ void port_cpu_reset(void)
{
Expand Down Expand Up @@ -95,7 +95,7 @@ __PORT__ void port_standby_mode_enter(void)
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__PORT__ void port_fault_diagnosis(void)
{
k_fault_log_writer("fault diagnosis does not supported in CORTEX M0\n");
k_fault_log_writer("fault diagnosis is not supported in CORTEX M23\n");
}

/*------------------ RealView Compiler -----------------*/
Expand Down
Loading

0 comments on commit bd78b9a

Please sign in to comment.