[Fix] the problem of startup failure.
This commit is contained in:
parent
50bf490263
commit
eee1453c80
|
@ -45,11 +45,25 @@ uint32_t systick_config(uint32_t ticks)
|
||||||
|
|
||||||
void rt_hw_board_init()
|
void rt_hw_board_init()
|
||||||
{
|
{
|
||||||
|
rt_system_heap_init(heap, (uint8_t *)heap + sizeof(heap));
|
||||||
|
|
||||||
|
alarm_pool_init_default();
|
||||||
|
|
||||||
|
// Start and end points of the constructor list,
|
||||||
|
// defined by the linker script.
|
||||||
|
extern void (*__init_array_start)();
|
||||||
|
extern void (*__init_array_end)();
|
||||||
|
|
||||||
|
// Call each function in the list.
|
||||||
|
// We have to take the address of the symbols, as __init_array_start *is*
|
||||||
|
// the first function pointer, not the address of it.
|
||||||
|
for (void (**p)() = &__init_array_start; p < &__init_array_end; ++p) {
|
||||||
|
(*p)();
|
||||||
|
}
|
||||||
|
|
||||||
/* Configure the SysTick */
|
/* Configure the SysTick */
|
||||||
systick_config(frequency_count_khz(CLOCKS_FC0_SRC_VALUE_ROSC_CLKSRC)*10000/RT_TICK_PER_SECOND);
|
systick_config(frequency_count_khz(CLOCKS_FC0_SRC_VALUE_ROSC_CLKSRC)*10000/RT_TICK_PER_SECOND);
|
||||||
|
|
||||||
rt_system_heap_init(heap, (uint8_t *)heap + sizeof(heap));
|
|
||||||
|
|
||||||
stdio_init_all();
|
stdio_init_all();
|
||||||
rt_hw_uart_init();
|
rt_hw_uart_init();
|
||||||
|
|
||||||
|
|
|
@ -136,20 +136,6 @@ void runtime_init(void) {
|
||||||
|
|
||||||
spin_locks_reset();
|
spin_locks_reset();
|
||||||
irq_init_priorities();
|
irq_init_priorities();
|
||||||
alarm_pool_init_default();
|
|
||||||
|
|
||||||
// Start and end points of the constructor list,
|
|
||||||
// defined by the linker script.
|
|
||||||
extern void (*__init_array_start)();
|
|
||||||
extern void (*__init_array_end)();
|
|
||||||
|
|
||||||
// Call each function in the list.
|
|
||||||
// We have to take the address of the symbols, as __init_array_start *is*
|
|
||||||
// the first function pointer, not the address of it.
|
|
||||||
for (void (**p)() = &__init_array_start; p < &__init_array_end; ++p) {
|
|
||||||
(*p)();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _exit(int status) {
|
void _exit(int status) {
|
||||||
|
|
Loading…
Reference in New Issue