diff --git a/configs/sam4s-xplained-pro/Kconfig b/configs/sam4s-xplained-pro/Kconfig index dd2134c3a0..cce0f48a8e 100644 --- a/configs/sam4s-xplained-pro/Kconfig +++ b/configs/sam4s-xplained-pro/Kconfig @@ -10,9 +10,15 @@ config SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR default 0 depends on SAM34_UDP && USBDEV && CDCACM +config SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH + string "Scheduler Timer Device Path" + default "/dev/tc0" + depends on TIMER && SYSTEMTICK_EXTCLK + config SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH string "CPU Load Timer Device Path" - default "/dev/tc0" + default "/dev/tc1" depends on TIMER && SCHED_CPULOAD && SCHED_CPULOAD_EXTCLK + endif diff --git a/configs/sam4s-xplained-pro/nsh/defconfig b/configs/sam4s-xplained-pro/nsh/defconfig index 25c41d06a8..dbf11c354b 100644 --- a/configs/sam4s-xplained-pro/nsh/defconfig +++ b/configs/sam4s-xplained-pro/nsh/defconfig @@ -212,7 +212,7 @@ CONFIG_SAM34_SMC=y # CONFIG_SAM34_SPI0 is not set # CONFIG_SAM34_SSC is not set CONFIG_SAM34_TC0=y -# CONFIG_SAM34_TC1 is not set +CONFIG_SAM34_TC1=y # CONFIG_SAM34_TC2 is not set # CONFIG_SAM34_TC3 is not set # CONFIG_SAM34_TC4 is not set @@ -342,7 +342,8 @@ CONFIG_NSH_MMCSDSLOTNO=0 # Board-Specific Options # CONFIG_SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR=0 -CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH="/dev/tc0" +CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH="/dev/tc0" +CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH="/dev/tc1" # # RTOS Features @@ -359,6 +360,7 @@ CONFIG_DISABLE_ENVIRON=y # Clocks and Timers # CONFIG_MSEC_PER_TICK=10 +CONFIG_SYSTEMTICK_EXTCLK=y # CONFIG_SYSTEM_TIME64 is not set # CONFIG_CLOCK_MONOTONIC is not set CONFIG_JULIAN_TIME=y diff --git a/configs/sam4s-xplained-pro/src/sam_boot.c b/configs/sam4s-xplained-pro/src/sam_boot.c index 8c06ca825d..cda18efb14 100644 --- a/configs/sam4s-xplained-pro/src/sam_boot.c +++ b/configs/sam4s-xplained-pro/src/sam_boot.c @@ -92,9 +92,16 @@ void sam_boardinitialize(void) void board_initialize(void) { #if (defined(CONFIG_SAM34_WDT) && !defined(CONFIG_WDT_DISABLE_ON_RESET)) - /* Enable watchdog timer kicker kernel thread. */ + /* Configure watchdog timer and enable kicker kernel thread. */ DEBUGASSERT(up_wdginitialize() >= 0); #endif + +#ifdef CONFIG_TIMER + /* Registers the timers and starts any async processes (which may include the scheduler) */ + + sam_timerinitialize(); +#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 bbca0dd81e..cc7a66c376 100644 --- a/configs/sam4s-xplained-pro/src/sam_nsh.c +++ b/configs/sam4s-xplained-pro/src/sam_nsh.c @@ -151,12 +151,6 @@ int nsh_archinitialize(void) } #endif -#ifdef CONFIG_TIMER - /* Registers the timer driver and starts an async interrupt. */ - - sam_timerinitialize(); -#endif - #ifdef HAVE_USBMONITOR /* Start the USB Monitor */