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

ble_app_uart example some uart issue on fanstel EV-840 DK

Hi there,

I am using WIN10, Segger studio 4.52c and nRF SDK16. 

I can successfully run ble_app_uart example on PCA10056, but when i try to run same code on fanstel EV-840 dev board, application crashes after uart_init() function, actually APP_UART_COMMUNICATION_ERROR event is received in event handler. (if i comment uart_init() function everything else works fine.. i can connect with phone and all...)

Then i tried Uart example in  examples\peripheral\uart and i got the same behavior as in ble_app_uart.

But when i tried serial_uartes example in examples\peripheral\serial_uartes strangely enough this worked perfectly and i can send data on both the uarts.

So there is no hardware issue in UART for sure and i am using RX on 26 and TX on 27 on EV_840.

Now i am out of options to try out, please suggest what can be wrong and why i can't run ble_app_uart example on fanstel EV-840. 

I am sure i am missing something very basic.

Thanks, Rishi

Parents
  • Hi Rishi

    Does the EV-840 board have a 32.768kHz crystal included? I'm asking because the EV-840 modules do not but from this picture, it seems that the Y1 is an external crystal with an on/off switch. Please check whether this switch is in the ON position on your board, as all our SDK examples use the external 32.768kHz crystal by default. If you'd like to run the example without this crystal you can make the following changes to your sdk_config.h header file:

    // </h> 
    //==========================================================
    
    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    #endif

    You can also check if the UART RX pin is floating for some reason on the EV-840 board, as this is a common reason for the APP_UART_COMMUNICATION_ERROR as well.

    Best regards,

    Simon

Reply
  • Hi Rishi

    Does the EV-840 board have a 32.768kHz crystal included? I'm asking because the EV-840 modules do not but from this picture, it seems that the Y1 is an external crystal with an on/off switch. Please check whether this switch is in the ON position on your board, as all our SDK examples use the external 32.768kHz crystal by default. If you'd like to run the example without this crystal you can make the following changes to your sdk_config.h header file:

    // </h> 
    //==========================================================
    
    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    #endif

    You can also check if the UART RX pin is floating for some reason on the EV-840 board, as this is a common reason for the APP_UART_COMMUNICATION_ERROR as well.

    Best regards,

    Simon

Children
  • Hi Simon,

    Thanks for your response and i tried out as you had suggested  i made sure SW5 is in ON position and Y1 crystal is connected to P00 and P01. Its the same behavior what i was experiencing before.

    As i mentioned earlier i can run serial_uartes example without any problems on pins P101, P102 and P103, P104.

    But when i try to use these pins in ble_app_uart i can not use them i mean application crashes immediately after uart_init().

    Something is strange which obviously i don't understand at the moment. My current understanding is we can configure any gpio as any peripheral pin or can use as IO pin. Is this correct? 

    When i tried to change the pins for 2 UARTs to P101,102 and 103,104 even on PCA10056 , uart_init() function crashes....

    But i can use 2 UARTS on 26,27 and 8,6 on PCA10056 board. 

    So whats different between serial_uartes initialization of UARTs and  APP_UART_FIFO_INIT() in ble_app_uart example ?

    I also tested P101,102,103 and 104 as outputs and can control HIGH or LOW levels on these lines. But with UART they don't work.

    I am really sorry my understanding is very limited for whats really going on inside your libraries.

    Best Regards,

    Thanks, Rishi

Related