Merge branch 'prepare_for_master' of https://git.trustie.net/xuos/xiuos into prepare_for_master

This commit is contained in:
wgzAIIT
2022-11-02 09:34:43 +08:00
237 changed files with 103103 additions and 28 deletions
+14
View File
@@ -0,0 +1,14 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if ARCH_BOARD_HC32F4A0
config HC32F4A0_BOARD
bool "HDSC HC32F4A0 base board"
default n
---help---
Select if you are using the HC32F4A0 base board with the HC32F4A0.
endif
@@ -0,0 +1,28 @@
README
======
This README discusses issues unique to NuttX configurations for the
HC32F4A0 development board featuring the HC32F4A0 MCU.
The board features:
NOTE: This port was developed on the original board
ways:
Contents
========
- UARTs
- HC32F4A0-specific Configuration Options
- BASIC
- Testing LLVM LIBC++ with NuttX
- Configurations
UARTs
=====
UART/USART PINS
---------------
Default USART/UART Configuration
--------------------------------
@@ -0,0 +1,54 @@
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
# CONFIG_ARCH_FPU is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ADD_NUTTX_FETURES=y
CONFIG_ARCH="arm"
CONFIG_ARCH_ARMV7M=y
CONFIG_ARCH_CORTEXM4=y
CONFIG_ARCH_FAMILY="armv7-m"
CONFIG_ARM_THUMB=y
CONFIG_ARCH_BOARD="hc32f4a0"
CONFIG_ARCH_BOARD_HC32F4A0=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="hc32"
CONFIG_ARCH_CHIP_HC32=y
CONFIG_ARCH_CHIP_HC32F4A0=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_TOOLCHAIN_GNU=y
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
CONFIG_HC32F4A0_BOARD=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BUILTIN=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_FS_PROCFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_INTELHEX_BINARY=y
CONFIG_MM_REGIONS=1
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSTEM_NSH=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_USART6_SERIAL_CONSOLE=y
CONFIG_HC32_UART6=y
CONFIG_HC32_UART6_SERIALDRIVER=y
CONFIG_UART6_SERIAL_CONSOLE=y
@@ -0,0 +1,94 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/include/board.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/**
* @file board.h
* @brief nuttx source code
* https://github.com/apache/incubator-nuttx.git
* @version 10.3.0
* @author AIIT XUOS Lab
* @date 2022-10-10
*/
#ifndef __BOARDS_ARM_HC32_HC32F4A0_INCLUDE_BOARD_H
#define __BOARDS_ARM_HC32_HC32F4A0_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
# include <stdbool.h>
#endif
/* Do not include HC32-specific header files here */
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define LED_GREEN_PORT (GPIO_PORT_I)
#define LED_GREEN_PIN (GPIO_PIN_03)
/* Key port&pin definition */
#define KEY_PORT (GPIO_PORT_I)
#define KEY_PIN (GPIO_PIN_07)
/* for lowputc device output */
/* UART RX/TX Port/Pin definition */
#define LP_RX_PORT (GPIO_PORT_H) /* PH6: USART6_RX */
#define LP_RX_PIN (GPIO_PIN_06)
#define LP_RX_GPIO_FUNC (GPIO_FUNC_37_USART6_RX)
#define LP_TX_PORT (GPIO_PORT_E) /* PE6: USART6_TX */
#define LP_TX_PIN (GPIO_PIN_06)
#define LP_TX_GPIO_FUNC (GPIO_FUNC_36_USART6_TX)
/* UART unit definition */
#define LP_UNIT (M4_USART6)
#define LP_FUNCTION_CLK_GATE (PWC_FCG3_USART6)
/* UART unit interrupt definition */
#define LP_UNIT_ERR_INT_SRC (INT_USART6_EI)
#define LP_UNIT_ERR_INT_IRQn (Int015_IRQn + HC32_IRQ_FIRST)
#define LP_UNIT_RX_INT_SRC (INT_USART6_RI)
#define LP_UNIT_RX_INT_IRQn (Int103_IRQn + HC32_IRQ_FIRST)
#define LP_UNIT_TX_INT_SRC (INT_USART6_TI)
#define LP_UNIT_TX_INT_IRQn (Int102_IRQn + HC32_IRQ_FIRST)
#define LP_UNIT_TCI_INT_SRC (INT_USART6_TCI)
#define LP_UNIT_TCI_INT_IRQn (Int099_IRQn + HC32_IRQ_FIRST)
/* printf device s*/
#define BSP_PRINTF_DEVICE LP_UNIT
#define BSP_PRINTF_BAUDRATE (115200)
#define BSP_PRINTF_PORT LP_TX_PORT
#define BSP_PRINTF_PIN LP_TX_PIN
#define BSP_PRINTF_PORT_FUNC LP_TX_GPIO_FUNC
#endif /* __BOARDS_ARM_HC32_HC32F4A0_INCLUDE_BOARD_H */
@@ -0,0 +1,92 @@
############################################################################
# boards/arm/hc32/hc32f4a0/kernel/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(TOPDIR)/Make.defs
# The entry point name (if none is provided in the .config file)
CONFIG_INIT_ENTRYPOINT ?= user_start
ENTRYPT = $(patsubst "%",%,$(CONFIG_INIT_ENTRYPOINT))
# Get the paths to the libraries and the links script path in format that
# is appropriate for the host OS
USER_LIBPATHS = $(addprefix -L,$(call CONVERT_PATH,$(addprefix $(TOPDIR)$(DELIM),$(dir $(USERLIBS)))))
USER_LDSCRIPT = -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)memory.ld)
USER_LDSCRIPT += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)user-space.ld)
USER_HEXFILE += $(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx_user.hex)
USER_SRECFILE += $(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx_user.srec)
USER_BINFILE += $(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx_user.bin)
USER_LDFLAGS = --undefined=$(ENTRYPT) --entry=$(ENTRYPT) $(USER_LDSCRIPT)
USER_LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(USERLIBS))))
USER_LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
# Source files
CSRCS = stm32_userspace.c
COBJS = $(CSRCS:.c=$(OBJEXT))
OBJS = $(COBJS)
# Targets:
all: $(TOPDIR)$(DELIM)nuttx_user.elf $(TOPDIR)$(DELIM)User.map
.PHONY: nuttx_user.elf depend clean distclean
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
# Create the nuttx_user.elf file containing all of the user-mode code
nuttx_user.elf: $(OBJS)
$(Q) $(LD) -o $@ $(USER_LDFLAGS) $(USER_LIBPATHS) $(OBJS) --start-group $(USER_LDLIBS) $(USER_LIBGCC) --end-group
$(TOPDIR)$(DELIM)nuttx_user.elf: nuttx_user.elf
@echo "LD: nuttx_user.elf"
$(Q) cp -a nuttx_user.elf $(TOPDIR)$(DELIM)nuttx_user.elf
ifeq ($(CONFIG_INTELHEX_BINARY),y)
@echo "CP: nuttx_user.hex"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex nuttx_user.elf $(USER_HEXFILE)
endif
ifeq ($(CONFIG_MOTOROLA_SREC),y)
@echo "CP: nuttx_user.srec"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec nuttx_user.elf $(USER_SRECFILE)
endif
ifeq ($(CONFIG_RAW_BINARY),y)
@echo "CP: nuttx_user.bin"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary nuttx_user.elf $(USER_BINFILE)
endif
$(TOPDIR)$(DELIM)User.map: nuttx_user.elf
@echo "MK: User.map"
$(Q) $(NM) nuttx_user.elf >$(TOPDIR)$(DELIM)User.map
$(Q) $(CROSSDEV)size nuttx_user.elf
.depend:
depend: .depend
clean:
$(call DELFILE, nuttx_user.elf)
$(call DELFILE, "$(TOPDIR)$(DELIM)nuttx_user.*")
$(call DELFILE, "$(TOPDIR)$(DELIM)User.map")
$(call CLEAN)
distclean: clean
@@ -0,0 +1,123 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/kernel/hc32_userspace.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/**
* @file hc32_userspace.c
* @brief nuttx source code
* https://github.com/apache/incubator-nuttx.git
* @version 10.3.0
* @author AIIT XUOS Lab
* @date 2022-03-17
*/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdlib.h>
#include <nuttx/arch.h>
#include <nuttx/mm/mm.h>
#include <nuttx/wqueue.h>
#include <nuttx/userspace.h>
#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_NUTTX_USERSPACE
# error "CONFIG_NUTTX_USERSPACE not defined"
#endif
#if CONFIG_NUTTX_USERSPACE != 0x20060000
# error "CONFIG_NUTTX_USERSPACE must be 0x20060000 to match memory.ld"
#endif
/****************************************************************************
* Public Data
****************************************************************************/
/* These 'addresses' of these values are setup by the linker script. They are
* not actual uint32_t storage locations! They are only used meaningfully in
* the following way:
*
* - The linker script defines, for example, the symbol_sdata.
* - The declaration extern uint32_t _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32_t variable _data (it
* is not!).
* - We can recover the linker value then by simply taking the address of
* of _data. like: uint32_t *pdata = &_sdata;
*/
extern uint32_t _stext; /* Start of .text */
extern uint32_t _etext; /* End_1 of .text + .rodata */
extern const uint32_t _eronly; /* End+1 of read only section (.text + .rodata) */
extern uint32_t _sdata; /* Start of .data */
extern uint32_t _edata; /* End+1 of .data */
extern uint32_t _sbss; /* Start of .bss */
extern uint32_t _ebss; /* End+1 of .bss */
/* This is the user space entry point */
int CONFIG_INIT_ENTRYPOINT(int argc, char *argv[]);
const struct userspace_s userspace locate_data(".userspace") =
{
/* General memory map */
.us_entrypoint = (main_t)CONFIG_INIT_ENTRYPOINT,
.us_textstart = (uintptr_t)&_stext,
.us_textend = (uintptr_t)&_etext,
.us_datasource = (uintptr_t)&_eronly,
.us_datastart = (uintptr_t)&_sdata,
.us_dataend = (uintptr_t)&_edata,
.us_bssstart = (uintptr_t)&_sbss,
.us_bssend = (uintptr_t)&_ebss,
/* Memory manager heap structure */
.us_heap = &g_mmheap,
/* Task/thread startup routines */
.task_startup = nxtask_startup,
/* Signal handler trampoline */
.signal_handler = up_signal_handler,
/* User-space work queue support (declared in include/nuttx/wqueue.h) */
#ifdef CONFIG_LIBC_USRWORK
.work_usrstart = work_usrstart,
#endif
};
/****************************************************************************
* Public Functions
****************************************************************************/
#endif /* CONFIG_BUILD_PROTECTED && !__KERNEL__ */
@@ -0,0 +1,86 @@
############################################################################
# boards/arm/hc32/hc32f4a0/scripts/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(TOPDIR)/.config
include $(TOPDIR)/tools/Config.mk
include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
LDSCRIPT = ld.script
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif
ARCHCFLAGS = -fno-common -ffunction-sections -fdata-sections
ARCHCXXFLAGS = -fno-common -ffunction-sections -fdata-sections
ifneq ($(CONFIG_CXX_EXCEPTION),y)
ARCHCXXFLAGS = -fno-exceptions -fcheck-new
endif
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANGL),y)
ARCHCFLAGS += -nostdlib -ffreestanding
ARCHCXXFLAGS += -nostdlib -ffreestanding
else
ARCHCFLAGS += -funwind-tables
ARCHCXXFLAGS += -fno-rtti -funwind-tables
endif
CFLAGS := $(APPPATHS) $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
LDFLAGS += --gc-sections
# Loadable module definitions
CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
LDMODULEFLAGS = -r -e module_initialize
LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld)
# ELF module definitions
CELFFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
@@ -0,0 +1,126 @@
/****************************************************************************
* boards/arm/stm32/aiit-arm32-board/scripts/gnu-elf.ld
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
SECTIONS
{
.text 0x00000000 :
{
_stext = . ;
*(.text)
*(.text.*)
*(.gnu.warning)
*(.stub)
*(.glue_7)
*(.glue_7t)
*(.jcr)
/* C++ support: The .init and .fini sections contain specific logic
* to manage static constructors and destructors.
*/
*(.gnu.linkonce.t.*)
*(.init) /* Old ABI */
*(.fini) /* Old ABI */
_etext = . ;
}
.ARM.extab :
{
*(.ARM.extab*)
}
.ARM.exidx :
{
*(.ARM.exidx*)
}
.rodata :
{
_srodata = . ;
*(.rodata)
*(.rodata1)
*(.rodata.*)
*(.gnu.linkonce.r*)
_erodata = . ;
}
.data :
{
_sdata = . ;
*(.data)
*(.data1)
*(.data.*)
*(.gnu.linkonce.d*)
. = ALIGN(4);
_edata = . ;
}
/* C++ support. For each global and static local C++ object,
* GCC creates a small subroutine to construct the object. Pointers
* to these routines (not the routines themselves) are stored as
* simple, linear arrays in the .ctors section of the object file.
* Similarly, pointers to global/static destructor routines are
* stored in .dtors.
*/
.ctors :
{
_sctors = . ;
*(.ctors) /* Old ABI: Unallocated */
*(.init_array) /* New ABI: Allocated */
_edtors = . ;
}
.dtors :
{
_sdtors = . ;
*(.dtors) /* Old ABI: Unallocated */
*(.fini_array) /* New ABI: Allocated */
_edtors = . ;
}
.bss :
{
_sbss = . ;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.b*)
*(COMMON)
. = ALIGN(4);
_ebss = . ;
}
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
@@ -0,0 +1,96 @@
/****************************************************************************
* boards/arm/stm32/aiit-arm32-board/scripts/kernel-space.ld
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/* NOTE: This depends on the memory.ld script having been included prior to
* this script.
*/
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > kflash
.init_section : {
_sinit = ABSOLUTE(.);
*(.init_array .init_array.*)
_einit = ABSOLUTE(.);
} > kflash
.ARM.extab : {
*(.ARM.extab*)
} > kflash
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > kflash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
.data : {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
. = ALIGN(4);
_edata = ABSOLUTE(.);
} > ksram AT > kflash
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > ksram
/* Stabs debugging sections */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
@@ -0,0 +1,123 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/scripts/ld.script
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/* The STM32F407VG has 1024Kb of FLASH beginning at address 0x0800:0000 and
* 192Kb of SRAM. SRAM is split up into three blocks:
*
* 1) 112Kb of SRAM beginning at address 0x2000:0000
* 2) 16Kb of SRAM beginning at address 0x2001:c000
* 3) 64Kb of CCM SRAM beginning at address 0x1000:0000
*
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
* where the code expects to begin execution by jumping to the entry point in
* the 0x0800:0000 address
* range.
*/
MEMORY
{
flash (rx) : ORIGIN = 0x00000000, LENGTH = 2M
sram (rwx) : ORIGIN = 0x1FFE0000, LENGTH = 512K
}
OUTPUT_ARCH(arm)
ENTRY(_stext)
EXTERN(_vectors)
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
.init_section : ALIGN(4) {
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
.ARM.extab : ALIGN(4) {
*(.ARM.extab*)
} > flash
.ARM.exidx : ALIGN(4) {
__exidx_start = ABSOLUTE(.);
*(.ARM.exidx*)
__exidx_end = ABSOLUTE(.);
} > flash
.tdata : {
_stdata = ABSOLUTE(.);
*(.tdata .tdata.* .gnu.linkonce.td.*);
_etdata = ABSOLUTE(.);
} > flash
.tbss : {
_stbss = ABSOLUTE(.);
*(.tbss .tbss.* .gnu.linkonce.tb.* .tcommon);
_etbss = ABSOLUTE(.);
} > flash
_eronly = ABSOLUTE(.);
.data : ALIGN(4) {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
. = ALIGN(4);
_edata = ABSOLUTE(.);
} > sram AT > flash
.bss : ALIGN(4) {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
@@ -0,0 +1,85 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/scripts/memory.ld
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/* The STM32F407VG has 1024Kb of FLASH beginning at address 0x0800:0000 and
* 192Kb of SRAM. SRAM is split up into three blocks:
*
* 1) 112KB of SRAM beginning at address 0x2000:0000
* 2) 16KB of SRAM beginning at address 0x2001:c000
* 3) 64KB of CCM SRAM beginning at address 0x1000:0000
*
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
* where the code expects to begin execution by jumping to the entry point in
* the 0x0800:0000 address range.
*
* For MPU support, the kernel-mode NuttX section is assumed to be 128Kb of
* FLASH and 4Kb of SRAM. That is an excessive amount for the kernel which
* should fit into 64KB and, of course, can be optimized as needed (See
* also boards/arm/stm32/aiit-arm32-board/scripts/kernel-space.ld). Allowing the
* additional does permit addition debug instrumentation to be added to the
* kernel space without overflowing the partition.
*
* Alignment of the user space FLASH partition is also a critical factor:
* The user space FLASH partition will be spanned with a single region of
* size 2**n bytes. The alignment of the user-space region must be the same.
* As a consequence, as the user-space increases in size, the alignment
* requirement also increases.
*
* This alignment requirement means that the largest user space FLASH region
* you can have will be 512KB at it would have to be positioned at
* 0x08800000. If you change this address, don't forget to change the
* CONFIG_NUTTX_USERSPACE configuration setting to match and to modify
* the check in kernel/userspace.c.
*
* For the same reasons, the maximum size of the SRAM mapping is limited to
* 4KB. Both of these alignment limitations could be reduced by using
* multiple regions to map the FLASH/SDRAM range or perhaps with some
* clever use of subregions.
*
* A detailed memory map for the 112KB SRAM region is as follows:
*
* 0x20000 0000: Kernel .data region. Typical size: 0.1KB
* ------- ---- Kernel .bss region. Typical size: 1.8KB
* 0x20000 0800: Kernel IDLE thread stack (approximate). Size is
* determined by CONFIG_IDLETHREAD_STACKSIZE and
* adjustments for alignment. Typical is 1KB.
* ------- ---- Padded to 4KB
* 0x20000 1000: User .data region. Size is variable.
* ------- ---- User .bss region Size is variable.
* 0x20000 2000: Beginning of kernel heap. Size determined by
* CONFIG_MM_KERNEL_HEAPSIZE.
* ------- ---- Beginning of user heap. Can vary with other settings.
* 0x20001 c000: End+1 of CPU RAM
*/
MEMORY
{
/* 2Mb FLASH */
kflash (rx) : ORIGIN = 0x00000000, LENGTH = 2M
uflash (rx) : ORIGIN = 0x00200000, LENGTH = 128K
xflash (rx) : ORIGIN = 0x00220000, LENGTH = 768K
/* 512Kb of contiguous SRAM */
ksram (rwx) : ORIGIN = 0x1FFE0000, LENGTH = 512K
usram (rwx) : ORIGIN = 0x20060000, LENGTH = 4K
xsram (rwx) : ORIGIN = 0x20062000, LENGTH = 4K
}
@@ -0,0 +1,98 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/scripts/user-space.ld
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/* NOTE: This depends on the memory.ld script having been included prior to
* this script.
*/
OUTPUT_ARCH(arm)
SECTIONS
{
.userspace : {
*(.userspace)
} > uflash
.text : {
_stext = ABSOLUTE(.);
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > uflash
.init_section : {
_sinit = ABSOLUTE(.);
*(.init_array .init_array.*)
_einit = ABSOLUTE(.);
} > kflash
.ARM.extab : {
*(.ARM.extab*)
} > kflash
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > kflash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
.data : {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
. = ALIGN(4);
_edata = ABSOLUTE(.);
} > ksram AT > kflash
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > ksram
/* Stabs debugging sections */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}
@@ -0,0 +1,32 @@
############################################################################
# boards/arm/hc32/hc32f4a0/src/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(TOPDIR)/Make.defs
CSRCS = hc32_bringup.c hc32_appinit.c hc32_boot.c
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS +=
endif
DEPPATH += --dep-path board
VPATH += :board
CFLAGS += $(shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
@@ -0,0 +1,115 @@
hc32_boot.o: hc32_boot.c \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/config.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/debug.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/compiler.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/syslog.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdint.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/types.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/inttypes.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/limits.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/limits.h \
/usr/local/arm/gcc-arm-none-eabi-6-2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include/stdarg.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdbool.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/sys/uio.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/sys/types.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/board.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/board/board.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/common/arm_internal.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/arch.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/arch.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/pgalloc.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/addrenv.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/cache.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/sched.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/queue.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/sched.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/strings.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/string.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stddef.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/time.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/queue.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/signal.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/semaphore.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/clock.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/chip/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/armv7-m/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/armv7-m/nvicpri.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/chip/chip.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/armv7-m/irq_cmnvector.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/tls.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/pthread.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/unistd.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/wdog.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/mm/shm.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/mm/gran.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/fs/fs.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/semaphore.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/errno.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/net/net.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/armv7-m/nvic.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/armv7-m/itm.h
hc32_appinit.o: hc32_appinit.c \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/config.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/board.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdint.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/compiler.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/types.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/inttypes.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/limits.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/limits.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdbool.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/chip/hc32f4a0.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/chip/core_cm4.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/armv7-m/itm.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/chip/cmsis_version.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/chip/cmsis_compiler.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/chip/cmsis_gcc.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/arm/src/chip/mpu_armv7.h
hc32_bringup.o: hc32_bringup.c \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/config.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdbool.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/compiler.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdint.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/types.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/inttypes.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/limits.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/limits.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stdio.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/sys/types.h \
/usr/local/arm/gcc-arm-none-eabi-6-2017-q1-update/lib/gcc/arm-none-eabi/6.3.1/include/stdarg.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/time.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/fs/fs.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/semaphore.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/errno.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/semaphore.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/clock.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/sched.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/queue.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/sched.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/strings.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/string.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/stddef.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/queue.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/signal.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/chip/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/armv7-m/irq.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/armv7-m/nvicpri.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/chip/chip.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/armv7-m/irq_cmnvector.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/tls.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/pthread.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/unistd.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/wdog.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/mm/shm.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/mm/gran.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/net/net.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/arch/arch.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/pgalloc.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/addrenv.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/debug.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/syslog.h \
/home/hz/nuttx/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/sys/uio.h
@@ -0,0 +1,25 @@
############################################################################
# boards/arm/imxrt/xidatong-arm32/src/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include $(TOPDIR)/Make.defs
CSRCS = hc32_boot.c hc32_appinit.c hc32_bringup.c
include $(TOPDIR)/boards/Board.mk
@@ -0,0 +1,79 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/src/hc32_appinit.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/board.h>
#include "hc32f4a0.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef OK
# define OK 0
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value could be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
#ifdef CONFIG_BOARD_LATE_INITIALIZE
/* Board initialization already performed by board_late_initialize() */
return OK;
#else
/* Perform board-specific initialization */
return hc32_bringup();
#endif
}
@@ -0,0 +1,128 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/src/hc32_boot.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "arm_internal.h"
#include "nvic.h"
#include "itm.h"
/****************************************************************************
* Public Functions
****************************************************************************/
extern int hc32_bringup(void);
/****************************************************************************
* Name: hc32_boardinitialize
*
* Description:
* All HC32 architectures must provide the following entry point. This
* entry point is called early in the initialization -- after all memory
* has been configured and mapped but before any devices have been
* initialized.
*
****************************************************************************/
void hc32_boardinitialize(void)
{
//#ifdef CONFIG_SCHED_CRITMONITOR
// /* Enable ITM and DWT resources, if not left enabled by debugger. */
//
// modifyreg32(NVIC_DEMCR, 0, NVIC_DEMCR_TRCENA);
//
// /* Make sure the high speed cycle counter is running. It will be started
// * automatically only if a debugger is connected.
// */
//
// putreg32(0xc5acce55, ITM_LAR);
// modifyreg32(DWT_CTRL, 0, DWT_CTRL_CYCCNTENA_MASK);
//#endif
//
//#if defined(CONFIG_HC32_SPI1) || defined(CONFIG_HC32_SPI2) || defined(CONFIG_HC32_SPI3)
// /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak
// * function hc32_spidev_initialize() has been brought into the link.
// */
//
// if (hc32_spidev_initialize)
// {
// hc32_spidev_initialize();
// }
//#endif
//
//#ifdef CONFIG_HC32_OTGFS
// /* Initialize USB if the 1) OTG FS controller is in the configuration and
// * 2) disabled, and 3) the weak function hc32_usbinitialize() has been
// * brought into the build. Presumably either CONFIG_USBDEV or
// * CONFIG_USBHOST is also selected.
// */
//
// if (hc32_usbinitialize)
// {
// hc32_usbinitialize();
// }
//#endif
//
//#ifdef HAVE_NETMONITOR
// /* Configure board resources to support networking. */
//
// if (hc32_netinitialize)
// {
// hc32_netinitialize();
// }
//#endif
//
//#ifdef CONFIG_ARCH_LEDS
// /* Configure on-board LEDs if LED support has been selected. */
//
// board_autoled_initialize();
//#endif
}
/****************************************************************************
* Name: board_late_initialize
*
* Description:
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
* initialization call will be performed in the boot-up sequence to a
* function called board_late_initialize(). board_late_initialize() will be
* called immediately after up_initialize() is called and just before the
* initial application is started. This additional initialization phase
* may be used, for example, to initialize board-specific device drivers.
*
****************************************************************************/
#ifdef CONFIG_BOARD_LATE_INITIALIZE
void board_late_initialize(void)
{
/* Perform board-specific initialization */
hc32_bringup();
}
#endif
@@ -0,0 +1,53 @@
/****************************************************************************
* boards/arm/hc32/hc32f4a0/src/hc32f4a0_bringup.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdbool.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/fs/fs.h>
/****************************************************************************
* Name: hc32_bringup
*
* Description:
* Perform architecture-specific initialization
*
* CONFIG_BOARD_LATE_INITIALIZE=y :
* Called from board_late_initialize().
*
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_BOARDCTL=y :
* Called from the NSH library
*
****************************************************************************/
int hc32_bringup(void)
{
int ret = 0;
printf("start %s\n", __func__);
return ret;
}