rel_1.6.0 init

This commit is contained in:
guocheng.kgc 2020-06-18 20:06:52 +08:00 committed by shengdong.dsd
commit 27b3e2883d
19359 changed files with 8093121 additions and 0 deletions

View file

@ -0,0 +1,157 @@
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#include "hal/soc/soc.h"
#include <aos/kernel.h>
#include <aos/aos.h>
/* Logic partition on flash devices */
const hal_logic_partition_t hal_partitions[] =
{
[HAL_PARTITION_BOOTLOADER] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "Bootloader",
.partition_start_addr = 0x0,
.partition_length = 0x10000, //64k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS,
},
[HAL_PARTITION_PARAMETER_1] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER1",
.partition_start_addr = 0x10000,
.partition_length = 0x1000, // 4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_2] =
{ //This partition just for kv,config mk3060 kv flash size to 4K
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER2",
.partition_start_addr = 0x11000,
.partition_length = 0x2000, //8k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_APPLICATION] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "Application",
.partition_start_addr = 0x13000,
.partition_length = 0xED000, //948k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_OTA_TEMP] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "OTA Storage",
.partition_start_addr = 0x100000,
.partition_length = 0xED000, //948k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_3] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER3",
.partition_start_addr = 0x1ED000,
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_4] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER4",
.partition_start_addr = 0xD000,
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
};
void qc_test(void);
#define KEY_STATUS 1
#define KEY_ELINK 2
#define KEY_BOOT 7
static uint64_t elink_time = 0;
static gpio_dev_t gpio_key_boot, gpio_key_status;
static void key_poll_func(void *arg)
{
uint32_t level;
uint64_t diff;
hal_gpio_input_get(&gpio_key_boot, &level);
if (level == 0) {
aos_post_delayed_action(10, key_poll_func, NULL);
} else {
diff = aos_now_ms() - elink_time;
if (diff > 6000) { /*long long press */
elink_time = 0;
aos_post_event(EV_KEY, CODE_BOOT, VALUE_KEY_LLTCLICK);
} else if (diff > 2000) { /* long press */
elink_time = 0;
aos_post_event(EV_KEY, CODE_BOOT, VALUE_KEY_LTCLICK);
} else if (diff > 40) { /* short press */
elink_time = 0;
aos_post_event(EV_KEY, CODE_BOOT, VALUE_KEY_CLICK);
} else {
aos_post_delayed_action(10, key_poll_func, NULL);
}
}
}
static void key_proc_work(void *arg)
{
aos_schedule_call(key_poll_func, NULL);
}
static void handle_elink_key(void *arg)
{
uint32_t gpio_value;
hal_gpio_input_get(&gpio_key_boot, &gpio_value);
if (gpio_value == 0 && elink_time == 0) {
elink_time = aos_now_ms();
aos_loop_schedule_work(0, key_proc_work, NULL, NULL, NULL);
}
}
/* For QC test */
static void board_qc_check(void)
{
uint32_t gpio_value = 1;
gpio_key_boot.port = KEY_BOOT;
gpio_key_boot.config = INPUT_PULL_UP;
hal_gpio_init(&gpio_key_boot);
hal_gpio_input_get(&gpio_key_boot, &gpio_value);
if (gpio_value != 0) {
return;
}
gpio_value = 1;
gpio_key_status.port = KEY_STATUS;
gpio_key_status.config = INPUT_PULL_UP;
hal_gpio_init(&gpio_key_status);
hal_gpio_input_get(&gpio_key_status, &gpio_value);
if (gpio_value != 0) {
return;
}
// QC:
printf("Enter QC mode\r\n");
qc_test();
return;
}
void board_init(void)
{
gpio_key_boot.port = KEY_BOOT;
board_qc_check();
hal_gpio_clear_irq(&gpio_key_boot);
hal_gpio_enable_irq(&gpio_key_boot, IRQ_TRIGGER_FALLING_EDGE, handle_elink_key, NULL);
}

