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

NRF barebone snippet transmit code

Hello, I am new to NRF52. I have setup a project under Embitz ide. I can compile GPIO toggle code and program the the code. However when I try an transmit example github.com/.../main.c. the the packets are not seen in Bluetooth sniffer. Is there any thing I am missing?

  • Hi

    The reason you're not seeing these packets on your Bluetooth sniffer is that this packet is not a BLE packet, but rather just a basic proprietary 2.4GHz packet with arbitrary values. In order to make an advertising packet transmitting as a Bluetooth device, there are a lot of layers, flags, and settings that must be in order to comply with the Bluetooth spec. You can check out our ble_peripheral SDK examples to see how we set up the radio and advertising data to transmit Bluetooth advertising packets.

    Best regards,

    Simon

  • OK. But a sniffer is also not detecting  these packets? I am using Bluefruit BLE sniffer? 

    Actually I want to generate advertising packets only and don't need a full bluetooth stack?

    Can you help  me with a bare bone code to generate Advertising packet?

  • Hi

    Are you using this product? Have you followed the introduction and implemented the necessary Wireshark profile specified here

    As specified in the introduction the Bluefruit BLE sniffer can only be used to sniff Bluetooth Low Energy devices, so you won't be able to see other advertising packets.

    mukund said:
    But a sniffer is also not detecting  these packets?

     Have you tried any of our BLE SDK examples on a DK for example to check if you can see them on the Sniffer device?

    Best regards,

    Simon

  • The sniffer setup is working perfectly and showing bluetooth packets from mobile.

    I am using MDBT42Q-P192 from Raytec. I have tried to load hex files from SDK16 but none of the hex file works. My Jtag is working because the code which I have compiled from snippet is working perfectly. I don't know, what I am missing.

  • Hi

    The module you have is not able to run the .hex files we have because it doesn't include the optional 32.768kHz crystal in its design, which all of our example projects use. You can easily modify an example in your IDE to use the internal RC oscillator instead by setting the following values in the sdk_config.h file of your project.

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

Related