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

nRF52832 (MDBT42Q module) never has correct Services and Characteristics

This is a strange one.  I had a custom PCB that included an MDBT42Q module.  After I learned how to program it, it worked fine.  I made a slight revision to the PCB, and this time I ordered the module from Digikey.  I was able to program it, SoftDevice 6.1.1 as have been all my programs for the past 6 months, and my program HEX file.  But no matter what BLE Services and Characteristics I add, all that any Central device that connects can see are:

In my code I have my own custom Services with my own custom UUIDs (0xDEAD, 0xBEEF, very obvious names) and tons of custom characteristics.  I actually don't enable the DIS and Battery Services, much less HID or TX Power.  When I program the same HEX file to the old PCB, they show up when the nRF app polls the device.  The same HEX file on this new one only shows these stock services seen in the image.

But I know I'm uploading the right file.  I can change the name that gets advertised and that's what I see: "Weird Test" as it says here.  I can see that my custom 0xDEAD service is being advertised, but it can't be found when I discover services after connecting.  I can even double check by playing around with the GPIO and get LEDs to flash and everything while it's advertising something completely different from what's in the rest of the code! I can also use Ozone and step through the code line by line, and I see that the lines that set up these characteristics, add their callbacks, etc... are all being run.  And I haven't touched that part of the code for months!

But with this module only, I'm not seeing any of the custom Services and Characteristics that I set up in my code.  I've tried using nRFgo to erase the entire chip and rewrite the 6.1.1 SoftDevice and my Hex file specifically to make sure nothing on the chip was corrupted.

Is this like a stock error kind of thing?  Is it not being able to initialize my custom Services and catching the error by defaulting to these?

Parents
  • Hi

    I believe this could happen due to a couple of things.

    First, does this new module have the same address as your previous PCB? In that case, that might be why you're not able to see the services on this new device. Please try giving it a new address and/or delete the bonding information on your central (I assume this is a phone). 

    Next, have you included the external LF clock in your design. This is not part of most 3rd party modules (including this one) and our examples are configured to use this LF clock. You can make these changes in the sdk_config.h file in order to configure the chip to use the internal LFRC instead as well. (This does not seem like the symptoms of using an incorrect LF clock though, but I thought I'd add it just in case).

    // <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

    Best regards,

    Simon

  • Hi Simon.  I verified the answer because it worked, but I don't know if it doesn't show up for you anymore.  I'm curious at why this could happen with the bonding.  Thanks!

Reply Children
No Data
Related