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

BUG?:UART_INTENSET_RXTO dosen't work

Hi All, I tried to use the nRF51422 device UART RXTO events using nrf51 SDK v6.1. I set the NRF_UART0->INTENSET in app_uart_init() as following:

// Enable UART interrupt
NRF_UART0->INTENCLR = 0xffffffffUL;
NRF_UART0->INTENSET = (UART_INTENSET_RXDRDY_Set << UART_INTENSET_RXDRDY_Pos) |
                      (UART_INTENSET_TXDRDY_Set << UART_INTENSET_TXDRDY_Pos) |
                      (UART_INTENSET_ERROR_Set << UART_INTENSET_ERROR_Pos) |
			          (UART_INTENSET_RXTO_Set << UART_INTENSET_RXTO_Pos) ;

I expected the NRF_UART0->INTENSET should be set as 0x20284, because I found the following defines in nrf51_bitfields.h

#define UART_INTENSET_RXTO_Pos (17UL) /*!< Position of RXTO field. */
#define UART_INTENSET_ERROR_Pos (9UL) /*!< Position of ERROR field. */
#define UART_INTENSET_TXDRDY_Pos (7UL) /*!< Position of TXDRDY field. */
#define UART_INTENSET_RXDRDY_Pos (2UL) /*!< Position of RXDRDY field. */

however, I found the NRF_UART0->INTENSET was set as 0x0284.

Then II tested to set the NRF_UART0->INTENSET = 0xFFFFFFFFUL, the NRF_UART0->INTENSET just became 0x1FFFF; Is this a bug for NRF_UART0->INTENSET ? How can I make the UART RXTO events run?

Parents
  • There's no way the SDK makes a difference here, you're just writing a value to a location in memory. Apart from that, 7.2 is the latest version, but it doesn't matter.

    How are you checking the value after you write it? Are you looking in a debugger at memory, are you reading back NRF_UART0->INTENSET into a variable and then looking at that in a debugger, or printing it out? If you're using a debugger to look at the UART0->INTENSET value, is the debugger 'decoding' the fields and showing you the flags, it's possible that the debugger register map is wrong and it's masking that flag out even though it's actually set.

    I'd certainly add a line of code after your

    UART0->INTESET = 0xffffffff;

    like this

    uint32_t test_value = UART0->INTENSET;

    and check what test_value is actually set to.

    I checked the product anomalies list but saw nothing about INTENSET giving the wrong answer on read, what revision chip do you have?

Reply
  • There's no way the SDK makes a difference here, you're just writing a value to a location in memory. Apart from that, 7.2 is the latest version, but it doesn't matter.

    How are you checking the value after you write it? Are you looking in a debugger at memory, are you reading back NRF_UART0->INTENSET into a variable and then looking at that in a debugger, or printing it out? If you're using a debugger to look at the UART0->INTENSET value, is the debugger 'decoding' the fields and showing you the flags, it's possible that the debugger register map is wrong and it's masking that flag out even though it's actually set.

    I'd certainly add a line of code after your

    UART0->INTESET = 0xffffffff;

    like this

    uint32_t test_value = UART0->INTENSET;

    and check what test_value is actually set to.

    I checked the product anomalies list but saw nothing about INTENSET giving the wrong answer on read, what revision chip do you have?

Children
No Data
Related