View file

@ -0,0 +1,14 @@
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#define HARDWARE_REVISION "V1.0"
#define MODEL "EMW3060"
#ifdef BOOTLOADER
#define STDIO_UART 0
#define STDIO_UART_BUADRATE 921600
#else
#define STDIO_UART 0
#define STDIO_UART_BUADRATE 921600
#endif

Binary file not shown.

BIN
Living_SDK/board/mk3060/boot.elf Executable file

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,93 @@
#include "hal/soc/soc.h"
//#include "pwm_pub.h"
//Fixme: implement pwm driver
#define PWM_NUM 5
static pwm_dev_t PWM_OBJ[PWM_NUM];
/*
static PinName PWM_MAP[PWM_NUM] = {
[0] = PD_0,
[1] = PD_1,
[2] = PD_2,
[3] = PD_3,
[4] = PB_3,
};
*/
int32_t hal_pwm_init(pwm_dev_t * pwm)
{
if (pwm->port >= PWM_NUM) {
return -1;
}
if (pwm->config.freq > 1000000 || pwm->config.freq < 200)
return -1;
if (pwm->config.duty_cycle > 1 || pwm->config.duty_cycle < 0)
return -1;
pwm->priv = &PWM_OBJ[pwm->port];
//pwmout_init(pwm->priv, PWM_MAP[pwm->port]);
static int init_clk = 0;
if (!init_clk) {
//pwmout_clk_set(pwm->priv, 1, 0);
init_clk = 1;
}
return 0;
}
int32_t hal_pwm_clk(pwm_dev_t * pwm, int src, int div)
{
if (1 == src) {
pwm->config.freq = 10000000;
} else {
pwm->config.freq = 16384;
}
//pwmout_clk_set(pwm->priv, src, div);
return 0;
}
int32_t hal_pwm_period_us(pwm_dev_t * pwm, int us)
{
//pwmout_period_us(pwm->priv, us);
return 0;
}
int32_t hal_pwm_write(pwm_dev_t * pwm, float percent)
{
pwm->config.duty_cycle = percent;
//pwmout_write(pwm->priv, percent);
return 0;
}
int32_t hal_pwm_diff_write(pwm_dev_t * pwm, float percent)
{
pwm->config.duty_cycle = percent;
//pwmout_diff_write(pwm->priv, percent);
return 0;
}
int32_t hal_pwm_sync_write(pwm_dev_t * pwm, float percent, uint8_t duty_sel)
{
pwm->config.duty_cycle = percent;
//pwmout_sync_write(pwm->priv, percent, duty_sel);
return 0;
}
int32_t hal_pwm_start(pwm_dev_t * pwm)
{
int us = 1000000 / pwm->config.freq;
//pwmout_period_us(pwm->priv, us);
//pwmout_write(pwm->priv, pwm->config.duty_cycle);
//pwmout_start(pwm->priv);
return 0;
}
int32_t hal_pwm_stop(pwm_dev_t * pwm)
{
//pwmout_stop(pwm->priv);
return 0;
}
int32_t hal_pwm_finalize(pwm_dev_t * pwm)
{
//pwmout_free(pwm->priv);
return 0;
}

View file

