Thingy 53 does not enumerate serial port for Dev Academy Lesson 6 exercise 2

Currenty I am on version 2.1 and was able to get the Thingy 53 to enumerate serial port(s) but using the old version 1.x thingy53.c file and the include files and functions that are in that file.

/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

#include <zephyr/init.h>

#include <img_mgmt/img_mgmt.h>
#include <os_mgmt/os_mgmt.h>
#include <zephyr/mgmt/mcumgr/smp_bt.h>

#include <zephyr/usb/usb_device.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(thingy53_setup);


static int bt_smp_init(const struct device *dev)
{
	ARG_UNUSED(dev);
	int err = 0;

	img_mgmt_register_group();
	os_mgmt_register_group();

	err = smp_bt_register();

	if (err) {
		LOG_ERR("SMP BT register failed (err: %d)", err);
	}

	return err;
}

static int usb_cdc_init(const struct device *dev)
{
	int err = usb_enable(NULL);

	if (err) {
		LOG_ERR("Failed to enable USB");
	}

	return err;
}

SYS_INIT(bt_smp_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
SYS_INIT(usb_cdc_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);

In order to get thingy53.c to compile I had to select Use build system default under configuration in the edit build configuration instead of prj.conf.  The prj.conf file is present anyway.  

I then uplevelled to version 2.4 and just flat out tried the solution directly from the Nordic Git Hub server and was not able to get the serial port to enumerate.  I tried using parts of the old 1.x solution specifically the thingy53.c file once again but no luck.  Did some reading and looks like the thingy53.c file is no longer necessary anyway.  What is the solution to get the Thingy53 to enumerate and what's the difference between picking build system default or prj.conf in the edit build configuration. I tried to attach ncs-fund-main/v2.x.x/lesson6  https://github.com/NordicDeveloperAcademy/ncs-fund here that doesn't enumerate a serial port so that  console functions will work like printk, the logger and so on.

I'm using Visual Studio Code and any other sugestions that I can find.

Parents Reply Children
  • Great I'm glad you can see an issue.  Because I'm using CMSE disable i.e. using thingy53_nrf5340_cpuapp and that got lesson 6 exer 2 going that is good enough for me.  I can wait for the normal release.  Mainly because I'm getting 

    FATAL ERROR: already initialized in c:\ncs\v2.4.0, aborting.
    Note:
    In your environment, ZEPHYR_BASE is set to:
    c:\ncs\v2.4.0\zephyr

    This forces west to search for a workspace there.
    Try unsetting ZEPHYR_BASE and re-running this command.

    I'm familiar with git but still haven't used west command line so it will take awhile for me to go through all that and don't see need if its not necessary.  

    So I have moved on to a much bigger project that also worked well in 2.1 but am having issues with the logger.   If you think I need the main version (the latest state of development) then I will have to go through it and try to figure out how to get main.  

    In any case on 2.4 CMSE disable it seems like there is an intermittent issue with the logger which is of course somewhat related to the changes made to no longer need thingy53.c   Just a wild guess but maybe when logging comes too fast before it would report lost messages but now maybe a problem occurs.  I've never seen an assert printout before either until now.  This project also uses our hardware so not sure it will be worthwhile to attach it but maybe your opinion on if this is also a 2.4 issue.

    see the ASSERTION FAIL The bme680 chip id  = 0x61

    Never seen ASSERTION FAIL before 2.4.

    Also sometimes it resets and then works.  Most of the time it does work but not always.  

  • Hi, 

    Not sure if the latest issue is relevant to NCS 2.4.0 version, but you could try with the NCS main version. If you still see the issue, please create a new support case since the latest issue is away from the original scope. 

    I will be out of the office for one month and not be able to reply to this case before my back. If it's urgent to get support, please create a new support case.  Sorry for the inconvenience. 

    Regards,
    Amanda H.

Related