UARTE1 at 921600 baud rate doesn't receive more than 5 bytes if CONFIG_LOG is enabled.

I am using the nrf5340 audio example project. The main problem is that I can not receive more than 5 bytes on UARTE1 at 921600 if logging is enabled. There is no event if I try to send more than 5 bytes of data. I guess that log module somehow crashes. If I disable the CONFIG_LOG macro from the .conf file everything starts working fine. But at a 115200 baud rate, UARTE1 receiving works fine while receiving big amounts of data, even if logging is enabled.

This is my device tree configuration:

/*
 * Copyright (c) 2020-2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */
#include "audio_gateway_nrf5340_cpuapp_common-pinctrl.dtsi"

/ {
	chosen {
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,uart-mcumgr = &uart0;
		zephyr,bt-mon-uart = &uart0;
		zephyr,bt-c2h-uart = &uart0;
		zephyr,bt-hci-rpmsg-ipc = &ipc0;
	};

	gpio_fwd: nrf-gpio-forwarder {
		compatible = "nordic,nrf-gpio-forwarder";
		status = "okay";
		uart {
			gpios = <&gpio1 9 0>, <&gpio1 8 0>, <&gpio1 11 0>, <&gpio1 10 0>;
		};
	};
};

&adc {
	status = "okay";
};

&gpiote {
	status = "okay";
};

&gpio0 {
	status = "okay";
};

&gpio1 {
	status = "okay";
};


&uart0 {
	status = "okay";
	current-speed = <115200>;
	pinctrl-0 = <&uart0_default>;
	pinctrl-1 = <&uart0_sleep>;
	pinctrl-names = "default", "sleep";
};

&uart1 {
	status = "okay";
	compatible = "nordic,nrf-uarte";
	current-speed = <921600>;
	pinctrl-0 = <&uart1_default>;
	pinctrl-1 = <&uart1_sleep>;
	pinctrl-names = "default", "sleep";
};

&pwm0 {
	status = "okay";
};

&timer0 {
	status = "okay";
};

&timer1 {
	status = "okay";
};

&timer2 {
	status = "okay";
};

&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x00000000 0x00010000>;
		};
		slot0_partition: partition@10000 {
			label = "image-0";
		};
		slot0_ns_partition: partition@50000 {
			label = "image-0-nonsecure";
		};
		slot1_partition: partition@80000 {
			label = "image-1";
		};
		slot1_ns_partition: partition@c0000 {
			label = "image-1-nonsecure";
		};
		scratch_partition: partition@f0000 {
			label = "image-scratch";
			reg = <0x000f0000 0xa000>;
		};
		storage_partition: partition@fa000 {
			label = "storage";
			reg = <0x000fa000 0x00006000>;
		};
	};
};

/ {
	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		sram0_image: image@20000000 {
			/* Zephyr image(s) memory */
		};

		sram0_s: image_s@20000000 {
			/* Secure image memory */
		};

		sram0_ns: image_ns@20040000 {
			/* Non-Secure image memory */
		};
	};
};

/* Include partition configuration file */
#include "audio_gateway_nrf5340_cpuapp_partition_conf.dts"
// #include "audio_gateway_nrf5340_shared.dts"

This is my pins configuration:

/*
 * Copyright (c) 2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

&pinctrl {
	uart0_default: uart0_default {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 20)>,
				<NRF_PSEL(UART_RTS, 0, 19)>;
		};
		group2 {
			psels = <NRF_PSEL(UART_RX, 0, 22)>,
				<NRF_PSEL(UART_CTS, 0, 21)>;
			bias-pull-up;
		};
	};

	uart0_sleep: uart0_sleep {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 20)>,
				<NRF_PSEL(UART_RX, 0, 22)>,
				<NRF_PSEL(UART_RTS, 0, 19)>,
				<NRF_PSEL(UART_CTS, 0, 21)>;
			low-power-enable;
		};
	};

	uart1_default: uart1_default {
		group1 {
			psels = <NRF_PSEL(UART_TX, 1, 14)>;
		};
		group2 {
			psels = <NRF_PSEL(UART_RX, 1, 15)>;
			bias-pull-up;
		};
	};

	uart1_sleep: uart1_sleep {
		group1 {
			psels = <NRF_PSEL(UART_TX, 1, 14)>,
				<NRF_PSEL(UART_RX, 1, 15)>;
			low-power-enable;
		};
	};
};

I thought that the reason could be easyDMA but couldn't find enough information about it. What do you think can be the cause of this trouble?

Parents Reply Children
No Data
Related