This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2652R: Sysconfig generated scan response data wrong

Part Number: CC2652R
Other Parts Discussed in Thread: SYSCONFIG, SYSBIOS

If I add manufacturer specific data to the scan response section in Sysconfig it seems to generate an incorrect length for the manufacturer data, e.g.

generates a length of 0x10 when it I believe it should be 0xF.

uint8_t scanResData1[] =
{
0x07,
GAP_ADTYPE_LOCAL_NAME_COMPLETE,
'0',
'0',
'0',
'0',
'0',
'0',

0x05,
GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
LO_UINT16(24),
HI_UINT16(24),
LO_UINT16(40),
HI_UINT16(40),

0x10,
GAP_ADTYPE_MANUFACTURER_SPECIFIC,
//Company Identifier
0x50,
0x54,

//Additional Data
0x11,
0x22,
0x33,
0x44,
0x55,
0x66,
0x77,
0x88,
0x99,
0xaa,
0xbb,
0xcc,

};

  • Hey Martin,

    Which SDK version are you using? I am not able to reproduce this on the latest SDK.

  • I am porting my code to simplelink_cc13xx_cc26xx_sdk_6_30_01_03. I'm pretty sure I noticed this issue a few years ago with a much older SDK but managed to work around it. With this version I get an error because the length is >31 so I can't this time.

    This is the .syscfg file:

    /**
    * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
    * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    * @cliArgs --device "CC2642R1FRGZ" --package "RGZ" --part "Default" --rtos "tirtos7" --product "simplelink_cc13xx_cc26xx_sdk@6.30.01.03"
    * @versions {"tool":"1.14.0+2667"}
    */

    /**
    * Import the modules used in this configuration.
    */
    const ble = scripting.addModule("/ti/ble5stack/ble");
    const CCFG = scripting.addModule("/ti/devices/CCFG");
    const rfdesign = scripting.addModule("/ti/devices/radioconfig/rfdesign");
    const Display = scripting.addModule("/ti/display/Display");
    const Display1 = Display.addInstance();
    const AESCCM = scripting.addModule("/ti/drivers/AESCCM");
    const AESCCM1 = AESCCM.addInstance();
    const AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG");
    const AESCTRDRBG1 = AESCTRDRBG.addInstance();
    const AESECB = scripting.addModule("/ti/drivers/AESECB");
    const AESECB1 = AESECB.addInstance();
    const ECDH = scripting.addModule("/ti/drivers/ECDH");
    const ECDH1 = ECDH.addInstance();
    const GPIO = scripting.addModule("/ti/drivers/GPIO");
    const GPIO1 = GPIO.addInstance();
    const GPIO2 = GPIO.addInstance();
    const GPIO15 = GPIO.addInstance();
    const GPIO16 = GPIO.addInstance();
    const GPIO17 = GPIO.addInstance();
    const Power = scripting.addModule("/ti/drivers/Power");
    const RF = scripting.addModule("/ti/drivers/RF");
    const SPI = scripting.addModule("/ti/drivers/SPI", {}, false);
    const SPI1 = SPI.addInstance();
    const SPI2 = SPI.addInstance();
    const TRNG = scripting.addModule("/ti/drivers/TRNG");
    const TRNG1 = TRNG.addInstance();
    const Timer = scripting.addModule("/ti/drivers/Timer", {}, false);
    const Timer1 = Timer.addInstance();
    const Timer2 = Timer.addInstance();
    const Timer3 = Timer.addInstance();
    const Timer4 = Timer.addInstance();
    const UART2 = scripting.addModule("/ti/drivers/UART2", {}, false);
    const UART21 = UART2.addInstance();
    const UART22 = UART2.addInstance();
    const Watchdog = scripting.addModule("/ti/drivers/Watchdog", {}, false);
    const Watchdog1 = Watchdog.addInstance();
    const Settings = scripting.addModule("/ti/posix/tirtos/Settings");
    const BIOS = scripting.addModule("/ti/sysbios/BIOS");
    const GateMutexPri = scripting.addModule("/ti/sysbios/gates/GateMutexPri");
    const HeapCallback = scripting.addModule("/ti/sysbios/heaps/HeapCallback");
    const Event = scripting.addModule("/ti/sysbios/knl/Event");
    const Idle = scripting.addModule("/ti/sysbios/knl/Idle", {}, false);
    const Idle2 = Idle.addInstance();
    const Mailbox = scripting.addModule("/ti/sysbios/knl/Mailbox");
    const Error = scripting.addModule("/ti/sysbios/runtime/Error");
    const SysCallback = scripting.addModule("/ti/sysbios/runtime/SysCallback");
    const Timestamp = scripting.addModule("/ti/sysbios/runtime/Timestamp");

    /**
    * Write custom configuration values to the imported modules.
    */
    ble.lockProject = true;
    ble.extAdv = false;
    ble.defaultTxPower = "HCI_EXT_TX_POWER_5_DBM";
    ble.deviceName = "000000";
    ble.maxConnNum = 1;
    ble.maxPDUNum = 3;
    ble.maxPDUSize = 90;
    ble.bonding = false;
    ble.allowDebugKeys = false;
    ble.disableDisplayModule = true;
    ble.tbmActiveItemsOnly = false;
    ble.noOsalSnv = true;
    ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
    ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0";
    ble.connUpdateParamsPeripheral.reqMinConnInt = 30;
    ble.connUpdateParamsPeripheral.reqMaxConnInt = 50;
    ble.connUpdateParamsPeripheral.reqConnTo = 3000;
    ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0";
    ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0";
    ble.advSet1.advParam1.txPower = "otherTxPower";
    ble.advSet1.advParam1.txPowerValue = 5;
    ble.advSet1.advData1.$name = "ti_ble5stack_broadcaster_advertisement_data0";
    ble.advSet1.advData1.GAP_ADTYPE_FLAGS = true;
    ble.advSet1.advData1.advertisingFlags = ["GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED","GAP_ADTYPE_FLAGS_GENERAL"];
    ble.advSet1.advData1.shortenedLocalName = "SP";
    ble.advSet1.advData1.numOfUUIDs16More = 1;
    ble.advSet1.advData1.UUID016More = 0xFFF0;
    ble.advSet1.advData1.GAP_ADTYPE_16BIT_COMPLETE = true;
    ble.advSet1.advData1.numOfUUIDs16Complete = 1;
    ble.advSet1.advData1.UUID016Complete = 0xC0C0;
    ble.advSet1.scanRes1.$name = "ti_ble5stack_broadcaster_advertisement_data1";
    ble.advSet1.scanRes1.GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE = true;
    ble.advSet1.scanRes1.minConnInterval = 30;
    ble.advSet1.scanRes1.maxConnInterval = 50;
    ble.advSet1.scanRes1.GAP_ADTYPE_MANUFACTURER_SPECIFIC = true;
    ble.advSet1.scanRes1.companyIdentifier = 0x5054;
    ble.advSet1.scanRes1.GAP_ADTYPE_LOCAL_NAME_COMPLETE = true;
    ble.advSet1.scanRes1.additionalData = "0x112233445566778899AABBCC";
    ble.advSet2.$name = "ti_ble5stack_broadcaster_advertisement_set1";
    ble.advSet2.advParam2.$name = "ti_ble5stack_broadcaster_advertisement_params1";
    ble.advSet2.advData2.$name = "ti_ble5stack_broadcaster_advertisement_data2";
    ble.advSet2.advData2.GAP_ADTYPE_FLAGS = true;
    ble.advSet2.advData2.advertisingFlags = ["GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED","GAP_ADTYPE_FLAGS_GENERAL"];
    ble.advSet2.advData2.numOfUUIDs16More = 1;
    ble.advSet2.advData2.UUID016More = 0xFFF0;
    ble.advSet2.advData2.GAP_ADTYPE_16BIT_COMPLETE = true;
    ble.advSet2.advData2.numOfUUIDs16Complete = 1;
    ble.advSet2.advData2.UUID016Complete = 0xC0C0;
    ble.advSet2.scanRes2.$name = "ti_ble5stack_broadcaster_advertisement_data3";
    ble.advSet2.scanRes2.GAP_ADTYPE_LOCAL_NAME_COMPLETE = true;
    ble.advSet2.scanRes2.GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE = true;
    ble.advSet2.scanRes2.minConnInterval = 30;
    ble.advSet2.scanRes2.maxConnInterval = 50;
    ble.advSet2.scanRes2.GAP_ADTYPE_MANUFACTURER_SPECIFIC = true;
    ble.advSet2.scanRes2.companyIdentifier = 0x0000;
    ble.advSet2.scanRes2.additionalData = "0x112233445566778899AABBCC";

    CCFG.enableBootloaderBackdoor = true;
    CCFG.dioBootloaderBackdoor = 13;
    CCFG.levelBootloaderBackdoor = "Active low";
    CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0";

    Display1.$name = "CONFIG_Display_0";
    Display1.enableANSI = true;
    Display1.uartBufferSize = 128;
    Display1.displayType = "Host";
    Display1.maxPrintLength = 16;

    AESCCM1.$name = "CONFIG_AESCCM0";

    AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0";
    AESCTRDRBG1.aesctrObject.$name = "CONFIG_AESCTR_0";

    AESECB1.$name = "CONFIG_AESECB0";

    ECDH1.$name = "CONFIG_ECDH0";

    GPIO1.$name = "Board_FLASH_CS";
    GPIO1.initialOutputState = "High";
    GPIO1.mode = "Output";
    GPIO1.gpioPin.$assign = "ball.31";

    GPIO2.$name = "Board_FLASH_ENABLE";
    GPIO2.mode = "Output";
    GPIO2.initialOutputState = "High";
    GPIO2.gpioPin.$assign = "ball.26";

    GPIO15.$name = "Board_BUZZER";
    GPIO15.mode = "Output";
    GPIO15.gpioPin.$assign = "ball.18";

    GPIO16.$name = "Board_PModule_SPI_Config_CS";
    GPIO16.mode = "Output";
    GPIO16.gpioPin.$assign = "ball.32";

    GPIO17.$name = "Board_PModule_Ext_CS";
    GPIO17.mode = "Output";
    GPIO17.initialOutputState = "High";
    GPIO17.gpioPin.$assign = "ball.21";

    SPI1.$name = "CONFIG_SPI_0";
    SPI1.spi.$assign = "SSI0";
    SPI1.spi.sclkPin.$assign = "ball.7";
    SPI1.spi.misoPin.$assign = "ball.5";
    SPI1.spi.mosiPin.$assign = "ball.6";
    SPI1.spi.dmaRxChannel.$assign = "DMA_CH3";
    SPI1.spi.dmaTxChannel.$assign = "DMA_CH4";

    SPI2.$name = "CONFIG_SPI_1";
    SPI2.spi.$assign = "SSI1";
    SPI2.spi.sclkPin.$assign = "ball.30";
    SPI2.spi.misoPin.$assign = "ball.28";
    SPI2.spi.mosiPin.$assign = "ball.29";
    SPI2.spi.dmaRxChannel.$assign = "DMA_CH16";
    SPI2.spi.dmaTxChannel.$assign = "DMA_CH17";

    TRNG1.$name = "CONFIG_TRNG_0";

    Timer1.$name = "CONFIG_TIMER_0";
    Timer1.useGPTimer = true;
    Timer1.timerInstance.$name = "CONFIG_GPTIMER_0";
    Timer1.timerInstance.timer.$assign = "GPTM1";

    Timer2.$name = "CONFIG_TIMER_1";
    Timer2.useGPTimer = true;
    Timer2.timerInstance.$name = "CONFIG_GPTIMER_1";
    Timer2.timerInstance.timer.$assign = "GPTM1";

    Timer3.$name = "CONFIG_TIMER_2";
    Timer3.useGPTimer = true;
    Timer3.timerInstance.$name = "CONFIG_GPTIMER_2";
    Timer3.timerInstance.timer.$assign = "GPTM2";

    Timer4.$name = "CONFIG_TIMER_3";
    Timer4.useGPTimer = true;
    Timer4.timerInstance.$name = "CONFIG_GPTIMER_3";
    Timer4.timerInstance.timer.$assign = "GPTM2";

    UART21.$name = "CONFIG_UART2_0";
    UART21.flowControl = true;
    UART21.rxRingBufferSize = 128;
    UART21.uart.$assign = "UART0";
    UART21.uart.txPin.$assign = "ball.16";
    UART21.uart.rxPin.$assign = "ball.15";
    UART21.uart.ctsPin.$assign = "ball.17";
    UART21.uart.rtsPin.$assign = "ball.14";

    UART22.$name = "CONFIG_UART2_1";
    UART22.rxRingBufferSize = 128;
    UART22.uart.$assign = "UART1";
    UART22.uart.txPin.$assign = "ball.38";
    UART22.uart.rxPin.$assign = "ball.37";

    Watchdog1.$name = "CONFIG_WATCHDOG_0";
    Watchdog1.watchdog.$assign = "WDT0";

    BIOS.assertsEnabled = false;
    BIOS.rtsGateType = "BIOS_GateMutexPri";
    BIOS.heapSize = 0x00000000;
    BIOS.heapType = "HeapCallback";

    const Hwi = scripting.addModule("/ti/sysbios/family/arm/m3/Hwi", {}, false);
    Hwi.enableException = false;

    HeapCallback.initFxn = "osalHeapInitFxn";
    HeapCallback.allocInstFxn = "osalHeapAllocFxn";
    HeapCallback.freeInstFxn = "osalHeapFreeFxn";
    HeapCallback.getStatsInstFxn = "osalHeapGetStatsFxn";
    HeapCallback.isBlockingInstFxn = "osalHeapIsBlockingFxn";

    const Clock = scripting.addModule("/ti/sysbios/knl/Clock", {}, false);
    Clock.tickPeriod = 10;
    Clock.swiPriority = 5;

    const Timer_1 = scripting.addModule("/ti/sysbios/family/arm/cc26xx/Timer", {}, false);
    Timer_1.rtc.$assign = "RTC0";

    Idle2.$name = "powerIdle";
    Idle2.idleFxn = "Power_idleFunc";

    const Semaphore = scripting.addModule("/ti/sysbios/knl/Semaphore", {}, false);
    Semaphore.supportsPriority = false;

    const Swi = scripting.addModule("/ti/sysbios/knl/Swi", {}, false);
    Swi.numPriorities = 6;

    const Task = scripting.addModule("/ti/sysbios/knl/Task", {}, false);
    Task.defaultStackSize = 512;
    Task.idleTaskStackSize = 768;
    Task.numPriorities = 6;

    Error.policy = "Error_SPIN";
    Error.printDetails = false;

    const System = scripting.addModule("/ti/sysbios/runtime/System", {}, false);
    System.abortFxn = "System_abortSpin";
    System.exitFxn = "System_exitSpin";
    System.extendedFormats = "%f";
    System.supportModule = "SysCallback";

  • Hey Martin,

    I believe the 31 byte payload is a restriction that originates from the Bluetooth LE specification (Section 2.3.2.2 SCAN_RSP). If the advertisement is set to Legacy in Event Properties, you will see this error. You'll have to leverage the Extended Advertisement payload to send more data.

  • yes I know the limit it 31 but the issue is the array generated is wrong. If I just set the Additional Data field to 0x11 I get:

    0x05,
    GAP_ADTYPE_MANUFACTURER_SPECIFIC,
    //Company Identifier
    0x50,
    0x54,

    //Additional Data
    0x11,

    The length is 5 instead of 4, when the UI is computing the length it also uses this wrong length so the maximum sized array it will generate is 30 bytes if I add another byte it gives an error and wont compile. In older versions of the SDK it didn't error check the length so I could add one more byte and get the correct sized array then fix the length byte in code.

  • ok I figured it out. If you set "Additional Data" to 0x112233445566778899AABBCC it will correctly generate the 12 bytes of data but it includes the "0x" in the length calculation and it thinks it's 1 byte longer than it should be. If you set it to 112233445566778899AABBCC without the 0x it still interprets it as a hex string and generates the correct bytes and length.