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

TASKS_SUSPEND in the UART section of nrf51.h

nrf51.h has the following listed for NRF_UART ..

    typedef struct {    
__O  uint32_t  TASKS_STARTRX;        
__O  uint32_t  TASKS_STOPRX;   
__O  uint32_t  TASKS_STARTTX;
__O  uint32_t  TASKS_STOPTX;  
__I  uint32_t  RESERVED0[3];
__O  uint32_t  TASKS_SUSPEND;                     /*!< Suspend UART.  */

As far as I can tell from the nrf51 reference, the UART doesnt' support TASKS_SUSPEND (and neither is there a TASKS_RESUME to match it) so I think this is just an error in nrf51.h. It looks like that leaked in from the TWI interface by mistake.

I also note the documentation in the nrf51 Series Reference manual states the following ..

The UART shares registers and other resources with other peripherals that have the same ID as the UART.

.....

See the Instantiation table in Section 4.2 “Instantiation” on page 13 for details on peripherals and their IDs.

That appears not to be true. Looking at section 4.2, the UART is ID 2 (0x40002000) and that's not shared with anything else.

Can these be fixed in the next release of the .h files and the documentation please.

Edit: the more I look, the more I find. The header also has

    __IO uint32_t EVENTS_CTS
    __IO uint32_t EVENTS_NCTS
    __IO uint32_t SHORTS

none of which are documented, there are in fact no SHORTS documented for the UART at all but it seems they may exist and events telling you when CTS is activated and deactivated would also be rather useful.

What's correct here, the header, the documentation, neither?

Parents
  • TASK_SUSPEND worked for me (take a look at the files attached to my answer to BUG: Lost/bad data between app_uart_close and app_uart_init, which use it to fix a problem with the SDK's app_uart_close). It's also documented in the nRF51 Series Reference Manual that I have (v3.0), but not an older version I had (v2.1). However, it appears to be equivalent to TASK_STOPTX and TASK_STOPRX together; and both will generate an RXTO event when done. There is no resume task in the v3.1 manual; presumably one resumes just by reinitializing the UART and starting the desired tasks.

    The "shared ID" is perhaps boilerplate that applies generally and is kept in case of future sharing in other configurations perhaps? If there's nothing sharing it now then it's no problem.

    v3.0 also documents CTS/NCTS.

    Many peripherals have shortcuts capabilities via SHORTS so presumably the UART's register is reserved for future use even if it has nothing there now.

Reply
  • TASK_SUSPEND worked for me (take a look at the files attached to my answer to BUG: Lost/bad data between app_uart_close and app_uart_init, which use it to fix a problem with the SDK's app_uart_close). It's also documented in the nRF51 Series Reference Manual that I have (v3.0), but not an older version I had (v2.1). However, it appears to be equivalent to TASK_STOPTX and TASK_STOPRX together; and both will generate an RXTO event when done. There is no resume task in the v3.1 manual; presumably one resumes just by reinitializing the UART and starting the desired tasks.

    The "shared ID" is perhaps boilerplate that applies generally and is kept in case of future sharing in other configurations perhaps? If there's nothing sharing it now then it's no problem.

    v3.0 also documents CTS/NCTS.

    Many peripherals have shortcuts capabilities via SHORTS so presumably the UART's register is reserved for future use even if it has nothing there now.

Children
No Data
Related