diff --git a/configs/sam4s-xplained-pro/nsh/defconfig b/configs/sam4s-xplained-pro/nsh/defconfig index f4ba2b6a8f..21c24a4e33 100644 --- a/configs/sam4s-xplained-pro/nsh/defconfig +++ b/configs/sam4s-xplained-pro/nsh/defconfig @@ -125,12 +125,12 @@ CONFIG_ARCH_CORTEXM4=y # CONFIG_ARCH_CORTEXA8 is not set CONFIG_ARCH_FAMILY="armv7-m" CONFIG_ARCH_CHIP="sam34" -# CONFIG_ARMV7M_USEBASEPRI is not set +CONFIG_ARMV7M_USEBASEPRI=y # CONFIG_ARCH_HAVE_FPU is not set CONFIG_ARCH_HAVE_MPU=y CONFIG_ARMV7M_MPU=y CONFIG_ARMV7M_MPU_NREGIONS=8 -# CONFIG_DEBUG_HARDFAULT is not set +CONFIG_DEBUG_HARDFAULT=y # # ARMV7M Configuration Options @@ -241,8 +241,8 @@ CONFIG_SAM34_EXTNANDSIZE=268435456 # AT91SAM3/4 GPIO Interrupt Configuration # CONFIG_SAM34_GPIO_IRQ=y -CONFIG_SAM34_GPIOA_IRQ=y -CONFIG_SAM34_GPIOB_IRQ=y +# CONFIG_SAM34_GPIOA_IRQ is not set +# CONFIG_SAM34_GPIOB_IRQ is not set CONFIG_SAM34_GPIOC_IRQ=y # @@ -408,7 +408,7 @@ CONFIG_NAME_MAX=32 # # RTOS hooks # -# CONFIG_BOARD_INITIALIZE is not set +CONFIG_BOARD_INITIALIZE=y # CONFIG_SCHED_STARTHOOK is not set # CONFIG_SCHED_ATEXIT is not set # CONFIG_SCHED_ONEXIT is not set diff --git a/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h b/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h index c5efc2c605..88aaae719a 100644 --- a/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h +++ b/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h @@ -86,7 +86,7 @@ /* We need PIO interrupts on PIOC to support card detect interrupts */ -#if defined(HAVE_HSMCI) && !defined(CONFIG_GPIOC_IRQ) +#if defined(HAVE_HSMCI) && !defined(CONFIG_SAM34_GPIOC_IRQ) # warning PIOC interrupts not enabled. No MMC/SD support. # undef HAVE_HSMCI #endif diff --git a/configs/sam4s-xplained-pro/src/sam_boot.c b/configs/sam4s-xplained-pro/src/sam_boot.c index 3e4f7128a4..8c06ca825d 100644 --- a/configs/sam4s-xplained-pro/src/sam_boot.c +++ b/configs/sam4s-xplained-pro/src/sam_boot.c @@ -40,6 +40,7 @@ #include #include +#include #include "sam4s-xplained-pro.h" @@ -73,3 +74,27 @@ void sam_boardinitialize(void) board_led_initialize(); #endif } + + +/**************************************************************************** + * Name: board_initialize + * + * Description: + * If CONFIG_BOARD_INITIALIZE is selected, then an additional + * initialization call will be performed in the boot-up sequence to a + * function called board_initialize(). board_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_INITIALIZE +void board_initialize(void) +{ +#if (defined(CONFIG_SAM34_WDT) && !defined(CONFIG_WDT_DISABLE_ON_RESET)) + /* Enable watchdog timer kicker kernel thread. */ + + DEBUGASSERT(up_wdginitialize() >= 0); +#endif +} +#endif /* CONFIG_BOARD_INITIALIZE */ diff --git a/configs/sam4s-xplained-pro/src/sam_nsh.c b/configs/sam4s-xplained-pro/src/sam_nsh.c index 9ecd00d6b6..bbca0dd81e 100644 --- a/configs/sam4s-xplained-pro/src/sam_nsh.c +++ b/configs/sam4s-xplained-pro/src/sam_nsh.c @@ -112,7 +112,7 @@ int nsh_archinitialize(void) ret = cdcacm_initialize(CONFIG_SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR, NULL); if (ret < 0) { - message("ERROR: Failed to create the CDC/ACM serial device: %d\n", errno); + message("ERROR: Failed to create the CDC/ACM serial device: %d (%d)\n", ret, errno); return ret; } #endif @@ -124,7 +124,7 @@ int nsh_archinitialize(void) ret = sam_hsmci_initialize(); if (ret < 0) { - message("ERROR: sam_hsmci_initialize() failed: %d\n", ret); + message("ERROR: sam_hsmci_initialize() failed: %d (%d)\n", ret, errno); return ret; } #endif @@ -136,7 +136,7 @@ int nsh_archinitialize(void) ret = mount(NULL, "/proc", "procfs", 0, NULL); if (ret < 0) { - message("ERROR: Failed to mount the PROC filesystem: %d\n", errno); + message("ERROR: Failed to mount the PROC filesystem: %d (%d)\n", ret, errno); return ret; } #endif @@ -146,7 +146,7 @@ int nsh_archinitialize(void) ret = mount("/dev/mmcsd0", "/fat", "vfat", 0, NULL); if (ret < 0) { - message("ERROR: Failed to mount the FAT filesystem: %d\n", errno); + message("ERROR: Failed to mount the FAT filesystem: %d (%d)\n", ret, errno); return ret; } #endif @@ -164,7 +164,7 @@ int nsh_archinitialize(void) ret = usbmonitor_start(0, NULL); if (ret != OK) { - message("nsh_archinitialize: Start USB monitor: %d\n", ret); + message("nsh_archinitialize: Start USB monitor: %d (%d)\n", ret, errno); return ret; } #endif diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index dceee8ab15..d8bb769928 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -158,7 +158,7 @@ void up_initialize(void); * If CONFIG_BOARD_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a * function called board_initialize(). board_initialize() will be - * called immediately after up_intiialize() is called and just before the + * 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. *