2013-07-17 13:37:31 +08:00
|
|
|
/*
|
2021-04-09 10:52:34 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2013-07-17 13:37:31 +08:00
|
|
|
*
|
2021-04-09 10:52:34 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2013-07-17 13:37:31 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2013-7-14 Peng Fan Modified from mini4020
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rthw.h>
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
#include <board.h>
|
2024-09-14 05:40:40 +08:00
|
|
|
#include <drivers/dev_serial.h>
|
2013-07-17 13:37:31 +08:00
|
|
|
#ifdef RT_USING_FINSH
|
|
|
|
#include <finsh.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef RT_USING_LWIP
|
|
|
|
#include <lwip/sys.h>
|
|
|
|
#include <netif/ethernetif.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <sep6200.h>
|
|
|
|
|
|
|
|
rt_uint8_t _irq_stack_start[1024];
|
|
|
|
rt_uint8_t _fiq_stack_start[1024];
|
|
|
|
rt_uint8_t _undefined_stack_start[512];
|
|
|
|
rt_uint8_t _abort_stack_start[512];
|
2022-12-12 02:12:03 +08:00
|
|
|
rt_uint8_t _priv_stack_start[4096]; rt_section(".nobss");
|
2013-07-17 13:37:31 +08:00
|
|
|
extern unsigned char __bss_start;
|
|
|
|
extern unsigned char __bss_end;
|
|
|
|
|
|
|
|
|
|
|
|
extern void rt_hw_board_init(void);
|
|
|
|
extern void rt_application_init(void);
|
2017-07-29 14:21:40 +08:00
|
|
|
extern int finsh_system_init(void);
|
2013-07-17 13:37:31 +08:00
|
|
|
extern void sd_init(void);
|
|
|
|
|
|
|
|
void rtthread_startup()
|
|
|
|
{
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init hardware interrupt */
|
|
|
|
rt_hw_interrupt_init();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init board */
|
|
|
|
rt_hw_board_init();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* show version */
|
|
|
|
rt_show_version();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init timer system */
|
|
|
|
rt_system_timer_init();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init heap memory system */
|
|
|
|
rt_system_heap_init(&__bss_end, (void*)0x45000000);
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init scheduler system */
|
|
|
|
rt_system_scheduler_init();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init application */
|
|
|
|
rt_application_init();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
|
|
|
#ifdef RT_USING_FINSH
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init finsh */
|
|
|
|
finsh_system_init();
|
2022-01-03 06:51:44 +08:00
|
|
|
#if !defined(RT_USING_POSIX_STDIO) && defined(RT_USING_DEVICE)
|
2021-04-09 10:52:34 +08:00
|
|
|
finsh_set_device("uart0");
|
2013-07-17 13:37:31 +08:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
rt_system_timer_thread_init();
|
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* init idle thread */
|
|
|
|
rt_thread_idle_init();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* start scheduler */
|
|
|
|
rt_system_scheduler_start();
|
2013-07-17 13:37:31 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
/* never reach here */
|
|
|
|
return ;
|
2013-07-17 13:37:31 +08:00
|
|
|
|
|
|
|
}
|