mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2026-07-15 14:35:38 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
BIN
Living_SDK/board/mx1270/config/ASR550x.FLM
Normal file
BIN
Living_SDK/board/mx1270/config/ASR550x.FLM
Normal file
Binary file not shown.
21
Living_SDK/board/mx1270/config/board.h
Normal file
21
Living_SDK/board/mx1270/config/board.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef __BOARD_H__
|
||||
#define __BOARD_H__
|
||||
|
||||
#include "hal/hal.h"
|
||||
|
||||
|
||||
extern hal_logic_partition_t hal_partitions[];
|
||||
extern void flash_partition_init(void);
|
||||
|
||||
typedef enum {
|
||||
PORT_UART_STD,
|
||||
PORT_UART_AT,
|
||||
PORT_UART_RS485,
|
||||
PORT_UART_SCANNER,
|
||||
PORT_UART_LORA,
|
||||
PORT_UART_TEMP,
|
||||
PORT_UART_SIZE,
|
||||
PORT_UART_INVALID = 255
|
||||
}PORT_UART_TYPE;
|
||||
|
||||
#endif //__BOARD_H__
|
||||
232
Living_SDK/board/mx1270/config/k_config.c
Normal file
232
Living_SDK/board/mx1270/config/k_config.c
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#include <k_api.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#if (RHINO_CONFIG_HW_COUNT > 0)
|
||||
void soc_hw_timer_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
hr_timer_t soc_hr_hw_cnt_get(void)
|
||||
{
|
||||
return 0;
|
||||
//return *(volatile uint64_t *)0xc0000120;
|
||||
}
|
||||
|
||||
lr_timer_t soc_lr_hw_cnt_get(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* RHINO_CONFIG_HW_COUNT */
|
||||
|
||||
#if (RHINO_CONFIG_INTRPT_GUARD > 0)
|
||||
void soc_intrpt_guard(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (RHINO_CONFIG_INTRPT_STACK_REMAIN_GET > 0)
|
||||
size_t soc_intrpt_stack_remain_get(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (RHINO_CONFIG_INTRPT_STACK_OVF_CHECK > 0)
|
||||
void soc_intrpt_stack_ovf_check(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (RHINO_CONFIG_MM_TLF > 0)
|
||||
|
||||
#if defined (__CC_ARM) /* Keil / armcc */
|
||||
#define HEAP_BUFFER_SIZE 1024*120
|
||||
uint8_t g_heap_buf[HEAP_BUFFER_SIZE];
|
||||
k_mm_region_t g_mm_region[] = {{g_heap_buf, HEAP_BUFFER_SIZE}};
|
||||
#elif defined (__ICCARM__)/* IAR */
|
||||
#define HEAP_BUFFER_SIZE 1024*120
|
||||
uint8_t g_heap_buf[HEAP_BUFFER_SIZE];
|
||||
k_mm_region_t g_mm_region[] = {{g_heap_buf, HEAP_BUFFER_SIZE}};
|
||||
#else /* GCC */
|
||||
extern void *heap_start;
|
||||
extern void *heap_end;
|
||||
extern void *heap_len;
|
||||
/* heap_start and heap_len is set by linkscript(*.ld) */
|
||||
k_mm_region_t g_mm_region[] = {{(uint8_t*)&heap_start,(size_t)&heap_len}};
|
||||
#endif
|
||||
|
||||
int g_region_num = sizeof(g_mm_region)/sizeof(k_mm_region_t);
|
||||
|
||||
#endif
|
||||
|
||||
#if (RHINO_CONFIG_MM_LEAKCHECK > 0 )
|
||||
|
||||
extern int __bss_start__, __bss_end__, _sdata, _edata;
|
||||
|
||||
void aos_mm_leak_region_init(void)
|
||||
{
|
||||
#if (RHINO_CONFIG_MM_DEBUG > 0)
|
||||
krhino_mm_leak_region_init(&__bss_start__, &__bss_end__);
|
||||
krhino_mm_leak_region_init(&_sdata, &_edata);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if (RHINO_CONFIG_TASK_STACK_CUR_CHECK > 0)
|
||||
size_t soc_get_cur_sp()
|
||||
{
|
||||
size_t sp = 0;
|
||||
#if defined (__GNUC__)&&!defined(__CC_ARM)
|
||||
asm volatile(
|
||||
"mov %0,sp\n"
|
||||
:"=r"(sp));
|
||||
#endif
|
||||
return sp;
|
||||
}
|
||||
static void soc_print_stack()
|
||||
{
|
||||
void *cur, *end, *start;
|
||||
int stack_size;
|
||||
int i=0;
|
||||
int *p;
|
||||
ktask_t * cur_task;
|
||||
|
||||
cur_task = krhino_cur_task_get();
|
||||
start = cur_task->task_stack_base;
|
||||
stack_size = cur_task->stack_size;
|
||||
end = start + stack_size*4;
|
||||
cur = (void *)soc_get_cur_sp();
|
||||
p = (int*)cur;
|
||||
while(p < (int*)end) {
|
||||
if(i%4==0) {
|
||||
printf("\r\n%08lx:",(uint32_t)p);
|
||||
}
|
||||
printf("%08x ", *p);
|
||||
i++;
|
||||
p++;
|
||||
}
|
||||
printf("=============,task_name:%s,start:%x,stack:%x,cur:%x\r\n", cur_task->task_name, (unsigned int)start, stack_size, (unsigned int)cur);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
void soc_err_proc(kstat_t err)
|
||||
{
|
||||
(void)err;
|
||||
|
||||
#if (RHINO_CONFIG_TASK_STACK_CUR_CHECK > 0)
|
||||
soc_print_stack();
|
||||
#endif
|
||||
assert(0);
|
||||
}
|
||||
|
||||
#if (RHINO_CONFIG_USER_HOOK > 0)
|
||||
|
||||
/**
|
||||
* This function will provide init hook
|
||||
*/
|
||||
void krhino_init_hook(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will provide system start hook
|
||||
*/
|
||||
void krhino_start_hook(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will provide task create hook
|
||||
* @param[in] task pointer to the task
|
||||
*/
|
||||
void krhino_task_create_hook(ktask_t *task)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will provide task delete hook
|
||||
* @param[in] task pointer to the task
|
||||
*/
|
||||
void krhino_task_del_hook(ktask_t *task, res_free_t *arg)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will provide task abort hook
|
||||
* @param[in] task pointer to the task
|
||||
*/
|
||||
void krhino_task_abort_hook(ktask_t *task)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will provide task switch hook
|
||||
*/
|
||||
void krhino_task_switch_hook(ktask_t *orgin, ktask_t *dest)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function will provide system tick hook
|
||||
*/
|
||||
void krhino_tick_hook(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will provide idle pre hook
|
||||
*/
|
||||
void krhino_idle_pre_hook(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will provide idle hook
|
||||
*/
|
||||
void krhino_idle_hook(void)
|
||||
{
|
||||
extern void pmu_idle_hook(void);
|
||||
pmu_idle_hook();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will provide krhino_mm_alloc hook
|
||||
*/
|
||||
void krhino_mm_alloc_hook(void *mem, size_t size)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if (RHINO_CONFIG_TRACE == 0)
|
||||
void trace_start(void)
|
||||
{
|
||||
printf("trace config close!!!\r\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
krhino_err_proc_t g_err_proc = soc_err_proc;
|
||||
|
||||
150
Living_SDK/board/mx1270/config/k_config.h
Normal file
150
Living_SDK/board/mx1270/config/k_config.h
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
|
||||
*/
|
||||
|
||||
#ifndef K_CONFIG_H
|
||||
#define K_CONFIG_H
|
||||
|
||||
/* kernel feature conf */
|
||||
#ifndef RHINO_CONFIG_SEM
|
||||
#define RHINO_CONFIG_SEM 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_QUEUE
|
||||
#define RHINO_CONFIG_QUEUE 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TASK_SEM
|
||||
#define RHINO_CONFIG_TASK_SEM 0
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_EVENT_FLAG
|
||||
#define RHINO_CONFIG_EVENT_FLAG 0
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TIMER
|
||||
#define RHINO_CONFIG_TIMER 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_BUF_QUEUE
|
||||
#define RHINO_CONFIG_BUF_QUEUE 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_MM_BLK
|
||||
#define RHINO_CONFIG_MM_BLK 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_MM_DEBUG
|
||||
#define RHINO_CONFIG_MM_DEBUG 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_MM_TLF
|
||||
#define RHINO_CONFIG_MM_TLF 1
|
||||
#endif
|
||||
|
||||
/* kernel task conf */
|
||||
#ifndef RHINO_CONFIG_TASK_SUSPEND
|
||||
#define RHINO_CONFIG_TASK_SUSPEND 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TASK_INFO
|
||||
#define RHINO_CONFIG_TASK_INFO 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TASK_DEL
|
||||
#define RHINO_CONFIG_TASK_DEL 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TASK_WAIT_ABORT
|
||||
#define RHINO_CONFIG_TASK_WAIT_ABORT 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TASK_STACK_OVF_CHECK
|
||||
#define RHINO_CONFIG_TASK_STACK_OVF_CHECK 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_SCHED_RR
|
||||
#define RHINO_CONFIG_SCHED_RR 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TIME_SLICE_DEFAULT
|
||||
#define RHINO_CONFIG_TIME_SLICE_DEFAULT 50
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_PRI_MAX
|
||||
#define RHINO_CONFIG_PRI_MAX 62
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_USER_PRI_MAX
|
||||
#define RHINO_CONFIG_USER_PRI_MAX (RHINO_CONFIG_PRI_MAX - 2)
|
||||
#endif
|
||||
|
||||
/* kernel workqueue conf */
|
||||
#ifndef RHINO_CONFIG_WORKQUEUE
|
||||
#define RHINO_CONFIG_WORKQUEUE 0
|
||||
#endif
|
||||
|
||||
/* kernel mm_region conf */
|
||||
#ifndef RHINO_CONFIG_MM_REGION_MUTEX
|
||||
#define RHINO_CONFIG_MM_REGION_MUTEX 0
|
||||
#endif
|
||||
|
||||
/* kernel timer&tick conf */
|
||||
#ifndef RHINO_CONFIG_TICKS_PER_SECOND
|
||||
#define RHINO_CONFIG_TICKS_PER_SECOND 200
|
||||
#endif
|
||||
|
||||
/*must reserve enough stack size for timer cb will consume*/
|
||||
#ifndef RHINO_CONFIG_TIMER_TASK_STACK_SIZE
|
||||
#define RHINO_CONFIG_TIMER_TASK_STACK_SIZE 512
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TIMER_TASK_PRI
|
||||
#define RHINO_CONFIG_TIMER_TASK_PRI 5
|
||||
#endif
|
||||
|
||||
#ifndef RHINO_CONFIG_INTRPT_STACK_OVF_CHECK
|
||||
#define RHINO_CONFIG_INTRPT_STACK_OVF_CHECK 0
|
||||
#endif
|
||||
/* kernel dyn alloc conf */
|
||||
#ifndef RHINO_CONFIG_KOBJ_DYN_ALLOC
|
||||
#define RHINO_CONFIG_KOBJ_DYN_ALLOC 1
|
||||
#endif
|
||||
|
||||
#if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0)
|
||||
#ifndef RHINO_CONFIG_K_DYN_TASK_STACK
|
||||
#define RHINO_CONFIG_K_DYN_TASK_STACK 128
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_K_DYN_MEM_TASK_PRI
|
||||
#define RHINO_CONFIG_K_DYN_MEM_TASK_PRI 6
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* kernel idle conf */
|
||||
#ifndef RHINO_CONFIG_IDLE_TASK_STACK_SIZE
|
||||
#define RHINO_CONFIG_IDLE_TASK_STACK_SIZE 200
|
||||
#endif
|
||||
|
||||
/* kernel hook conf */
|
||||
#ifndef RHINO_CONFIG_USER_HOOK
|
||||
#define RHINO_CONFIG_USER_HOOK 0
|
||||
#endif
|
||||
|
||||
/* kernel stats conf */
|
||||
#ifndef RHINO_CONFIG_SYSTEM_STATS
|
||||
#define RHINO_CONFIG_SYSTEM_STATS 1
|
||||
#endif
|
||||
#ifndef RHINO_CONFIG_TASK_STACK_CUR_CHECK
|
||||
#define RHINO_CONFIG_TASK_STACK_CUR_CHECK 1
|
||||
#endif
|
||||
|
||||
#ifndef RHINO_CONFIG_CPU_NUM
|
||||
#define RHINO_CONFIG_CPU_NUM 1
|
||||
#endif
|
||||
|
||||
/* lowpower conf */
|
||||
#ifndef WIFI_CONFIG_SUPPORT_LOWPOWER
|
||||
#define WIFI_CONFIG_SUPPORT_LOWPOWER 0
|
||||
#endif
|
||||
|
||||
#ifndef WIFI_CONFIG_LISTENSET_BINIT
|
||||
#define WIFI_CONFIG_LISTENSET_BINIT 0
|
||||
#endif
|
||||
|
||||
#ifndef WIFI_CONFIG_LISTEN_INTERVAL
|
||||
#define WIFI_CONFIG_LISTEN_INTERVAL 1
|
||||
#endif
|
||||
|
||||
#ifndef WIFI_CONFIG_RECEIVE_DTIM
|
||||
#define WIFI_CONFIG_RECEIVE_DTIM 1
|
||||
#endif
|
||||
|
||||
#ifndef RHINO_CONFIG_GCC_RETADDR
|
||||
#define RHINO_CONFIG_GCC_RETADDR 1
|
||||
#endif
|
||||
|
||||
#endif /* K_CONFIG_H */
|
||||
|
||||
47
Living_SDK/board/mx1270/config/partition_conf.c
Normal file
47
Living_SDK/board/mx1270/config/partition_conf.c
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#include <aos/aos.h>
|
||||
#include "hal/soc/soc.h"
|
||||
#include "lega_flash.h"
|
||||
|
||||
/* Logic partition on flash devices */
|
||||
hal_logic_partition_t hal_partitions[HAL_PARTITION_MAX];
|
||||
extern const lega_logic_partition_t lega_partitions[];
|
||||
|
||||
void flash_partition_init(void)
|
||||
{
|
||||
hal_partitions[HAL_PARTITION_BOOTLOADER].partition_owner = lega_partitions[PARTITION_BOOTLOADER].partition_owner;
|
||||
hal_partitions[HAL_PARTITION_BOOTLOADER].partition_description = lega_partitions[PARTITION_BOOTLOADER].partition_description;
|
||||
hal_partitions[HAL_PARTITION_BOOTLOADER].partition_start_addr = lega_partitions[PARTITION_BOOTLOADER].partition_start_addr;
|
||||
hal_partitions[HAL_PARTITION_BOOTLOADER].partition_length = lega_partitions[PARTITION_BOOTLOADER].partition_length;
|
||||
hal_partitions[HAL_PARTITION_BOOTLOADER].partition_options = lega_partitions[PARTITION_BOOTLOADER].partition_options ;
|
||||
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_owner = lega_partitions[PARTITION_PARAMETER_1].partition_owner;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_description = lega_partitions[PARTITION_PARAMETER_1].partition_description;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_start_addr = lega_partitions[PARTITION_PARAMETER_1].partition_start_addr;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_length = lega_partitions[PARTITION_PARAMETER_1].partition_length;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_options = lega_partitions[PARTITION_PARAMETER_1].partition_options ;
|
||||
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_owner = lega_partitions[PARTITION_PARAMETER_2].partition_owner ;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_description = lega_partitions[PARTITION_PARAMETER_2].partition_description;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_start_addr = lega_partitions[PARTITION_PARAMETER_2].partition_start_addr;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_length = lega_partitions[PARTITION_PARAMETER_2].partition_length;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_options = lega_partitions[PARTITION_PARAMETER_2].partition_options;
|
||||
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_owner = lega_partitions[PARTITION_PARAMETER_3].partition_owner ;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_description = lega_partitions[PARTITION_PARAMETER_3].partition_description;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_start_addr = lega_partitions[PARTITION_PARAMETER_3].partition_start_addr;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_length = lega_partitions[PARTITION_PARAMETER_3].partition_length;
|
||||
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_options = lega_partitions[PARTITION_PARAMETER_3].partition_options;
|
||||
|
||||
hal_partitions[HAL_PARTITION_APPLICATION].partition_owner = lega_partitions[PARTITION_APPLICATION].partition_owner;
|
||||
hal_partitions[HAL_PARTITION_APPLICATION].partition_description = lega_partitions[PARTITION_APPLICATION].partition_description;
|
||||
hal_partitions[HAL_PARTITION_APPLICATION].partition_start_addr = lega_partitions[PARTITION_APPLICATION].partition_start_addr;
|
||||
hal_partitions[HAL_PARTITION_APPLICATION].partition_length = lega_partitions[PARTITION_APPLICATION].partition_length;
|
||||
hal_partitions[HAL_PARTITION_APPLICATION].partition_options = lega_partitions[PARTITION_APPLICATION].partition_options;
|
||||
|
||||
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_owner = lega_partitions[PARTITION_OTA_TEMP].partition_owner;
|
||||
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_description = lega_partitions[PARTITION_OTA_TEMP].partition_description;
|
||||
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_start_addr = lega_partitions[PARTITION_OTA_TEMP].partition_start_addr;
|
||||
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_length = lega_partitions[PARTITION_OTA_TEMP].partition_length;
|
||||
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_options = lega_partitions[PARTITION_OTA_TEMP].partition_options;
|
||||
}
|
||||
|
||||
13
Living_SDK/board/mx1270/config/ram.ini
Normal file
13
Living_SDK/board/mx1270/config/ram.ini
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
FUNC void Setup (void) {
|
||||
|
||||
SP = _RDWORD(0x10040000); // Setup Stack Pointer
|
||||
PC = _RDWORD(0x10040004); // Setup Program Counter
|
||||
_WDWORD(0xE000ED08, 0x10040000); // Setup Vector Table Offset Register
|
||||
|
||||
}
|
||||
|
||||
load ./Objects/linkkitapp@asr5501.elf incremental
|
||||
|
||||
Setup(); // Setup for Running
|
||||
|
||||
g, main
|
||||
Loading…
Add table
Add a link
Reference in a new issue