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

BLE stops advertising once changed UART tx and rx pin

Hi All,

I am using Nordic SDK version nrf51_SDK_9.0.0 for PCA10028 board. In that i am using application

D:\nRF51_SDK_9.0.0_2e23562\examples\ble_central_and_peripheral\experimental\app_s130_demo

with S130_V_1.0.0 softdevice.

But if i change UART RX and TX pin, the device is not giving advertisement.

Can you check and let me know what may be the issue.

  • int main(void) { uint32_t err_code;

        board_configure();
        rtc1_init();
    
        LOG_DEBUG("%s: Enabling SoftDevice...", __FUNCTION__);
        
        if (NRF_SUCCESS != sd_softdevice_enable((uint32_t)NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, softdevice_assert_callback))
        {
            APP_ASSERT (false);
        }
    
        ble_enable_params_t ble_enable_params = 
        {
            .gatts_enable_params = 
            {
                .service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT,
                .attr_tab_size   = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT
            }
        };
        if (NRF_SUCCESS != sd_ble_enable(&ble_enable_params))
        {
            APP_ASSERT (false);
        }
        
        if (NRF_SUCCESS != sd_nvic_EnableIRQ(SD_EVT_IRQn))
        {
            APP_ASSERT (false);
        }
        LOG_INFO("#########################");
        LOG_INFO("# S130 Demo application #");
        LOG_INFO("#########################");
        LOG_INFO("INFO: Press button 1 to connect to peripherals.");
        LOG_INFO("INFO: Press button 2 to see the buffered data");
        LOG_INFO("INFO: Press both 1 and 2 buttons to quit demo.");
        LOG_INFO("Inital error reason %d\r\n", err_code);
    		
    		
        own_service_setup();
        peripherals_info_reset();
        central_info_reset();
    
    //		err_code = sd_ble_gap_scan_start(&m_scan_param);
    //    APP_ERROR_CHECK(err_code);
    //		if ((err_code = event_handle(BLE_GAP_EVT_ADV_REPORT, 2000, NULL, NULL)))
    //		{
    //		}
        do_work();
        
        LOG_DEBUG("%s: End demo application...", __FUNCTION__);
        while (1);
    }
    

    Here is Piece of UART CODE

    static void uart_init(void)
    {
    	
    	 /**@snippet [UART Initialization] */
        simple_uart_config(RTS_PIN_NUMBER, TX_PIN_NUMBER, CTS_PIN_NUMBER, RX_PIN_NUMBER, HWFC);
        
        NRF_UART0->INTENSET = UART_INTENSET_RXDRDY_Enabled << UART_INTENSET_RXDRDY_Pos;
        
        NVIC_SetPriority(UART0_IRQn, APP_IRQ_PRIORITY_LOW);
        NVIC_EnableIRQ(UART0_IRQn);
        /**@snippet [UART Initialization] */
    	}
    

    Here I change RX and TX pin

    #define RX_PIN_NUMBER  11
    #define TX_PIN_NUMBER  9
    #define CTS_PIN_NUMBER 10
    #define RTS_PIN_NUMBER 8
    #define HWFC           true
    

    Here is pin config in pca10028.h file, if i keep RX and TX 11 and 9 as default works properly, but if change pins , not giving advertisement

  • @Fab1223 Please edit your question and include the code. And mark the code and use the 101010 button.

  • "not giving advertisement". 99.9% of the time that means you're in the error handler. So put a breakpoint there and find out which system call gave you an error and why.

Related