@ -0,0 +1,225 @@
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#ifndef CONFIG_H
#define CONFIG_H
/* chip level conf */
#ifndef RHINO_CONFIG_LITTLE_ENDIAN
#define RHINO_CONFIG_LITTLE_ENDIAN 1
#endif
#ifndef RHINO_CONFIG_CPU_STACK_DOWN
#define RHINO_CONFIG_CPU_STACK_DOWN 1
#endif
/* 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 1
#endif
#ifndef RHINO_CONFIG_EVENT_FLAG
#define RHINO_CONFIG_EVENT_FLAG 1
#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
#ifndef RHINO_CONFIG_MM_TLF_BLK_SIZE
#define RHINO_CONFIG_MM_TLF_BLK_SIZE 8192
#endif
#define K_MM_STATISTIC 1
#ifndef RHINO_CONFIG_MM_MAXMSIZEBIT
#define RHINO_CONFIG_MM_MAXMSIZEBIT 19
#endif
#ifndef RHINO_CONFIG_GCC_RETADDR
#define RHINO_CONFIG_GCC_RETADDR 1
#endif
#ifndef RHINO_CONFIG_MM_LEAKCHECK
#define RHINO_CONFIG_MM_LEAKCHECK 1
#endif
#ifndef RHINO_CONFIG_RINGBUF_VENDOR
#define RHINO_CONFIG_RINGBUF_VENDOR 0
#endif
#ifndef RHINO_CONFIG_KOBJ_SET
#define RHINO_CONFIG_KOBJ_SET 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_STACK_CUR_CHECK
#define RHINO_CONFIG_TASK_STACK_CUR_CHECK 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 1
#endif
#ifndef RHINO_CONFIG_WORKQUEUE_STACK_SIZE
#define RHINO_CONFIG_WORKQUEUE_STACK_SIZE 768
#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_HW_COUNT
#define RHINO_CONFIG_HW_COUNT 0
#endif
#ifndef RHINO_CONFIG_TICK_TASK
#define RHINO_CONFIG_TICK_TASK 0
#endif
#if (RHINO_CONFIG_TICK_TASK > 0)
#ifndef RHINO_CONFIG_TICK_TASK_STACK_SIZE
#define RHINO_CONFIG_TICK_TASK_STACK_SIZE 256
#endif
#ifndef RHINO_CONFIG_TICK_TASK_PRI
#define RHINO_CONFIG_TICK_TASK_PRI 1
#endif
#endif
#ifndef RHINO_CONFIG_TICKLESS
#define RHINO_CONFIG_TICKLESS 0
#endif
#ifndef RHINO_CONFIG_TICKS_PER_SECOND
#define RHINO_CONFIG_TICKS_PER_SECOND 500
#endif
/* must be 2^n size!, such as 1, 2, 4, 8, 16,32, etc....... */
#ifndef RHINO_CONFIG_TICK_HEAD_ARRAY
#define RHINO_CONFIG_TICK_HEAD_ARRAY 8
#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 300
#endif
#ifndef RHINO_CONFIG_TIMER_RATE
#define RHINO_CONFIG_TIMER_RATE 1
#endif
#ifndef RHINO_CONFIG_TIMER_TASK_PRI
#define RHINO_CONFIG_TIMER_TASK_PRI 5
#endif
/* kernel intrpt conf */
#ifndef RHINO_CONFIG_INTRPT_STACK_REMAIN_GET
#define RHINO_CONFIG_INTRPT_STACK_REMAIN_GET 0
#endif
#ifndef RHINO_CONFIG_INTRPT_STACK_OVF_CHECK
#define RHINO_CONFIG_INTRPT_STACK_OVF_CHECK 0
#endif
#ifndef RHINO_CONFIG_INTRPT_MAX_NESTED_LEVEL
#define RHINO_CONFIG_INTRPT_MAX_NESTED_LEVEL 188u
#endif
#ifndef RHINO_CONFIG_INTRPT_GUARD
#define RHINO_CONFIG_INTRPT_GUARD 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_QUEUE_MSG
#define RHINO_CONFIG_K_DYN_QUEUE_MSG 30
#endif
#ifndef RHINO_CONFIG_K_DYN_TASK_STACK
#define RHINO_CONFIG_K_DYN_TASK_STACK 256
#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_DISABLE_SCHED_STATS
#define RHINO_CONFIG_DISABLE_SCHED_STATS 0
#endif
#ifndef RHINO_CONFIG_DISABLE_INTRPT_STATS
#define RHINO_CONFIG_DISABLE_INTRPT_STATS 0
#endif
#ifndef RHINO_CONFIG_CPU_USAGE_STATS
#define RHINO_CONFIG_CPU_USAGE_STATS 0
#endif
#ifndef RHINO_CONFIG_CPU_USAGE_TASK_PRI
#define RHINO_CONFIG_CPU_USAGE_TASK_PRI (RHINO_CONFIG_PRI_MAX - 2)
#endif
#ifndef RHINO_CONFIG_TASK_SCHED_STATS
#define RHINO_CONFIG_TASK_SCHED_STATS 0
#endif
#ifndef RHINO_CONFIG_CPU_USAGE_TASK_STACK
#define RHINO_CONFIG_CPU_USAGE_TASK_STACK 256
#endif
#ifndef RHINO_CONFIG_CPU_NUM
#define RHINO_CONFIG_CPU_NUM 1
#endif
/* kernel trace conf */
#ifndef RHINO_CONFIG_TRACE
#define RHINO_CONFIG_TRACE 0
#endif
#endif /* CONFIG_H */

