This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UARTE Transmit not working with NRF9160 and zephyr

Hi all,

I have been trying to work with UARTE for both TX and RX, and  my test code is working with RX perfectly but not TX, when i try to transmit my data using uart_tx() it returning success and then it will trigger UART_TX_ABORTED and then UART_TX_DONE but at the end we cant see any data on terminal.

when i step in further in to uart_tx(), i.e uarte_nrfx_tx() i have observed that when we call "i irq_lock();" its calling function "static ALWAYS_INLINE unsigned int arch_irq_lock(void)" from "C:\...\Nordic\v1.5.1\zephyr\include\arch\arm\aarch32\asm_inline_gcc.h"
and in this function the controller going into "#error Unknown ARM architecture"

static ALWAYS_INLINE unsigned int arch_irq_lock(void)
{
	unsigned int key;

#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
	__asm__ volatile("mrs %0, PRIMASK;"
		"cpsid i"
		: "=r" (key)
		:
		: "memory");
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
	unsigned int tmp;

	__asm__ volatile(
		"mov %1, %2;"
		"mrs %0, BASEPRI;"
		"msr BASEPRI, %1;"
		"isb;"
		: "=r"(key), "=r"(tmp)
		: "i"(_EXC_IRQ_DEFAULT_PRIO)
		: "memory");
#elif defined(CONFIG_ARMV7_R)
	__asm__ volatile(
		"mrs %0, cpsr;"
		"and %0, #" TOSTR(I_BIT) ";"
		"cpsid i;"
		: "=r" (key)
		:
		: "memory", "cc");
#else
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */

	return key;
}

i dont know weather this is the exact reason for data not transmit, but i cant see any other.

please find the attached project

uarte_test_code.zip

 please help me

Best Regards

Rajender

  • Hi,

     

    when i step in further in to uart_tx(), i.e uarte_nrfx_tx() i have observed that when we call "i irq_lock();" its calling function "static ALWAYS_INLINE unsigned int arch_irq_lock(void)" from "C:\...\Nordic\v1.5.1\zephyr\include\arch\arm\aarch32\asm_inline_gcc.h"
    and in this function the controller going into "#error Unknown ARM architecture"

    This is a preprocessor error. If you had ended up in this #error directive, you would not be able to compile the project at all.

    When debugging, its recommended that you have CONFIG_DEBUG_OPTIMIZATIONS=y set

     

    Here's the project running on the nRF9160 DK:

    275004.zip

     

    It will print on UART0, and receive input from UART2:

    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    UART Async example started
    test dataRX 1: h
    RX 1: e
    RX 1: l
    RX 1: l
    RX 1: o
    

     

    Kind regards,

    Håkon

      

  • Hi

    Yes, the problem is in board files only, but these board files used to work fine without any extra hardware in INTERRUPT_DRIVEN_MODE

    finally now my TX and Rx both are working, after little bit modification in board files->uart config

    i have changed my board files like this...

    &uart2 {
    compatible = "nordic,nrf-uarte";
    status = "okay";
    current-speed = <115200>;
    tx-pin = <11>;
    rx-pin = <10>;
    rts-pin = <12>;
    cts-pin = <7>;
    /*hw-flow-control;*/
    };
    

    Now my UARTE configuration is like this, and its working fine

    Prior to this The "hw-flow-control" was not in comment so then only RX used to work when i comment "hw-flow-control" now its working with both RX and TX.

    Best Regards

    Rajender

Related