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

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit f6c844bbc508889f061f8b0f43c17cec54f9cf6c
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Oct 6 19:22:31 2026 +0200

    apps: Fix smp_svr and omp_svr build for native target
    
    Both applications were failing to build for native BSP:
     - boot/stub was used for simulated BSP while mcuboot bootutil is
       always pulled in by img_mgmt, which resulted in duplicated settings
     - application entry point was main() instead of mynewt_main() which
       collided with native BSP main()
    
    Assisted-by: Claude:claude-opus-5-5
---
 apps/omp_svr/pkg.yml    | 4 +---
 apps/omp_svr/src/main.c | 7 +------
 apps/smp_svr/pkg.yml    | 4 +---
 apps/smp_svr/src/main.c | 7 ++-----
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/apps/omp_svr/pkg.yml b/apps/omp_svr/pkg.yml
index 9a49f2e7d..e6341e85e 100644
--- a/apps/omp_svr/pkg.yml
+++ b/apps/omp_svr/pkg.yml
@@ -44,9 +44,9 @@ pkg.deps:
     - "@apache-mynewt-core/sys/sysinit"
     - "@apache-mynewt-core/mgmt/smp/smp_os"
     - "@apache-mynewt-core/net/oic"
+    - '@mcuboot/boot/bootutil'
 
 pkg.deps.!BSP_SIMULATED:
-    - '@mcuboot/boot/bootutil'
     - '@apache-mynewt-core/mgmt/smp/transport/ble'
     - '@apache-mynewt-nimble/nimble/controller'
     - '@apache-mynewt-nimble/nimble/host'
@@ -55,8 +55,6 @@ pkg.deps.!BSP_SIMULATED:
     - '@apache-mynewt-nimble/nimble/host/services/gatt'
     - '@apache-mynewt-nimble/nimble/host/store/config'
 
-pkg.deps.BSP_SIMULATED:
-    - '@apache-mynewt-core/boot/stub'
 
 pkg.ign_files.BSP_SIMULATED:
     - "misc.c"
diff --git a/apps/omp_svr/src/main.c b/apps/omp_svr/src/main.c
index 1bb375597..2a46560f0 100644
--- a/apps/omp_svr/src/main.c
+++ b/apps/omp_svr/src/main.c
@@ -49,8 +49,6 @@
 /* Application-specified header. */
 #include "omp_svr.h"
 
-#else
-#include <mcu/mcu_sim.h>
 #endif /* !ARCH_sim */
 
 /* Task 1 */
@@ -482,13 +480,10 @@ init_tasks(void)
  * @return int NOTE: this function should never return!
  */
 int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
 {
     int rc;
 
-#ifdef ARCH_sim
-    mcu_sim_parse_args(argc, argv);
-#endif
     sysinit();
 
 #ifndef ARCH_sim
diff --git a/apps/smp_svr/pkg.yml b/apps/smp_svr/pkg.yml
index 7bb092d3d..6fa6be192 100644
--- a/apps/smp_svr/pkg.yml
+++ b/apps/smp_svr/pkg.yml
@@ -31,9 +31,9 @@ pkg.deps:
     - '@apache-mynewt-core/mgmt/mcumgr/cmd/img_mgmt'
     - '@apache-mynewt-core/mgmt/mcumgr/cmd/os_mgmt'
     - '@apache-mynewt-core/mgmt/mcumgr/smp'
+    - '@mcuboot/boot/bootutil'
 
 pkg.deps.!BSP_SIMULATED:
-    - '@mcuboot/boot/bootutil'
     - '@apache-mynewt-core/mgmt/smp/transport/ble'
     - '@apache-mynewt-nimble/nimble/controller'
     - '@apache-mynewt-nimble/nimble/host'
@@ -43,8 +43,6 @@ pkg.deps.!BSP_SIMULATED:
     - '@apache-mynewt-nimble/nimble/host/services/gatt'
     - '@apache-mynewt-nimble/nimble/host/store/config'
 
-pkg.deps.BSP_SIMULATED:
-    - '@apache-mynewt-core/boot/stub'
 
 pkg.ign_files.BSP_SIMULATED:
     - "gatt_svr.c"
diff --git a/apps/smp_svr/src/main.c b/apps/smp_svr/src/main.c
index 351af5411..fb0efb57c 100644
--- a/apps/smp_svr/src/main.c
+++ b/apps/smp_svr/src/main.c
@@ -38,8 +38,6 @@
 #include "smp_svr.h"
 #include "host/util/util.h"
 
-#else
-#include <mcu/mcu_sim.h>
 #endif /* !ARCH_sim */
 
 /* smp_svr uses the first "peruser" log module. */
@@ -282,13 +280,12 @@ smp_svr_on_sync(void)
  * @return int NOTE: this function should never return!
  */
 int
-main(int argc, char **argv)
+mynewt_main(int argc, char **argv)
 {
 #ifndef ARCH_sim
     int rc;
-#else
-    mcu_sim_parse_args(argc, argv);
 #endif
+
     /* Initialize OS */
     sysinit();
 

Reply via email to