This is an automated email from the ASF dual-hosted git repository.

lupyuen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 5b0cae9ab0e8669ad2f6020e1ecb0e855b44c466
Author: Matteo Golin <[email protected]>
AuthorDate: Mon Feb 16 13:41:27 2026 -0500

    !apps: Simplify NuttX initialization
    
    BREAKING: In an effort to simplify board initialization logic for NuttX,
    NSH will no longer support architecture initialization. This will happen
    during boot via the BOARD_LATE_INITIALIZE option. The boardctl command
    BOARDIOC_INIT is also no longer available from user-space.
    
    Quick fix:
    Any application relying on BOARDIOC_INIT should now enable
    BOARD_LATE_INITIALIZE to have initialization performed by the kernel in
    advance of the application running. If control over initialization is
    still necessary, BOARDIOC_FINALINIT should be implemented and used.
    Boards relying on NSH for initialization should also enable
    BOARD_LATE_INITIALIZE instead.
    
    Signed-off-by: Matteo Golin <[email protected]>
---
 boot/miniboot/miniboot_main.c                 |  6 +-----
 boot/nxboot/nxboot_main.c                     |  6 ------
 examples/foc/foc_main.c                       | 10 ++--------
 examples/lvgldemo/lvgldemo.c                  | 24 ------------------------
 examples/lvglterm/lvglterm.c                  | 23 -----------------------
 examples/nimble/nimble_main.c                 |  6 ------
 examples/nimble_blecent/nimble_blecent_main.c |  8 +-------
 examples/nimble_bleprph/nimble_bleprph_main.c |  8 +-------
 examples/nxscope/nxscope_main.c               |  8 +-------
 examples/powerled/powerled_main.c             |  6 ------
 examples/smps/smps_main.c                     |  6 ------
 graphics/nxwm/src/nxwm_main.cxx               | 10 ----------
 graphics/twm4nx/Kconfig                       | 11 -----------
 graphics/twm4nx/src/twm4nx_main.cxx           | 17 -----------------
 nshlib/Kconfig                                | 12 +-----------
 nshlib/nsh.h                                  |  7 -------
 nshlib/nsh_init.c                             | 12 ------------
 system/adb/Kconfig                            |  9 +--------
 system/adb/adb_main.c                         |  7 +------
 system/adcscope/adcscope_main.c               |  8 +-------
 system/ofloader/ofloader.c                    | 10 ++--------
 system/sensorscope/sensorscope_main.c         |  8 +-------
 22 files changed, 13 insertions(+), 209 deletions(-)

diff --git a/boot/miniboot/miniboot_main.c b/boot/miniboot/miniboot_main.c
index 63f47465c..ce490c45b 100644
--- a/boot/miniboot/miniboot_main.c
+++ b/boot/miniboot/miniboot_main.c
@@ -39,7 +39,7 @@
  * Name: miniboot_main
  *
  * Description:
- *   Minimal bootlaoder entry point.
+ *   Minimal bootloader entry point.
  *
  ****************************************************************************/
 
@@ -49,10 +49,6 @@ int main(int argc, FAR char *argv[])
 
   syslog(LOG_INFO, "*** miniboot ***\n");
 
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
 #ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
diff --git a/boot/nxboot/nxboot_main.c b/boot/nxboot/nxboot_main.c
index 976b03b4c..0682b92c7 100644
--- a/boot/nxboot/nxboot_main.c
+++ b/boot/nxboot/nxboot_main.c
@@ -264,16 +264,10 @@ int main(int argc, FAR char *argv[])
   FAR struct boardioc_reset_cause_s cause;
 #endif
 
-#if defined(CONFIG_BOARDCTL) && !defined(CONFIG_NSH_ARCHINIT)
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
 #ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#endif
 #endif
 
   syslog(LOG_INFO, "*** nxboot ***\n");
diff --git a/examples/foc/foc_main.c b/examples/foc/foc_main.c
index 4b280e848..2f1b6b0c4 100644
--- a/examples/foc/foc_main.c
+++ b/examples/foc/foc_main.c
@@ -142,7 +142,7 @@ struct args_s g_args =
   }
 };
 
-/* Start allowed at defaule */
+/* Start allowed at default */
 
 static bool            g_start_allowed      = true;
 static pthread_mutex_t g_start_allowed_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -294,16 +294,10 @@ int main(int argc, char *argv[])
       goto errout_no_nxscope;
     }
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
-#  ifdef CONFIG_BOARDCTL_FINALINIT
+#ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#  endif
 #endif
 
   PRINTF("\nStart foc_main application!\n\n");
diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c
index 55d6620ed..b6ab1e5ab 100644
--- a/examples/lvgldemo/lvgldemo.c
+++ b/examples/lvgldemo/lvgldemo.c
@@ -38,23 +38,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* Should we perform board-specific driver initialization? There are two
- * ways that board initialization can occur:  1) automatically via
- * board_late_initialize() during bootupif CONFIG_BOARD_LATE_INITIALIZE
- * or 2).
- * via a call to boardctl() if the interface is enabled
- * (CONFIG_BOARDCTL=y).
- * If this task is running as an NSH built-in application, then that
- * initialization has probably already been performed otherwise we do it
- * here.
- */
-
-#undef NEED_BOARDINIT
-
-#if defined(CONFIG_BOARDCTL) && !defined(CONFIG_NSH_ARCHINIT)
-#  define NEED_BOARDINIT 1
-#endif
-
 /****************************************************************************
  * Private Types
  ****************************************************************************/
@@ -122,13 +105,6 @@ int main(int argc, FAR char *argv[])
       return -1;
     }
 
-#ifdef NEED_BOARDINIT
-  /* Perform board-specific driver initialization */
-
-  boardctl(BOARDIOC_INIT, 0);
-
-#endif
-
   lv_init();
 
   lv_nuttx_dsc_init(&info);
diff --git a/examples/lvglterm/lvglterm.c b/examples/lvglterm/lvglterm.c
index 71c5e650e..f1ef2259f 100644
--- a/examples/lvglterm/lvglterm.c
+++ b/examples/lvglterm/lvglterm.c
@@ -63,23 +63,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* Should we perform board-specific driver initialization?  There are two
- * ways that board initialization can occur:  1) automatically via
- * board_late_initialize() during bootupif CONFIG_BOARD_LATE_INITIALIZE
- * or 2).
- * via a call to boardctl() if the interface is enabled
- * (CONFIG_BOARDCTL=y).
- * If this task is running as an NSH built-in application, then that
- * initialization has probably already been performed otherwise we do it
- * here.
- */
-
-#undef NEED_BOARDINIT
-
-#if defined(CONFIG_BOARDCTL) && !defined(CONFIG_NSH_ARCHINIT)
-#  define NEED_BOARDINIT 1
-#endif
-
 /* How often to poll for output from NSH Shell (milliseconds) */
 
 #define TIMER_PERIOD_MS 100
@@ -550,16 +533,10 @@ int main(int argc, FAR char *argv[])
   uv_loop_t ui_loop;
 #endif
 
-#ifdef NEED_BOARDINIT
-  /* Perform board-specific driver initialization */
-
-  boardctl(BOARDIOC_INIT, 0);
-
 #ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#endif
 #endif
 
   /* LVGL initialization */
diff --git a/examples/nimble/nimble_main.c b/examples/nimble/nimble_main.c
index ba46199f7..68eb2f051 100644
--- a/examples/nimble/nimble_main.c
+++ b/examples/nimble/nimble_main.c
@@ -255,12 +255,6 @@ int main(int argc, FAR char *argv[])
       ble_hci_sock_set_device(atoi(argv[1]));
     }
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization */
-
-  boardctl(BOARDIOC_INIT, 0);
-#endif
-
 #ifndef CONFIG_NSH_NETINIT
   /* Bring up the network */
 
diff --git a/examples/nimble_blecent/nimble_blecent_main.c 
b/examples/nimble_blecent/nimble_blecent_main.c
index a20dd282d..5af9d2b03 100644
--- a/examples/nimble_blecent/nimble_blecent_main.c
+++ b/examples/nimble_blecent/nimble_blecent_main.c
@@ -412,7 +412,7 @@ static int blecent_gap_event(FAR struct ble_gap_event 
*event, FAR void *arg)
             return 0;
           }
 
-        /* An advertisment report was received during GAP discovery. */
+        /* An advertisement report was received during GAP discovery. */
 
         print_adv_fields(&fields);
 
@@ -632,12 +632,6 @@ int main(int argc, FAR char **argv)
       ble_hci_sock_set_device(atoi(argv[1]));
     }
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization */
-
-  boardctl(BOARDIOC_INIT, 0);
-#endif
-
 #ifndef CONFIG_NSH_NETINIT
   /* Bring up the network */
 
