Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Verified Commit 9a5b0fa1 authored by Ayush Singh's avatar Ayush Singh
Browse files

Remove mcumgr


- Also switch to normal sdk-next in CI

Signed-off-by: default avatarAyush Singh <ayushdevel1325@gmail.com>
parent 0fea3337
Branches
No related merge requests found
Pipeline #6815 passed with stage
in 1 minute and 15 seconds
......@@ -8,7 +8,7 @@ build:
stage: build
before_script:
- rm -rf $BEAGLE_SDK
- west init -m https://git.beagleboard.org/ayush1325/zephyr --mr mcumgr_util $BEAGLE_SDK
- west init -m https://git.beagleboard.org/beagleconnect/zephyr/zephyr --mr sdk-next $BEAGLE_SDK
- cd $BEAGLE_SDK
- west update
- west zephyr-export
......
......@@ -12,9 +12,6 @@ config BEAGLEPLAY_HDLC_MAX_BLOCK_SIZE
int "Maximum hdlc block size supported"
default 140
config BEAGLEPLAY_GREYBUS_MCUMGR
bool "Enable Mcumgr support"
config BEAGLEPLAY_GREYBUS_MESSAGES_HEAP_MEM_POOL_SIZE
int "Heap for Greybus messages"
default 2048
......
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (c) 2023 Ayush Singh <ayushdevel1325@gmail.com>
*/
#ifndef _MCUMGR_H_
#define _MCUMGR_H_
#include <stddef.h>
#include <zephyr/toolchain.h>
#ifdef CONFIG_BEAGLEPLAY_GREYBUS_MCUMGR
int mcumgr_init(void);
#else
static int mcumgr_init(void)
{
return 0;
}
#endif
#ifdef CONFIG_BEAGLEPLAY_GREYBUS_MCUMGR
int mcumgr_process_frame(const void *buffer, size_t buffer_len);
#else
static int mcumgr_process_frame(const void *buffer, size_t buffer_len)
{
ARG_UNUSED(buffer);
ARG_UNUSED(buffer_len);
return 0;
}
#endif
#endif
......@@ -60,24 +60,8 @@ CONFIG_NET_MAX_CONTEXTS=10
# MISC
CONFIG_RING_BUFFER=y
# MCUmgr
# CONFIG_MCUMGR=y
# CONFIG_ZCBOR=y
# CONFIG_MCUMGR_TRANSPORT_SERIAL_UTIL=y
# CONFIG_BASE64=y
# CONFIG_MCUMGR_LOG_LEVEL_DBG=y
# CONFIG_MCUMGR_GRP_OS=y
# CONFIG_MCUMGR_GRP_OS_LOG_LEVEL_DBG=y
# CONFIG_MCUMGR_TRANSPORT_LOG_LEVEL_DBG=y
# CONFIG_MCUMGR_GRP_OS_TASKSTAT=y
# CONFIG_THREAD_MONITOR=y
# CONFIG_THREAD_NAME=y
# CONFIG_THREAD_STACK_INFO=y
# CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=1024
# Application Config
CONFIG_BEAGLEPLAY_GREYBUS_MAX_NODES=32
CONFIG_BEAGLEPLAY_HDLC_MAX_BLOCK_SIZE=256
CONFIG_BEAGLEPLAY_GREYBUS_MAX_INTERFACES=10
# CONFIG_BEAGLEPLAY_GREYBUS_MCUMGR=y
CONFIG_BEAGLEPLAY_GREYBUS_MESSAGES_HEAP_MEM_POOL_SIZE=4096
......@@ -10,7 +10,3 @@ target_sources(app PRIVATE greybus_connections.c)
target_sources(app PRIVATE greybus_messages.c)
target_sources(app PRIVATE greybus_interfaces.c)
target_sources(app PRIVATE tcp_discovery.c)
if (CONFIG_BEAGLEPLAY_GREYBUS_MCUMGR)
target_sources(app PRIVATE mcumgr.c)
endif()
......@@ -8,7 +8,6 @@
#include "greybus_protocol.h"
#include "mdns.h"
#include "hdlc.h"
#include "mcumgr.h"
#include "node.h"
#include "svc.h"
#include "greybus_connections.h"
......@@ -139,8 +138,6 @@ static int hdlc_process_complete_frame(const void *buffer, size_t len, uint8_t a
switch (address) {
case ADDRESS_GREYBUS:
return hdlc_process_greybus_frame(buffer, len);
case ADDRESS_MCUMGR:
return mcumgr_process_frame(buffer, len);
case ADDRESS_CONTROL:
return control_process_frame(buffer, len);
case ADDRESS_DBG:
......@@ -164,7 +161,6 @@ void main(void)
return;
}
mcumgr_init();
hdlc_init(hdlc_process_complete_frame, hdlc_send_callback);
ret = uart_irq_callback_user_data_set(uart_dev, serial_callback, NULL);
......
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright (c) 2023 Ayush Singh <ayushdevel1325@gmail.com>
*/
#include <zephyr/logging/log.h>
#include <zephyr/net/buf.h>
#include <zephyr/mgmt/mcumgr/mgmt/mgmt.h>
#include <zephyr/mgmt/mcumgr/transport/serial.h>
#include <zephyr/mgmt/mcumgr/transport/smp.h>
#include "hdlc.h"
LOG_MODULE_DECLARE(cc1352_greybus, CONFIG_BEAGLEPLAY_GREYBUS_LOG_LEVEL);
static int smp_hdlc_tx_pkt(struct net_buf *);
static uint16_t smp_hdlc_get_mtu(const struct net_buf *);
static struct mcumgr_serial_rx_ctxt smp_rx_ctx;
static struct smp_transport smp_transport = {
.functions = {.output = smp_hdlc_tx_pkt, .get_mtu = smp_hdlc_get_mtu}};
static int smp_hdlc_tx_cb(const void *data, int len)
{
hdlc_block_send_sync(data, len, ADDRESS_MCUMGR, 0x03);
return 0;
}
static int smp_hdlc_tx_pkt(struct net_buf *nb)
{
int rc;
rc = mcumgr_serial_tx_pkt(nb->data, nb->len, smp_hdlc_tx_cb);
smp_packet_free(nb);
LOG_DBG("SMP TX %d", rc);
return rc;
}
static uint16_t smp_hdlc_get_mtu(const struct net_buf *nb)
{
ARG_UNUSED(nb);
return 256;
}
int mcumgr_process_frame(const void *buffer, size_t buffer_len)
{
struct net_buf *nb;
LOG_DBG("Got MCUmgr frame");
nb = mcumgr_serial_process_frag(&smp_rx_ctx, buffer, buffer_len);
if (nb == NULL) {
return -1;
}
smp_rx_req(&smp_transport, nb);
return 0;
}
int mcumgr_init(void)
{
int rc = smp_transport_init(&smp_transport);
if (rc) {
LOG_ERR("Failed to init SMP Transport");
return -1;
}
return 0;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment