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

SDK problem on nRF51801QCAB

Hi,

I'm using nRF51801QCAB for our BLE communication develop.

I was used SDK9.0.0 before,it is worked well,but SDK9.0.0 does not support numeric comparision when bonding.

So we changed the SDK to 12.3.0 for update. But when i use nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_uart\pca10028\s130,there is a problem troubles me:

my sample code is like:
// Enter main loop.
    for (;;)
    {
        power_manage();
        
        printf("test string\n");
        nrf_delay_ms(500);
    }
    
the output on uart is expected as a loop of "test string",but there is APP_UART_COMMUNICATION_ERROR occured.
when i used the same firmware on nRF51822,the output on uart is correct.
in the SDK 12.3.0 firmware project,the chip select is 'nrf51422_xxac',and in the Target page,the IRAM1 is start at 0x20001FE8,and size=0x6018(>24K).
but the nRF51801QCAB only have 16k RAM.

my question is
1,can i use the SDK12.3.0 on nrf51801QCAB?if the answer is not,which version of SDK should i choose?
2,why APP_UART_COMMUNICATION_ERROR is occured when i use SDK12.3.0 on nrf51801QCAB?

any sujessions would be very useful, Thank you very much for your support.
Best regards

Parents
  • Hi.

    Answers to your questions:

    1)

    If you look at the nRF51 Series IC revisions compatibility with SDK and SoftDevices list, you can see that you can use any of the IC rev 3 combinations.

    So you can use SDK 12.3 with SoftDevice S130 v2.0.0

    2)

    I think this happend because you are transmitting faster then you can handle the data on the RX side.

    You have to either use flow controll or modify the driver so that it can handle the OVERRUN of data.

    Best regards,

    Andreas

  • Hi Andreas,
    Thank you for your reply.
    In my routine,for protocol analysis,i have to check every byte and do some logical judgement.
    my test routine in uart_event_handle{case APP_UART_DATA_READY} is like:
    case A:
    {
        uint8_t tmpRxByte;
        UNUSED_VARIABLE(app_uart_get(&tmpRxByte));
        app_uart_put(tmpRxByte);
        ...do my logical judgement...
    }

    case B:
    {
        uint8_t tmpRxByte;
        UNUSED_VARIABLE(app_uart_get(&tmpRxByte));
        ...do my logical judgement...
        app_uart_put(tmpRxByte);
    }

    in case A i will receive the data that i was sent.
    in case B the received data will part missing sometimes.

    even if i change the baudrate from 115200 to 19200,the missing is still in case B.
    but in SDK 9.0.0, the same routine is works well.

    why the difference occurs between case A and case B?
    how can i do in case B for fix problem?

  • Hi.

    There could be some timing issue maybe? What do you do in the "logical judgement"? Can you please share some code? :-)

    Best regards,

    Andreas

  • Hi.

    There could be some timing issue maybe? What do you do in the "logical judgement"? Can you please share some code? :-)

    Best regards,

    Andreas

  • Hi Andreas,
    mycode is :
        static uint8_t tmpHead = 0;
        UNUSED_VARIABLE(app_uart_get(&tmpRxByte));
        UartRes.RxData[UartRes.RxDataLen++] = tmpRxByte;
        //app_uart_put(tmpRxByte);
        
        if(UartRes.RxExpectedLen == 0)
        {
            if( (UartRes.RxData[0] != UART_PROTOCOL_TAG_CMD) && (UartRes.RxData[0] != UART_PROTOCOL_TAG_DATA) )
            {
                UartRes.RxDataLen = 0;
                UartRes.RxExpectedLen = 0;
                break;
            }
            if(UartRes.RxDataLen >= UART_FRAME_HEAD_SIZE)
            {
                tmpHead = UartRes.RxData[0];
                UartRes.RxExpectedLen = UartRes.RxData[1]*256 +UartRes.RxData[2];
                if(UartRes.RxExpectedLen > UART_PAYLOAD_SIZE)
                {
                    UartRes.RxDataLen = 0;
                    UartRes.RxExpectedLen = 0;
                    break;
                }
            }
        }
        else
        {
            if(UartRes.RxDataLen >= UartRes.RxExpectedLen + UART_FRAME_HEAD_SIZE)
            {

                if(tmpHead != UartRes.RxData[0])
                {
                    printf("error\n"); /*Breakpoint*/
                }

                UartRxNeedToProcFlag = 1;

                //break;
            }
        }
        
    now i found that if i set a breakpoint at /*Breakpoint*/,then the debug will stop at that line which mean the value of UartRes.RxData[0] has been changed.it looks like some pointer operations out of bounds.
    bacause of the project is the sample project of nRF5_SDK_12.3.0_d7731ad_original\examples\ble_peripheral\ble_app_uart\pca10028\s130\arm5_no_packs,with minimal additional code as shown about.so i was little doubt about the settings of IRAM1 that start at 0x20001FE8 and size=0x6018(24k) it is out of the maximum of nRF5_SDK_1251801 RAM space(16k).

    could you help me that check the settings are correct?

Reply
  • Hi Andreas,
    mycode is :
        static uint8_t tmpHead = 0;
        UNUSED_VARIABLE(app_uart_get(&tmpRxByte));
        UartRes.RxData[UartRes.RxDataLen++] = tmpRxByte;
        //app_uart_put(tmpRxByte);
        
        if(UartRes.RxExpectedLen == 0)
        {
            if( (UartRes.RxData[0] != UART_PROTOCOL_TAG_CMD) && (UartRes.RxData[0] != UART_PROTOCOL_TAG_DATA) )
            {
                UartRes.RxDataLen = 0;
                UartRes.RxExpectedLen = 0;
                break;
            }
            if(UartRes.RxDataLen >= UART_FRAME_HEAD_SIZE)
            {
                tmpHead = UartRes.RxData[0];
                UartRes.RxExpectedLen = UartRes.RxData[1]*256 +UartRes.RxData[2];
                if(UartRes.RxExpectedLen > UART_PAYLOAD_SIZE)
                {
                    UartRes.RxDataLen = 0;
                    UartRes.RxExpectedLen = 0;
                    break;
                }
            }
        }
        else
        {
            if(UartRes.RxDataLen >= UartRes.RxExpectedLen + UART_FRAME_HEAD_SIZE)
            {

                if(tmpHead != UartRes.RxData[0])
                {
                    printf("error\n"); /*Breakpoint*/
                }

                UartRxNeedToProcFlag = 1;

                //break;
            }
        }
        
    now i found that if i set a breakpoint at /*Breakpoint*/,then the debug will stop at that line which mean the value of UartRes.RxData[0] has been changed.it looks like some pointer operations out of bounds.
    bacause of the project is the sample project of nRF5_SDK_12.3.0_d7731ad_original\examples\ble_peripheral\ble_app_uart\pca10028\s130\arm5_no_packs,with minimal additional code as shown about.so i was little doubt about the settings of IRAM1 that start at 0x20001FE8 and size=0x6018(24k) it is out of the maximum of nRF5_SDK_1251801 RAM space(16k).

    could you help me that check the settings are correct?

Children
Related