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

TWI and UART

Situation: SES, SDK 16, nRF52832, no BLE.

I'm trying to use both the UART and TWI 0. TWI works fine with BLE and all the rest. However, when I enable the UART, TWI quits working but the UART works just fine.

1) I checked instantiation - the two do not share.

2) UART and UARTE both enabled in sdk_config.h as in peripheral/uart example.

3) Using app_uart_fifo per the demo.

4) You can't compile the legacy stuff required without UARTE enabled, there's a compile time error.

Where to start?

Parents
  • I can't answer all because some things got fixed and I moved on.

    1) I think I enabled TWI before the UART during failure. Initializing the UART first and now it seems to work. This is a guess as other stuff has changed.

    2) Instantiation was checked through the nRF52832 chip manual to make sure (TI has this problem with shared serial peripherals).

    3) Yes, using the peripheral demo and TWI as master from some other example. The TWI worked fine until I added the UART. And for the record, not a slave and not multi-master.

    4) I tried to run the UART direct without the FIFO and UARTE but always got an undefined typedef in one of the uart.h files (I forget which). I assume that with the FIFO enabled you need UARTE? Is there anyway of just running the raw UART without DMA?

    This is another mysterious problem that went away but I'm not sure why and this seems to happen a lot.

  • Hello again,

    Jed Marti said:
    I can't answer all because some things got fixed and I moved on.

    I am happy you were able to resolve some of your issues.

    Jed Marti said:
    2) Instantiation was checked through the nRF52832 chip manual to make sure (TI has this problem with shared serial peripherals).

    Yes, resource sharing like this is quite common - but which TWIM instance did you use?
    TWIM0 and UARTE0 share the same IRQ, so if you used both of these that might be the cause of this.

    Jed Marti said:
    4) I tried to run the UART direct without the FIFO and UARTE but always got an undefined typedef in one of the uart.h files (I forget which). I assume that with the FIFO enabled you need UARTE? Is there anyway of just running the raw UART without DMA?

    Yes, you may use just the UART peripheral, without the UARTE peripheral.
    You can disable both UARTE and UART easyDMA in the UART peripheral example with the following lines:

    #define UARTE_ENABLED 0 
    #define UART_EASY_DMA_SUPPORT 0 
    #define UART0_CONFIG_USE_EASY_DMA 0


    Jed Marti said:
    This is another mysterious problem that went away but I'm not sure why and this seems to happen a lot.

    Are you currently experiencing an issue you would like help resolving, or are you saying that the issue went away and will remain a mystery?
    In the case of the former, I am happy to help resolving it! And in the case of the latter, I am happy that you were able to resolve you issue and that both peripherals are currently working as expected.

    Best regards,
    Karl

Reply
  • Hello again,

    Jed Marti said:
    I can't answer all because some things got fixed and I moved on.

    I am happy you were able to resolve some of your issues.

    Jed Marti said:
    2) Instantiation was checked through the nRF52832 chip manual to make sure (TI has this problem with shared serial peripherals).

    Yes, resource sharing like this is quite common - but which TWIM instance did you use?
    TWIM0 and UARTE0 share the same IRQ, so if you used both of these that might be the cause of this.

    Jed Marti said:
    4) I tried to run the UART direct without the FIFO and UARTE but always got an undefined typedef in one of the uart.h files (I forget which). I assume that with the FIFO enabled you need UARTE? Is there anyway of just running the raw UART without DMA?

    Yes, you may use just the UART peripheral, without the UARTE peripheral.
    You can disable both UARTE and UART easyDMA in the UART peripheral example with the following lines:

    #define UARTE_ENABLED 0 
    #define UART_EASY_DMA_SUPPORT 0 
    #define UART0_CONFIG_USE_EASY_DMA 0


    Jed Marti said:
    This is another mysterious problem that went away but I'm not sure why and this seems to happen a lot.

    Are you currently experiencing an issue you would like help resolving, or are you saying that the issue went away and will remain a mystery?
    In the case of the former, I am happy to help resolving it! And in the case of the latter, I am happy that you were able to resolve you issue and that both peripherals are currently working as expected.

    Best regards,
    Karl

Children
No Data
Related