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

configuration BLE and softdevice

Hello,

I'm working with a proprietary chip that has a nRF51822. I want to configure it as a BLE peripheral. I'm using ble_ app_uart example to achieve this.

I tried it on the dongle nRF51 and it works fine. Now I'm transferring it to the chip. I had some problems with the SOFTDEVICE_HANDLER_INIT function because of the clock configuration, as you can see on this post.

I configured to use the NRF_CLOCK_LF_SRC_RCand now it doesn't give me an error when trying to enable the sofdevice. When it goes to the ble_advertising_start(BLE_ADV_MODE_FAST); function it doesn't give me an error but it doesn't connect to the central (configured on a DK51 and previously tested).

My chip has a crystal connected to the pins XC1 and XC2, but none connected to the XL1 and XL2 pins, that why I use the internal oscillator. I'm not getting any errors when I configure the pins/clocks nor when I enable the functions I need, but it still doesn't connect to the central.

Other thing is that I'm using the DK51 to program and debug the chip because I don't have access to a J-link probe, does this introduce some problems? Because when I debug it seems to respond strangely some times.

So I wanted to ask for some help, regarding this problem, it goes to the advertising (appears to have the right settings) but it doesn't connect to the central device!

I reviewed some questions to avoid duplication; apologies if this was already asked and/or answered. Here are some snippets of my code, at least what I think it is important for this problem, If needed more just ask!

Thanks, Jorge. (I use nrf51, SDK11 and SD130 v2)

  • Is the chip advertising? Check by using Master Control Panel on the computer or a smart phone.

    There should be no problem using nRF51 DK as a programmer, just make sure that it is flashing the correct chip (and not the one on the board). It will flash an external chip if it detects voltage on VTG pin on the debug out interface.

  • I changed my program to be simpler, I deleted all the services I had (SPI, I2C, some buttons implementations) and I'm using the ble_app_uart example on the chip with some minor changes on the configuration of the clock source as explained on the question.

    It is configured for the right chip (one is a nrf51422 and the other is nRF51822, and I'm putting it on the nRF51822) and when I debug it via Keil it goes through all initializing functions without errors and it runs to the advertising status, but then I can't see it using MCP, or my iphone, or other DK. The problem is the only way I think I have to debug is to use the Keil debugger, but is really weird to work with (sometimes let me put some breakpoints and other times without changing anything don't allow the same breakpoints :s)

  • PS: I try the same software on a Dongle and it works, the only difference from both chips is some pin configurations and the no clock connected to the XL pins.

  • I changed the optimization to level 0 (was using level 1) for Debug, and now I can clearly see th function err_code = ble_advertising_start(BLE_ADV_MODE_FAST); it's passed without errors and goes to the power_manage() step, waiting for some event to come. but still can't see my device anywhere

  • Just curious: does it work with NRF_CLOCK_LF_SRC_SYNTH? Found this similar case, but there was no solution other than using synthesized clock. Using synthesized clock is generally a bad idea as it draws much more current than using LFCLK RC.

Related