From fce118bce96f141b982c3fae3a86adf0a3785341 Mon Sep 17 00:00:00 2001 From: Louie Lu Date: Thu, 6 Oct 2016 13:31:10 +0800 Subject: [PATCH 1/2] Add user apps Kconfig for settings In this moment, build system will build all program in folder user/apps, but this may cause unexpected effect, for example, let kdb unusable in UART. So, we can add a new kconfig file for apps like test cases or real user program like pingpong, and thus rename menu title from "Test Case" to "User Space". And add submenu "Apps" and "Test Cases" for now. The structure look like this: - User Space - [ ] enabled user apps for f9-kernel - Apps - Test Cases --- user/Kconfig | 17 ++++++++++++----- user/Kconfig.apps | 12 ++++++++++++ user/Kconfig.tests | 21 +++++++++++++++++++++ user/apps/build.mk | 22 ++++++++++++++++------ 4 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 user/Kconfig.apps create mode 100644 user/Kconfig.tests diff --git a/user/Kconfig b/user/Kconfig index 055e6d3e..7c5a88af 100644 --- a/user/Kconfig +++ b/user/Kconfig @@ -1,11 +1,18 @@ -# Copyright (c) 2015 The F9 Microkernel Project. All rights reserved. +# Copyright (c) 2015-2017 The F9 Microkernel Project. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -menu "Test Case" -config EXTI_INTERRUPT_TEST - bool "EXTI interrupt test case" +menu "User Space" + +config BUILD_USER_APPS + bool "Build user applications for F9 microkernel" default n - depends on EXTI0_USER_IRQ && EXTI1_USER_IRQ + ---help--- + Enable this options to will compile userspace apps + into f9-kernel, This may let you unable to use kdb. + +source "user/Kconfig.apps" + +source "user/Kconfig.tests" endmenu diff --git a/user/Kconfig.apps b/user/Kconfig.apps new file mode 100644 index 00000000..c060ac14 --- /dev/null +++ b/user/Kconfig.apps @@ -0,0 +1,12 @@ +# Copyright (c) 2016 The F9 Microkernel Project. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +menu "Apps" + depends on BUILD_USER_APPS + +config PINGPONG + bool "Pingpong game" + default n + +endmenu diff --git a/user/Kconfig.tests b/user/Kconfig.tests new file mode 100644 index 00000000..59209b75 --- /dev/null +++ b/user/Kconfig.tests @@ -0,0 +1,21 @@ +# Copyright (c) 2016 The F9 Microkernel Project. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +menu "Test Cases" + depends on BUILD_USER_APPS + +config EXTI_INTERRUPT_TEST + bool "EXTI interrupt test case" + default n + depends on EXTI0_USER_IRQ && EXTI1_USER_IRQ + +config L4_TEST + bool "L4 Test Cases" + default n + +config LCD_TEST + bool "LCD Test Cases" + default n + +endmenu diff --git a/user/apps/build.mk b/user/apps/build.mk index 6790f14d..1115924e 100644 --- a/user/apps/build.mk +++ b/user/apps/build.mk @@ -1,17 +1,27 @@ -# Copyright (c) 2013 The F9 Microkernel Project. All rights reserved. +# Copyright (c) 2013,2017 The F9 Microkernel Project. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -user-apps-dirs = \ - l4test \ - pingpong +ifdef CONFIG_BUILD_USER_APPS + +user-apps-dirs = "" + +ifdef CONFIG_L4_TEST +user-apps-dirs += \ + l4test +endif +ifdef CONFIG_PINGPONG +user-apps-dirs += \ + pingpong +endif ifdef CONFIG_EXTI_INTERRUPT_TEST user-apps-dirs += \ irq_test -else -ifdef CONFIG_BOARD_STM32F429DISCOVERY +endif + +ifdef CONFIG_LCD_TEST user-apps-dirs += \ lcd_test endif From 53c293ddb97b866be7c1c90bd7b5bba778855d1f Mon Sep 17 00:00:00 2001 From: Louie Lu Date: Thu, 6 Oct 2016 13:33:16 +0800 Subject: [PATCH 2/2] board: Update all board defconfig --- board/discoveryf4/defconfig | 17 +++++++++++++++++ board/discoveryf429/defconfig | 14 +++++++++++++- board/stm32p103/defconfig | 14 +++++++++++++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/board/discoveryf4/defconfig b/board/discoveryf4/defconfig index 61659c01..cfee560a 100644 --- a/board/discoveryf4/defconfig +++ b/board/discoveryf4/defconfig @@ -148,3 +148,20 @@ CONFIG_PANIC_DUMP_STACK=y # CONFIG_CRYP_USER_IRQ is not set # CONFIG_HASH_RNG_USER_IRQ is not set # CONFIG_FPU_USER_IRQ is not set + +# +# User Space +# +CONFIG_BUILD_USER_APPS=y + +# +# Apps +# +CONFIG_PINGPONG=y + +# +# Test Cases +# +# CONFIG_EXTI_INTERRUPT_TEST is not set +CONFIG_L4_TEST=y +# CONFIG_LCD_TEST is not set diff --git a/board/discoveryf429/defconfig b/board/discoveryf429/defconfig index b96ea5c4..c217f18a 100644 --- a/board/discoveryf429/defconfig +++ b/board/discoveryf429/defconfig @@ -150,6 +150,18 @@ CONFIG_PANIC_DUMP_STACK=y # CONFIG_LOADER is not set # -# Test Case +# User Space +# +CONFIG_BUILD_USER_APPS=y + +# +# Apps +# +CONFIG_PINGPONG=y + +# +# Test Cases # CONFIG_EXTI_INTERRUPT_TEST=y +CONFIG_L4_TEST=y +CONFIG_LCD_TEST=y diff --git a/board/stm32p103/defconfig b/board/stm32p103/defconfig index f6e589cf..45fe5d7a 100644 --- a/board/stm32p103/defconfig +++ b/board/stm32p103/defconfig @@ -112,6 +112,18 @@ CONFIG_PANIC_DUMP_STACK=y # CONFIG_LOADER is not set # -# Test Case +# User Space +# +CONFIG_BUILD_USER_APPS=y + +# +# Apps +# +CONFIG_PINGPONG=y + +# +# Test Cases # CONFIG_EXTI_INTERRUPT_TEST=y +CONFIG_L4_TEST=y +# CONFIG_LCD_TEST is not set