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

Using MDBT42Q and BLE

Hello:

I'm relatively new and have been using 52832 DK for several months without any problems.  It is a great product.  As I gained experience, I've tried programming other boards (GT52832_A01) using a mini J-Link that I bought from Adafruit - again without problems. All of the example programs load and run on both DK and GT boards as expected.

I recently bought a few MDBT42Q modules from Mouser (they are made by Seeed Studios).  I believe this is the same module used by Adafruit on their Featherboard 52832, so I thought this would be a good product to expand my experience.  I was able to program the MDBT42Q boards using the J-Link, however, when I try to use anything with BLE the program loads but I'm not able to connect to the board via BLE.  I load the soft device loads and then the program the same way as with the DK and GT boards, except I'm not able to connect to the MDBT42Q board.  It is as if the board isn't advertising.

I did a search in the DevZone and found one post by Sudarshan J 10 months ago that looked similar to my problem but I'm not sure how to proceed and hope you might suggest some things to try.  

The datasheet for the MDBT42Q basically says that you don't need any external circuitry to make the module work, so it may not be a clock problem - but I'm not sure.  Since the module works fine (I can load simple blinky programs and program gpio, etc), I think I'm missing something simple.  

Any suggestions?

A related question - I tried to use debug to set breakpoints before and after the advertising function to try to see what was happening.  I tried to go stepwise through the program but execution just stops - so I must be missing something there as well.  There is a warning that there is a 32Kb limit on evaluation in debug - is that the problem?  Any suggestions?

Thank you for your help.

Parents Reply Children
  • I haven't tested this extensively but I'm now able to communicate with the MDBT42Q via BLE.  It involved 2 steps.

    1.   you need to change the clock source in the ble_stack_init function (or wherever the soft device handler is located) as follows:

    change:  

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false);

    to:

    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION, false);

    2.

    Use the debugger on SDK board instead of the mini JLink I have been using.  I don't understand why this worked - but it did. 

    I made an 8 pin connector for the 8 pins next to the PCA10040.  VDD and VTG are connected to SDK VDD 3.3 V supply.  SWDIO connect to MDBT Module SWDIO (pin 37).  SWDCLK to MDBT Module SWDCLK (Pin 36) and Reset to MDBT Module reset (Pin 35).  SWO not connected. GND detect connected to common ground on both SDK board and Module.  In my setup the module is connected to separate 3.3v supply with common ground.  VDD nRF is not connected.

    Since making those changes I've been able to load programs on the SDK board and test them and then connect the MDBT module (via the 8 pin connector) and load the same softdevice and program.  The Module then runs the program the same as the SDK board.

    I've tested the BLE_blinky program and that works on MDBT the same as the SDK board  using nRF Blinky app on android phone.  

  • Use the debugger on SDK board instead of the mini JLink I have been using.  I don't understand why this worked - but it did.

    You'd need to take that up with Adafruit.

  • Thank you for bringing zero value to this thread. 

    I did everything the OP posted before I found this thread. That's why I posted to see if he had come up with anything. 

    Yes.

    Yes.

    If you're not going to be constructive and act like a neckbeard please just move along.

  • Thanks for posting, glad you got it going!

    I'll double check my connections but the NRF52-DK seems to be flashing the MDBT42Q with the application and SD without any errors. I'm not connecting the reset pin, is that required?

    You much be using an older SDK, I don't see that macro (SOFTDEVICE_HANDLER_INIT) in version 15 of the SDK which is what I'm using. But I have tried setting the equivalent defines in the sdk_config.h so it should equate to the same settings for the clock. Still no love... I'll keep trying.

    I should add, like you the examples that don't use the SD work fine. Blinky for example runs fine as I made a board file for the MDBT42Q with proper pin configurations. 

  • EXT:

    I had the exact same experience. 

    I'm using version 15 of SDK also.  I've noticed a few differences in the code depending on the example  you start with and where you get the example code.  Some code has SOFT_DEVICE_HANDLER but not all.

    I'm planning to test a few variations later today and will post exactly the version I start with, changes I make, and results.  

Related