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

scan_start() program crashes

Hello all:
I have a big problem,I use SDK13.1, softdevice is S132_V4.0.2.When the program starts executing scan_start(),the program crashes.
At first I thought there is a big bug in my program,When I use the example (..\nRF5_SDK_13.1.0_7ca7556\examples\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay\pca10040\s132\arm5_no_packs),the program also crashes,At last I found there is a Bluetooth device near,that broadcast packet length of 35bytes,but the program set the max length of the broadcast report is 31bytes (#define BLE_GAP_ADV_MAX_SIZE (31)), so I don't know how can I solve it,please help me ....

image description

Parents
  • Hi rc766437.

    I'm not quite sure what your problem is.
    You were able to solve the problem with the scan_start() causing your application to crash, and can now see your device advertising?
    If not, I would suggest that you try debugging to find out why it is crashing.

    Regarding your advertisement packet being larger than 31 bytes, this should not be possible.
    However, if you are adding something to the scan response data, this will show up in the RAW data in nRF Connect, making it seem that your advertisement packet is larger than 31 bytes.

    Your RAW data currently consists of;

    Flag field(Type 0x01): 			        Lenght (1), Type (1) and Flag (1) = 3 bytes. 
    16-bit Service Class UUID(Type 0x03):	Lenght (1), Type (1) and UUID (2) = 4 bytes. 
    Manufacturer Specific data(Type 0xFF): 	Lenght (1), Type (1) and Data (11) = 13 bytes. 
    Complete Local Name(Type 0x09):		    Lenght (1), Type (1) and Name (13) = 15 bytes. 
    

    It's hard to know without looking at your code, but my guess would be that some of these data is added to the scan response packet?

    Best regards,
    Joakim.

Reply
  • Hi rc766437.

    I'm not quite sure what your problem is.
    You were able to solve the problem with the scan_start() causing your application to crash, and can now see your device advertising?
    If not, I would suggest that you try debugging to find out why it is crashing.

    Regarding your advertisement packet being larger than 31 bytes, this should not be possible.
    However, if you are adding something to the scan response data, this will show up in the RAW data in nRF Connect, making it seem that your advertisement packet is larger than 31 bytes.

    Your RAW data currently consists of;

    Flag field(Type 0x01): 			        Lenght (1), Type (1) and Flag (1) = 3 bytes. 
    16-bit Service Class UUID(Type 0x03):	Lenght (1), Type (1) and UUID (2) = 4 bytes. 
    Manufacturer Specific data(Type 0xFF): 	Lenght (1), Type (1) and Data (11) = 13 bytes. 
    Complete Local Name(Type 0x09):		    Lenght (1), Type (1) and Name (13) = 15 bytes. 
    

    It's hard to know without looking at your code, but my guess would be that some of these data is added to the scan response packet?

    Best regards,
    Joakim.

Children
No Data
Related