diff --git a/examples/nimble_bleprph/nimble_bleprph_main.c 
b/examples/nimble_bleprph/nimble_bleprph_main.c
index 9dea4d226..9c41f72b2 100644
--- a/examples/nimble_bleprph/nimble_bleprph_main.c
+++ b/examples/nimble_bleprph/nimble_bleprph_main.c
@@ -140,7 +140,7 @@ static void bleprph_advertise(void)
     BLE_HS_ADV_F_BREDR_UNSUP;
 
   /* Indicate that the TX power level field should be included; have the
-   * stack fill this value automatically.  This is done by assiging the
+   * stack fill this value automatically. This is done by assigning the
    * special value BLE_HS_ADV_TX_PWR_LVL_AUTO.
    */
 
@@ -372,12 +372,6 @@ int main(int argc, FAR char *argv[])
       ble_hci_sock_set_device(atoi(argv[1]));
     }
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization */
-
-  boardctl(BOARDIOC_INIT, 0);
-#endif
-
 #ifndef CONFIG_NSH_NETINIT
   /* Bring up the network */
 
diff --git a/examples/nxscope/nxscope_main.c b/examples/nxscope/nxscope_main.c
index afad9052b..1f4c9fff4 100644
--- a/examples/nxscope/nxscope_main.c
+++ b/examples/nxscope/nxscope_main.c
@@ -527,16 +527,10 @@ int main(int argc, FAR char *argv[])
   printf("stream interval = %d\n", env.interval);
   printf("main interval = %d\n", interval);
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
-#  ifdef CONFIG_BOARDCTL_FINALINIT
+#ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#  endif
 #endif
 
 #ifdef CONFIG_EXAMPLES_NXSCOPE_CDCACM
diff --git a/examples/powerled/powerled_main.c 
b/examples/powerled/powerled_main.c
index b949aadfa..6743b5e23 100644
--- a/examples/powerled/powerled_main.c
+++ b/examples/powerled/powerled_main.c
@@ -439,16 +439,10 @@ int main(int argc, char *argv[])
       goto errout;
     }
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
 #ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#endif
 #endif
 
   /* Set LED current limit */
diff --git a/examples/smps/smps_main.c b/examples/smps/smps_main.c
index 852696855..b9ddbd827 100644
--- a/examples/smps/smps_main.c
+++ b/examples/smps/smps_main.c
@@ -476,16 +476,10 @@ int main(int argc, char *argv[])
       goto errout;
     }
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
 #ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#endif
 #endif
 
   /* Set SMPS mode */
