This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git
commit 1f8340028509e592db4feb5d29d96a7fef78f007 Author: Christopher Collins <ccoll...@apache.org> AuthorDate: Tue Feb 13 13:18:10 2018 -0800 Remove log support from zephyr sample app It was decided that Zephyr support for log and reboot_log will be defered. When it gets added, we can back out this commit. --- cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c | 2 - samples/smp_svr/zephyr/prj.conf | 17 +------ samples/smp_svr/zephyr/src/main.c | 76 ---------------------------- 3 files changed, 1 insertion(+), 94 deletions(-) diff --git a/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c b/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c index e127bdb..ba52517 100644 --- a/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c +++ b/cmd/os_mgmt/port/zephyr/src/zephyr_os_mgmt.c @@ -21,7 +21,6 @@ #include <misc/reboot.h> #include <debug/object_tracing.h> #include <kernel_structs.h> -#include <logging/reboot_log.h> #include <mgmt/mgmt.h> #include <os_mgmt/os_mgmt.h> #include <os_mgmt/os_mgmt_impl.h> @@ -78,7 +77,6 @@ os_mgmt_impl_task_info(int idx, struct os_mgmt_task_info *out_info) static void zephyr_os_mgmt_reset_work_handler(struct k_work *work) { - reboot_log_write("mcumgr"); sys_reboot(SYS_REBOOT_WARM); } diff --git a/samples/smp_svr/zephyr/prj.conf b/samples/smp_svr/zephyr/prj.conf index 42abc04..3939fbb 100644 --- a/samples/smp_svr/zephyr/prj.conf +++ b/samples/smp_svr/zephyr/prj.conf @@ -18,6 +18,7 @@ CONFIG_BT_RX_BUF_LEN=260 # Enable the Bluetooth and shell mcumgr transports. CONFIG_MCUMGR_SMP_BT=y CONFIG_MCUMGR_SMP_SHELL=y +#CONFIG_MCUMGR_SMP_UART=y # Bluetooth support requires a net_buf user_data size >= 7. CONFIG_NET_BUF_USER_DATA_SIZE=7 @@ -34,20 +35,9 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_FCB=y -# Enable the managed log (mdlog). -CONFIG_MDLOG=y -CONFIG_MDLOG_CONSOLE=y -CONFIG_MDLOG_FCB=y - # Required by the `taskstat` command. CONFIG_THREAD_MONITOR=y -# Enable the reboot log. -CONFIG_REBOOT_LOG=y - -# Enable assertions. Required for crash logging. -CONFIG_ASSERT=y - # Enable statistics and statistic names. CONFIG_STATS=y CONFIG_STATS_NAMES=y @@ -55,15 +45,10 @@ CONFIG_STATS_NAMES=y # Enable all core commands. CONFIG_MCUMGR_CMD_FS_MGMT=y CONFIG_MCUMGR_CMD_IMG_MGMT=y -CONFIG_MCUMGR_CMD_LOG_MGMT=y CONFIG_MCUMGR_CMD_OS_MGMT=y CONFIG_MCUMGR_CMD_STAT_MGMT=y ### nRF5 specific settings -# Disable flash-radio sync. This is necessary for writing to the reboot log -# with an interrupt handler. -CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=n - # Specify the location of the NFFS file system. CONFIG_FS_NFFS_FLASH_DEV_NAME="NRF5_FLASH" diff --git a/samples/smp_svr/zephyr/src/main.c b/samples/smp_svr/zephyr/src/main.c index fde3f4e..022817c 100644 --- a/samples/smp_svr/zephyr/src/main.c +++ b/samples/smp_svr/zephyr/src/main.c @@ -11,9 +11,6 @@ #include <bluetooth/bluetooth.h> #include <bluetooth/conn.h> #include <bluetooth/gatt.h> -#include <logging/mdlog.h> -#include <logging/reboot_log.h> -#include <fcb.h> #include <stats.h> #include <mgmt/smp_bt.h> #include <mgmt/buf.h> @@ -27,9 +24,6 @@ #ifdef CONFIG_MCUMGR_CMD_IMG_MGMT #include "img_mgmt/img_mgmt.h" #endif -#ifdef CONFIG_MCUMGR_CMD_LOG_MGMT -#include "log_mgmt/log_mgmt.h" -#endif #ifdef CONFIG_MCUMGR_CMD_STAT_MGMT #include "stat_mgmt/stat_mgmt.h" #endif @@ -37,13 +31,6 @@ #define DEVICE_NAME CONFIG_BT_DEVICE_NAME #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1) -/* smp_svr uses the first "peruser" log module. */ -#define SMP_SVR_MDLOG_MODULE (MDLOG_MODULE_PERUSER + 0) - -/* Convenience macro for logging to the smp_svr module. */ -#define SMP_SVR_MDLOG(lvl, ...) \ - MDLOG_ ## lvl(&smp_svr_log, SMP_SVR_MDLOG_MODULE, __VA_ARGS__) - /* Define an example stats group; tracks seconds of uptime. */ STATS_SECT_START(smp_svr_stats) STATS_SECT_ENTRY(ticks) @@ -57,9 +44,6 @@ STATS_NAME_END(smp_svr_stats) /* Define an instance of the stats group. */ STATS_SECT_DECL(smp_svr_stats) smp_svr_stats; -struct fcb smp_svr_fcb; -struct mdlog smp_svr_log; - static const struct bt_data ad[] = { BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), BT_DATA_BYTES(BT_DATA_UUID128_ALL, @@ -119,62 +103,10 @@ static void bt_ready(int err) advertise(); } -static int init_fcb(void) -{ - /* If the user has enabled FCB support, assume there is an FCB in the NFFS - * area. - */ -#ifndef CONFIG_FCB - return 0; -#endif - - static struct flash_sector sectors[128]; - - uint32_t sector_cnt; - int rc; - - sector_cnt = sizeof sectors / sizeof sectors[0]; - rc = flash_area_get_sectors(4, §or_cnt, sectors); - if (rc != 0) { - return rc; - } - - if (sector_cnt <= 1) { - return -EINVAL; - } - - /* Initialize the FCB in the NFFS flash area (area 4) with one scratch - * sector. - */ - smp_svr_fcb = (struct fcb) { - .f_magic = 0x12345678, - .f_version = MDLOG_VERSION, - .f_sector_cnt = sector_cnt - 1, - .f_scratch_cnt = 1, - .f_sectors = sectors, - }; - - rc = fcb_init(4, &smp_svr_fcb); - if (rc != 0) { - return rc; - } - - return 0; -} - void main(void) { int rc; - rc = init_fcb(); - if (rc != 0) { - printk("Failed to initialize FCB; rc=%d\n", rc); - } - -#ifdef CONFIG_REBOOT_LOG - reboot_log_configure(&smp_svr_log); -#endif - rc = STATS_INIT_AND_REG(smp_svr_stats, STATS_SIZE_32, "smp_svr_stats"); assert(rc == 0); @@ -188,9 +120,6 @@ void main(void) #ifdef CONFIG_MCUMGR_CMD_IMG_MGMT img_mgmt_register_group(); #endif -#ifdef CONFIG_MCUMGR_CMD_LOG_MGMT - log_mgmt_register_group(); -#endif #ifdef CONFIG_MCUMGR_CMD_STAT_MGMT stat_mgmt_register_group(); #endif @@ -206,11 +135,6 @@ void main(void) /* Initialize the Bluetooth mcumgr transport. */ smp_bt_register(); -#if defined(CONFIG_MDLOG) && defined(CONFIG_FCB) - mdlog_register("smp_svr", &smp_svr_log, &mdlog_fcb_handler, &smp_svr_fcb, - MDLOG_LEVEL_DEBUG); -#endif - /* The system work queue handles all incoming mcumgr requests. Let the * main thread idle while the mcumgr server runs. */ -- To stop receiving notification emails like this one, please contact ccoll...@apache.org.