View file

@ -0,0 +1,55 @@
/*
* +------------+ 0x0040000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* data |
* end
* |(heap) |
* . .
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom 256k
* +------------+
*
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* |vectors |
* | |
* |------------+
* |text |
* |data | 948k
* | |
* +------------+ 0xA1000
* | |
* | |
* | OTA TEMP |
* | | 664k
* | |
* | |
* +------------+ 0x100000
*/
/* Application's phy start address is 0x13200.
* Flash size = 0xA1000-0x13200 = 0x8DE00
* Code size = 0x8DE00*32/34=546936
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x0012000, LENGTH = 948K
ram (rwx): ORIGIN = 0x00400020, LENGTH = 256k - 32
}

View file

@ -0,0 +1,158 @@
#ifdef MBEDTLS_IN_KERNEL
/*
* +------------+ 0x00040000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* app: |
* data | app:16k
* bss |
* +------------+ 0x00404020
* framework: |
* data | framework:48k
* bss |
* +------------+ 0x00410020
* data |
* end
* |(heap) |
* . . kernel:256k - 64k - 32
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom |
* +------------+
*
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* +------------+ 0x0013200
* |vectors |
* | |
* |------------+
* |text |
* |data | kernel:455K
* | |
* +------------+ 0x0085000
* +------------+ 0x0085140
* |text |
* |data | framework:159k
* | |
* +------------+ 0x00AD000
* +------------+ 0x00AD300
* |text |
* |data | app:51k
* | |
* +------------+ 0x00BA000
* +------------+ 0x00BA340
* | |
* | |
* | OTA TEMP |
* | | 279k(MAX * 60%)
* | |
* | |
* +------------+ 0x100000
*/
/* Application's phy start address is 0x00AD300.
* Flash size = 0x00BA000-0x00AD300 = 51K
* Code size = 51K*32/34=48K
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x00A3000, LENGTH = 48K
ram (rwx): ORIGIN = 0x00400020, LENGTH = 16k
}
#else
/*
* +------------+ 0x00400000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* app: |
* data | app:16k
* bss |
* +------------+ 0x00404020
* framework: |
* data | framework:48k
* bss |
* +------------+ 0x00410020
* data |
* end
* |(heap) |
* . . 256k - 64k - 32
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom |
* +------------+
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* +------------+ 0x0013200
* |vectors |
* | |
* |------------+
* |text |
* |data | kernel:399k
* | |
* +------------+ 0x0077000
* +------------+ 0x0077440
* |text |
* |data | framework:250k
* | |
* +------------+ 0x00B6000
* +------------+ 0X00B6380
* |text |
* |data | app:55k
* | |
* +------------+ 0x00c4000
* +------------+ 0x00c4080
* | |
* | |
* | OTA TEMP |
* | | 240k
* | |
* | |
* +------------+ 0x100000
*/
/* Application's phy start address is 0x00AD300.
* Flash size = 0x00c4000-0X00B6380 = 55K
* Code size = 55K*32/34=51K
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x00AB800, LENGTH = 51K
ram (rwx): ORIGIN = 0x00400020, LENGTH = 16k
}
#endif

View file

@ -0,0 +1,161 @@
#ifdef MBEDTLS_IN_KERNEL
/*
* +------------+ 0x00040000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* app: |
* data | app:16k
* bss |
* +------------+ 0x00404020
* framework: |
* data | framework:48k
* bss |
* +------------+ 0x00410020
* kernel: |
* data |
* end
* |(heap) |
* . . 256k - 64k - 32
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom |
* +------------+
*
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* +------------+ 0x0013200
* |vectors |
* | |
* |------------+
* |text |
* |data | kernel:455K
* | |
* +------------+ 0x0085000
* +------------+ 0x0085140
* |text |
* |data | framework:159k
* | |
* +------------+ 0x00AD000
* +------------+ 0x00AD300
* |text |
* |data | app:51k
* | |
* +------------+ 0x00BA000
* +------------+ 0x00BA340
* | |
* | |
* | OTA TEMP |
* | | 279k(MAX * 60%)
* | |
* | |
* +------------+ 0x100000
*/
/* Framework's phy start address is 0x0085140.
* Flash size = 0x00AD000-0x0085140 = 159K
* Code size = 159K*32/34=149K
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x007D400, LENGTH = 149K
ram (rwx): ORIGIN = 0x00404020, LENGTH = 48k
}
#else
/*
* +------------+ 0x00400000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* app: |
* data | app:16k
* bss |
* +------------+ 0x00404020
* framework: |
* data | framework:48k
* bss |
* +------------+ 0x00410020
* kernel: |
* data |
* end
* |(heap) |
* . . 256k - 64k - 32
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom |
* +------------+
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* +------------+ 0x0013200
* |vectors |
* | |
* |------------+
* |text |
* |data | kernel:399k
* | |
* +------------+ 0x0077000
* +------------+ 0x0077440
* |text |
* |data | framework:250k
* | |
* +------------+ 0x00B6000
* +------------+ 0X00B6380
* |text |
* |data | app:55k
* | |
* +------------+ 0x00c4000
* +------------+ 0x00c4080
* | |
* | |
* | OTA TEMP |
* | | 240k
* | |
* | |
* +------------+ 0x100000
*/
/* Framework's phy start address is 0x0077440.
* Flash size = 0x00B6000-0x0077440 = 250K
* Code size = 250K*32/34=235K
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x0070400, LENGTH = 235K
ram (rwx): ORIGIN = 0x00404020, LENGTH = 48k
}
#endif

View file

@ -0,0 +1,156 @@
#ifdef MBEDTLS_IN_KERNEL
/*
* +------------+ 0x00400000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* app: |
* data | app:16k
* bss |
* +------------+ 0x00404020
* framework: |
* data | framework:48k
* bss |
* +------------+ 0x00410020
* data |
* end
* |(heap) |
* . . 256k - 64k - 32
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom |
* +------------+
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* +------------+ 0x0013200
* |vectors |
* | |
* |------------+
* |text |
* |data | kernel:455K
* | |
* +------------+ 0x0085000
* +------------+ 0x0085140
* |text |
* |data | framework:159k
* | |
* +------------+ 0x00AD000
* +------------+ 0x00AD300
* |text |
* |data | app:51k
* | |
* +------------+ 0x00BA000
* +------------+ 0x00BA340
* | |
* | |
* | OTA TEMP |
* | | 279k(MAX * 60%)
* | |
* | |
* +------------+ 0x100000
*/
/* kernel's phy start address is 0x13200.
* Flash size = 0x0085000-0x0013200 = 455K
* Code size = 455K*32/34=428K
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x00012000, LENGTH = 428k
ram (rwx): ORIGIN = 0x00410020, LENGTH = 256k - 64k - 32
}
#else
/*
* +------------+ 0x00400000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* app: |
* data | app:16k
* bss |
* +------------+ 0x00404020
* framework: |
* data | framework:48k
* bss |
* +------------+ 0x00410020
* data |
* end
* |(heap) |
* . . 256k - 64k - 32
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom |
* +------------+
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* | Para 3 | 4k
* +------------+ 0x0013000
* +------------+ 0x0013200
* |vectors |
* | |
* |------------+
* |text |
* |data | kernel:399k
* | |
* +------------+ 0x0077000
* +------------+ 0x0077440
* |text |
* |data | framework:250k
* | |
* +------------+ 0x00B6000
* +------------+ 0X00B6380
* |text |
* |data | app:55k
* | |
* +------------+ 0x00c4000
* +------------+ 0x00c4080
* | |
* | |
* | OTA TEMP |
* | | 363k
* | |
* | |
* +------------+ 0x100000
*/
/* kernel's phy start address is 0x13200.
* Flash size = 0x0077000-0x0013200 = 399K
* Code size = 399K*32/34=375K
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x00012000, LENGTH = 375k
ram (rwx): ORIGIN = 0x00410020, LENGTH = 256k - 64k - 32
}
#endif

View file

@ -0,0 +1,40 @@
NAME := board_mk3060
JTAG := jlink
$(NAME)_TYPE := kernel
MODULE := EMW3060
HOST_ARCH := ARM968E-S
HOST_MCU_FAMILY := moc108
SUPPORT_BINS := no
$(NAME)_SOURCES := board.c \
hal_pwm.c
GLOBAL_INCLUDES += .
GLOBAL_DEFINES += STDIO_UART=0
CONFIG_SYSINFO_PRODUCT_MODEL := ALI_AOS_MK3060
CONFIG_SYSINFO_DEVICE_NAME := MK3060
GLOBAL_CFLAGS += -DSYSINFO_PRODUCT_MODEL=\"$(CONFIG_SYSINFO_PRODUCT_MODEL)\"
GLOBAL_CFLAGS += -DSYSINFO_DEVICE_NAME=\"$(CONFIG_SYSINFO_DEVICE_NAME)\"
#GLOBAL_CFLAGS += -DSYSINFO_KERNEL_VERSION=\"$(CONFIG_SYSINFO_KERNEL_VERSION)\"
#GLOBAL_CFLAGS += -DSYSINFO_APP_VERSION=\"$(CONFIG_SYSINFO_APP_VERSION)\"
ifeq ($(BINS),)
GLOBAL_LDS_INCLUDES += $(SOURCE_ROOT)/board/mk3060/memory.ld.S
else ifeq ($(BINS),app)
GLOBAL_LDS_INCLUDES += $(SOURCE_ROOT)/board/mk3060/memory_app.ld.S
else ifeq ($(BINS),framework)
GLOBAL_LDS_INCLUDES += $(SOURCE_ROOT)/board/mk3060/memory_framework.ld.S
else ifeq ($(BINS),kernel)
GLOBAL_LDS_INCLUDES += $(SOURCE_ROOT)/board/mk3060/memory_kernel.ld.S
endif
# Extra build target in mico_standard_targets.mk, include bootloader, and copy output file to eclipse debug file (copy_output_for_eclipse)
EXTRA_TARGET_MAKEFILES += $(MAKEFILES_PATH)/aos_standard_targets.mk
EXTRA_TARGET_MAKEFILES += $(SOURCE_ROOT)/platform/mcu/$(HOST_MCU_FAMILY)/gen_crc_bin.mk
GLOBAL_DEFINES += BOARD_MK3060

View file

@ -0,0 +1,6 @@
src = ['board.c']
component = aos_board_component('board_mk3060', 'moc108', src)
aos_global_config.add_ld_files('memory.ld.S')
linux_only_targets="living_platform linkkit_gateway"