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

a problem in "ACI_DEVICE_STANDBY"

hi. Im working with nrf8001 type c in a self-designed board and im using arduino library driver on github by nordic. my mcu is stm32 and i ported library to my mcu. when I debug my program i find that my program go to "ACI_DEVICE_STANDBY" case in aci loop and nrf respond me with "03 84 0F" . as i understand, it means that nrf will advertise in this state. but when i use a smartphone with android 4.4 and BLE enabled i cant see nrf8001 in nrf uart app that made by nordic in play store. and im using service.h in "hello world" project.(type c , internal 32768, external crystal 16 MHz). please help what problems may be exist im my project or what points I have to check again? thank you.

  • thank you for response. As you said I can't see my nrf8001 advertisement in 1 cm distance from smartphone even. I use 32KHz Internal RC (in fact i didnt use any 32KHz external component or clock source) and 16 MHz external crystal.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE AttributeServer>
     <Profile Version="1.3">
    <SetupId>0</SetupId>
    <Device>nRF8001_Cx</Device>
    <Service Type="local" PrimaryService="true">
        <Name>Device Information</Name>
        <Uuid>180a</Uuid>
        <Characteristic>
            <Name>Hardware Revision String</Name>
            <Uuid>2a27</Uuid>
            <DefaultValue>0A</DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>9</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>true</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="25" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>Manufacturer Name String</Name>
            <Uuid>2a29</Uuid>
            <DefaultValue>3031</DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>20</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>true</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="25" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>Model Number String</Name>
            <Uuid>2a24</Uuid>
            <DefaultValue>3132</DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>8</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>true</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="25" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>Firmware Revision String</Name>
            <Uuid>2a26</Uuid>
            <DefaultValue>3334</DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>4</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>true</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="25" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>PNP_ID</Name>
            <Uuid>2a50</Uuid>
            <DefaultValue>020000AAAACCCC</DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>7</MaxDataLength>
            <AttributeLenType>1</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>true</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
    </Service>
    <Service Type="local" PrimaryService="true">
        <Name>UART over BTLE</Name>
        <Uuid BaseUUID="6E400000B5A3F393E0A9E50E24DCCA9E" BaseUUIDName="UART Base UUID">0001</Uuid>
        <Characteristic>
            <Name>UART RX</Name>
            <Uuid BaseUUID="6E400000B5A3F393E0A9E50E24DCCA9E" BaseUUIDName="UART Base UUID">0002</Uuid>
            <DefaultValue></DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>20</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>true</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>false</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>UART TX</Name>
            <Uuid BaseUUID="6E400000B5A3F393E0A9E50E24DCCA9E" BaseUUIDName="UART Base UUID">0003</Uuid>
            <DefaultValue></DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>20</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>true</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>false</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>UART Control Point</Name>
            <Uuid BaseUUID="6E400000B5A3F393E0A9E50E24DCCA9E" BaseUUIDName="UART Base UUID">0004</Uuid>
            <DefaultValue></DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>9</MaxDataLength>
            <AttributeLenType>2</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>true</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>true</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>false</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
        <Characteristic>
            <Name>UART Link Timing Current</Name>
            <Uuid BaseUUID="6E400000B5A3F393E0A9E50E24DCCA9E" BaseUUIDName="UART Base UUID">0005</Uuid>
            <DefaultValue>FFFFFFFFFFFF</DefaultValue>
            <UsePresentationFormat>0</UsePresentationFormat>
            <MaxDataLength>6</MaxDataLength>
            <AttributeLenType>1</AttributeLenType>
            <ForceOpen>false</ForceOpen>
            <Properties>
                <WriteWithoutResponse>false</WriteWithoutResponse>
                <Write>false</Write>
                <Notify>false</Notify>
                <Indicate>false</Indicate>
                <Broadcast>false</Broadcast>
            </Properties>
            <SetPipe>true</SetPipe>
            <AckIsAuto>false</AckIsAuto>
            <PresentationFormatDescriptor Value="0000" Exponent="0" Format="1" NameSpace="01" Unit="0000"/>
            <PeriodForReadingThisCharacteristic>0</PeriodForReadingThisCharacteristic>
            <PeriodForProperties/>
        </Characteristic>
    </Service>
    <Gapsettings>
        <Name>Hello</Name>
        <DeviceNameWriteLength>0</DeviceNameWriteLength>
        <LocalPipeOnDeviceName>false</LocalPipeOnDeviceName>
        <DeviceNameShortLength>0</DeviceNameShortLength>
        <Apperance>0080</Apperance>
        <SecurityLevel>0</SecurityLevel>
        <AuthenticationReq>0</AuthenticationReq>
        <IoCapabilities>1</IoCapabilities>
        <BondTimeout>600</BondTimeout>
        <SecurityRequestDelay>10</SecurityRequestDelay>
        <MinimumKeySize>7</MinimumKeySize>
        <MaximumKeySize>16</MaximumKeySize>
        <AdvertisingDataBondedBitmap>10</AdvertisingDataBondedBitmap>
        <AdvertisingDataGeneralBitmap>1a</AdvertisingDataGeneralBitmap>
        <AdvertisingDataBrodcastBitmap>0</AdvertisingDataBrodcastBitmap>
        <AdvertisingDataBondedScanResponseBitmap>0</AdvertisingDataBondedScanResponseBitmap>
        <AdvertisingDataGeneralScanResponseBitmap>0</AdvertisingDataGeneralScanResponseBitmap>
        <AdvertisingDataBrodcastScanResponseBitmap>0</AdvertisingDataBrodcastScanResponseBitmap>
        <AdvertisingDataBondedBitmapCustom>0</AdvertisingDataBondedBitmapCustom>
        <AdvertisingDataGeneralBitmapCustom>0</AdvertisingDataGeneralBitmapCustom>
        <AdvertisingDataBrodcastBitmapCustom>0</AdvertisingDataBrodcastBitmapCustom>
        <AdvertisingDataBondedScanResponseBitmapCustom>0</AdvertisingDataBondedScanResponseBitmapCustom>
        <AdvertisingDataGeneralScanResponseBitmapCustom>0</AdvertisingDataGeneralScanResponseBitmapCustom>
        <AdvertisingDataBrodcastScanResponseBitmapCustom>0</AdvertisingDataBrodcastScanResponseBitmapCustom>
        <TxPowerLevelOffset>0</TxPowerLevelOffset>
        <MinimumConnectionInterval>10</MinimumConnectionInterval>
        <MaximumConnectionInterval>18</MaximumConnectionInterval>
        <SlaveLatency>0</SlaveLatency>
        <TimeoutMultipler>10</TimeoutMultipler>
        <AddServiceUpdateCharacteristic>true</AddServiceUpdateCharacteristic>
        <AddServiceUpdateCharacteristicPipe>true</AddServiceUpdateCharacteristicPipe>
        <ServiceToAdvertise>
            <Uuid BaseUUID="6E400000B5A3F393E0A9E50E24DCCA9E" BaseUUIDName="UART Base UUID">0001</Uuid>
        </ServiceToAdvertise>
        <CustomAdTypes>
            <AdType index="1">
                <Type>19</Type>
                <Value>8000</Value>
            </AdType>
            <AdType index="2">
                <Type>18</Type>
                <Value></Value>
            </AdType>
        </CustomAdTypes>
    </Gapsettings>
    <Hardwaresettings>
        <Clocksource>1</Clocksource>
        <ClockAccuracy>1</ClockAccuracy>
        <InitialTxPower>3</InitialTxPower>
        <HfClkSource>0</HfClkSource>
        <DcDcConverter>0</DcDcConverter>
        <ActiveSignalModeIndex>0</ActiveSignalModeIndex>
        <ActiveSignalToTickDistance>0</ActiveSignalToTickDistance>
        <DynamicWindowLimitingEnabled>false</DynamicWindowLimitingEnabled>
    </Hardwaresettings>
    <CurrentInput>
        <BatteryCharge>220</BatteryCharge>
        <Master32KhzClockAccuracy>10</Master32KhzClockAccuracy>
        <ConnectionInterval>1000</ConnectionInterval>
        <PercentOfTimeSleeping>10</PercentOfTimeSleeping>
        <PercentOfTimeAdvertising>10</PercentOfTimeAdvertising>
        <AdvertisingInterval>1280</AdvertisingInterval>
    </CurrentInput>
    
  • you can see my frames that sent via uart for debuging from starting program.(note that my uart frames are always 8 bytes) I have a question. why in some cases nrf8001 send me 03 as len but I receive 4 bytes. for example 03 84 06 01 02 ??? is it a fault?

    00000000: 00 00 00 00 00 00 00 00  |  00 00 00 00 00 00 00 00    ................  
    00000010: 00 04 81 02 00 02 00 00  |  00 03 84 06 01 00 00 00    .........„.....  
    00000020: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000030: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000040: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000050: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000060: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000070: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000080: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000090: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    000000a0: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    000000b0: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    000000c0: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    000000d0: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    000000e0: 00 03 84 06 01 00 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    000000f0: 00 03 84 06 01 02 00 00  |  00 03 84 06 01 00 00 00    ..„.......„.....  
    00000100: 00 03 84 06 01 00 00 00  |  00 03 84 06 02 00 00 00    ..„.......„.....  
    00000110: 00 04 81 03 00 02 00 00  |  00 04 81 03 00 02 00 00    ..............  
    00000120: 00 03 84 0F 00 00 00 00  |  00 03 84 0F 00 00 00 00    ..„.......„.....  
    00000130: 00 03 84 0F 00 00 00 00  |  00 03 84 0F 00 00 00 00    ..„.......„.....  
    00000140: 00 03 84 0F 00 00 00 00  |  00 03 84 0F 00 00 00 00    ..„.......„.....  
    00000150: 00 03 84 0F 00 00 00 00  |  00 03 84 0F 00 00 00 00    ..„.......„.....  
    00000160: 00 03 84 0F 00 00 00 00  |  00 03 84 0F 00 00 00 00
    
    • Run the ACI transport verification.

    • Look at Section 7 in the nRF8001 Datasheet which explains the position of the debug byte.

    • Get an nRF8001 D version as that is the latest version with a number of bug fixes, you will save yourself a lot of pain.

    • The length bytes are to strictly used i.e. any data beyond the length should be discarded.

    • You receive the "03 84 06 02" (see the Section on the setup command in section 24.6) followed by a Device Started Event (04 81 03 00 02) so the nRF8001 seems to have started successfully.

    • The Connect command seems to have been successfully sent but there is no Disconnected Event after that.

    • Your UART trace is not easy to understand, how are we to see the order of the ACI Events. Attach a trace that has shows the order of the messages.

  • Thank you David for your response.

    *I ran ACI transport verification. Its OK. ("Echo OK")

    *my received packets respectively are:

    04 81 02 00 02 _ 03 84 06 01 (for many times) _ 03 84 06 02 _ 04 81 03 00 02 (for 2 times) _ 03 84 0F 00 (forever)

  • What timeout and adv interval values do you use when issuing the connect command?

Related