diff --git a/graphics/nxwm/src/nxwm_main.cxx b/graphics/nxwm/src/nxwm_main.cxx
index 98feabbf6..6b6a3ca1d 100644
--- a/graphics/nxwm/src/nxwm_main.cxx
+++ b/graphics/nxwm/src/nxwm_main.cxx
@@ -485,16 +485,6 @@ static bool createMediaPlayer(void)
 
 int main(int argc, char *argv[])
 {
-#if defined(CONFIG_BOARDCTL) && !defined(CONFIG_BOARD_LATE_INITIALIZE)
-  // Should we perform board-specific initialization?  There are two ways
-  // that board initialization can occur:  1) automatically via
-  // board_late_initialize() during bootup if CONFIG_BOARD_LATE_INITIALIZE, or
-  // 2) here via a call to boardctl() if the interface is enabled
-  // (CONFIG_BOARDCTL=y).
-
-  boardctl(BOARDIOC_INIT, 0);
-#endif
-
 #ifdef CONFIG_NXWM_NXTERM
   // Initialize the NSH library
 
diff --git a/graphics/twm4nx/Kconfig b/graphics/twm4nx/Kconfig
index 3f9600f68..3b114df88 100644
--- a/graphics/twm4nx/Kconfig
+++ b/graphics/twm4nx/Kconfig
@@ -42,17 +42,6 @@ config TWM4NX_REVMINOR
        string "Twm4Nx minor version number"
        default "0"
 
-config TWM4NX_ARCHINIT
-       bool "Have architecture-specific initialization"
-       default n
-       select BOARDCTL
-       depends on !NSH_ARCHINIT
-       ---help---
-               Set if your board provides architecture specific initialization
-               via the board-interface function boardctl().  The boardctl()
-               function will be called early in Twm4Nx initialization to allow
-               board logic to do such things as configure MMC/SD slots.
-
 config TWM4NX_NETINIT
        bool "Network initialization"
        default y
diff --git a/graphics/twm4nx/src/twm4nx_main.cxx 
b/graphics/twm4nx/src/twm4nx_main.cxx
index 30185ad07..3cfb3a6b5 100644
--- a/graphics/twm4nx/src/twm4nx_main.cxx
+++ b/graphics/twm4nx/src/twm4nx_main.cxx
@@ -98,23 +98,6 @@ int main(int argc, FAR char *argv[])
 
   int ret;
 
-#if defined(CONFIG_TWM4NX_ARCHINIT) && defined(CONFIG_BOARDCTL) && \
-   !defined(CONFIG_BOARD_LATE_INITIALIZE)
-  // Should we perform board-specific initialization?  There are two ways
-  // that board initialization can occur:  1) automatically via
-  // board_late_initialize() during bootup if CONFIG_BOARD_LATE_INITIALIZE, or
-  // 2) here via a call to boardctl() if the interface is enabled
-  // (CONFIG_BOARDCTL=y).  board_early_initialize() is also possibility,
-  // although less likely.
-
-  ret = boardctl(BOARDIOC_INIT, 0);
-  if (ret < 0)
-    {
-      twmerr("ERROR: boardctl(BOARDIOC_INIT) failed: %d\n", errno);
-      return EXIT_FAILURE;
-    }
-#endif
-
 #ifdef CONFIG_TWM4NX_NETINIT
   /* Bring up the network */
 
diff --git a/nshlib/Kconfig b/nshlib/Kconfig
index b9a510383..1fc34cb21 100644
--- a/nshlib/Kconfig
+++ b/nshlib/Kconfig
@@ -9,7 +9,7 @@ config NSH_LIBRARY
        bool "NSH Library"
        default n
        select NETUTILS_NETLIB if NET
-       select BOARDCTL if (!NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT) || 
NSH_ARCHINIT
+       select BOARDCTL if (!NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT)
        select BOARDCTL_MKRD if !NSH_DISABLE_MKRD && !DISABLE_MOUNTPOINT
        ---help---
                Build the NSH support library.  This is used, for example, by
@@ -1116,16 +1116,6 @@ config NSH_USBDEV_TRACEINTERRUPTS
 endif # NSH_USBDEV_TRACE
 endmenu # USB Device Trace Support
 
-config NSH_ARCHINIT
-       bool "Have architecture-specific initialization"
-       default n
-       select BOARDCTL
-       ---help---
-               Set if your board provides architecture specific initialization
-               via the board-interface function boardctl().  The boardctl()
-               function will be called early in NSH initialization to allow
-               board logic to do such things as configure MMC/SD slots.
-
 menu "Networking Configuration"
        depends on NET
 
diff --git a/nshlib/nsh.h b/nshlib/nsh.h
index 8ea334d07..2fb3cf867 100644
--- a/nshlib/nsh.h
+++ b/nshlib/nsh.h
@@ -807,13 +807,6 @@ int nsh_loginscript(FAR struct nsh_vtbl_s *vtbl);
  * available:
  */
 
-/* Architecture-specific initialization depends on boardctl(BOARDIOC_INIT) */
-
-#if defined(CONFIG_NSH_ARCHINIT) && !defined(CONFIG_BOARDCTL)
-#  warning CONFIG_NSH_ARCHINIT is set, but CONFIG_BOARDCTL is not
-#  undef CONFIG_NSH_ARCHINIT
-#endif
-
 /* The mkrd command depends on boardctl(BOARDIOC_MKRD) */
 
 #if !defined(CONFIG_BOARDCTL) || !defined(CONFIG_BOARDCTL_MKRD)
diff --git a/nshlib/nsh_init.c b/nshlib/nsh_init.c
index 4846ff15b..aea095e34 100644
--- a/nshlib/nsh_init.c
+++ b/nshlib/nsh_init.c
@@ -143,12 +143,6 @@ void nsh_initialize(void)
   boardctl(BOARDIOC_APP_SYMTAB, (uintptr_t)&symdesc);
 #endif
 
-#ifdef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-#endif
-
 #if defined(CONFIG_ETC_ROMFS) && !defined(CONFIG_NSH_DISABLESCRIPT)
   pstate = nsh_newconsole(false);
 
@@ -163,12 +157,6 @@ void nsh_initialize(void)
   netinit_bringup();
 #endif
 
-#if defined(CONFIG_NSH_ARCHINIT) && defined(CONFIG_BOARDCTL_FINALINIT)
-  /* Perform architecture-specific final-initialization (if configured) */
-
-  boardctl(BOARDIOC_FINALINIT, 0);
-#endif
-
 #if defined(CONFIG_ETC_ROMFS) && !defined(CONFIG_NSH_DISABLESCRIPT)
   /* Execute the start-up script */
 
diff --git a/system/adb/Kconfig b/system/adb/Kconfig
index 05296cca7..a97ac5a9f 100644
--- a/system/adb/Kconfig
+++ b/system/adb/Kconfig
@@ -200,19 +200,12 @@ config ADBD_SOCKET_SERVICE
        ---help---
                Enable "adb forward|reverse" feature.
 
-config ADBD_BOARD_INIT
-       bool "Board initialization"
-       depends on BOARDCTL
-       default n
-       ---help---
-               Setup board before running adb daemon.
-
 config ADBD_USB_BOARDCTL
        bool "USB Board Control"
        depends on BOARDCTL
        depends on ADBD_USB_SERVER
        select BOARDCTL_USBDEVCTRL
-       default ADBD_BOARD_INIT
+       default y
        ---help---
                Connect usbdev before running adb daemon.
 
diff --git a/system/adb/adb_main.c b/system/adb/adb_main.c
index 3895001d5..8703337c6 100644
--- a/system/adb/adb_main.c
+++ b/system/adb/adb_main.c
@@ -32,8 +32,7 @@
 #include <syslog.h>
 #include <nuttx/streams.h>
 
-#if defined(CONFIG_ADBD_BOARD_INIT) || defined (CONFIG_BOARDCTL_RESET) || \
-    defined(CONFIG_ADBD_USB_BOARDCTL)
+#if defined (CONFIG_BOARDCTL_RESET) || defined(CONFIG_ADBD_USB_BOARDCTL)
 #  include <sys/boardctl.h>
 #endif
 
@@ -120,10 +119,6 @@ int main(int argc, FAR char **argv)
   int ret;
 #endif
 
-#ifdef CONFIG_ADBD_BOARD_INIT
-  boardctl(BOARDIOC_INIT, 0);
-#endif /* CONFIG_ADBD_BOARD_INIT */
-
 #ifdef CONFIG_ADBD_USB_BOARDCTL
 
   /* Setup USBADB device */
diff --git a/system/adcscope/adcscope_main.c b/system/adcscope/adcscope_main.c
index 3413c6b52..991a756ca 100644
--- a/system/adcscope/adcscope_main.c
+++ b/system/adcscope/adcscope_main.c
@@ -382,16 +382,10 @@ int main(int argc, FAR char *argv[])
   pthread_t                 thread;
   int                       ret;
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
-#  ifdef CONFIG_BOARDCTL_FINALINIT
+#ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#  endif
 #endif
 
 #ifdef CONFIG_SYSTEM_ADCSCOPE_CDCACM
diff --git a/system/ofloader/ofloader.c b/system/ofloader/ofloader.c
index 8200262fe..6648a66b0 100644
--- a/system/ofloader/ofloader.c
+++ b/system/ofloader/ofloader.c
@@ -35,7 +35,7 @@
 #include "ofloader.h"
 
 /****************************************************************************
- * Private Typess
+ * Private Types
  ****************************************************************************/
 
 struct devinfo_s
@@ -320,16 +320,10 @@ int main(int argc, FAR char *argv[])
   size_t i;
   mqd_t mq;
 
-#if defined(CONFIG_BOARDCTL) && !defined(CONFIG_NSH_ARCHINIT)
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
-#  ifdef CONFIG_BOARDCTL_FINALINIT
+#ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#  endif
 #endif
 
   memset(&mqattr, 0, sizeof(struct mq_attr));
diff --git a/system/sensorscope/sensorscope_main.c 
b/system/sensorscope/sensorscope_main.c
index 2c8f2ecbe..1bb5e044d 100644
--- a/system/sensorscope/sensorscope_main.c
+++ b/system/sensorscope/sensorscope_main.c
@@ -412,16 +412,10 @@ int main(int argc, FAR char *argv[])
   pthread_t                   thread;
   int                         ret;
 
-#ifndef CONFIG_NSH_ARCHINIT
-  /* Perform architecture-specific initialization (if configured) */
-
-  boardctl(BOARDIOC_INIT, 0);
-
-#  ifdef CONFIG_BOARDCTL_FINALINIT
+#ifdef CONFIG_BOARDCTL_FINALINIT
   /* Perform architecture-specific final-initialization (if configured) */
 
   boardctl(BOARDIOC_FINALINIT, 0);
-#  endif
 #endif
 
 #ifdef CONFIG_SYSTEM_SENSORSCOPE_CDCACM

Reply via email to