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.

Parents
  • hi. thank you. I will explain more to clear what I'm doing. You are right. I receive each event once and then clear interrupt flag. but why I say "for 2 times" , "forever" . Because of this:

    *I use uart to debug my code and I place uart transmitter function in :

    bool lib_aci_event_get(aci_state_t *aci_stat, hal_aci_evt_t *p_aci_evt_data)
    {
       bool status = false;
    
       status = hal_aci_tl_event_get((hal_aci_data_t *)p_aci_evt_data);
    
       HAL_UART_Transmit(&huart1, (uint8_t*)p_aci_evt_data, 8 , HAL_MAX_DELAY);
       HAL_Delay(100);
       p_aci_evt_data = 0;
       .
       .
       .
    

    whereas in while(1) in main function in main.cpp, "aci_loop()" is called forever, "lib_aci_event_get" then called forever and my uart sends packet to my PC. if external interrupt doesn't occur and queue (aci_queue_dequeue()) was empty, uart sends last packet that placed in queue. I wrote my received events that form, because I wanted show explicitly.

    *I use 2 type smartphone. one: iPhone6s and two: a htc android 4.4 kitkat and BLE Enabled.(I don't know whats exactly its name) and in both I run nRF uart app form nordic.(in app store and play store)

    *I recently bought DK. I cant reach that yet.

    *in aci verification layer in section "case ACI_EVT_ECHO:" there is a "if":

    if (0 != memcmp(&echo_data[0], &(aci_evt->params.echo.echo_data[0]), sizeof(echo_data)))
    {
          Serial.println(F("Error: Echo loop test failed. Verify the SPI connectivity on the PCB."));
    }
    else
     {
          Serial.println(F("Echo OK"));
     }
    

    as I know if my program go to first brace ("Error: Echo loop test failed. Verify the SPI connectivity on the PCB."), there is a fault and if go to second brace("Echo OK") , verification is OK. but i don' know in how many cases I have to run program. we can use each member of below enumeration as "lib_aci_test" parameter.

    typedef enum
    {
    ACI_TEST_MODE_DTM_UART    = 0x01,
    ACI_TEST_MODE_DTM_ACI     = 0x02,
    ACI_TEST_MODE_EXIT        = 0xFF
    
    } _aci_packed_ aci_test_mode_change_t;
    

    in two first, i get

    Serial.println(F("Echo OK"));
    

    and in last i get:

    Serial.println(F("Error: Echo loop test failed. Verify the SPI connectivity on the PCB."));
    
Reply
  • hi. thank you. I will explain more to clear what I'm doing. You are right. I receive each event once and then clear interrupt flag. but why I say "for 2 times" , "forever" . Because of this:

    *I use uart to debug my code and I place uart transmitter function in :

    bool lib_aci_event_get(aci_state_t *aci_stat, hal_aci_evt_t *p_aci_evt_data)
    {
       bool status = false;
    
       status = hal_aci_tl_event_get((hal_aci_data_t *)p_aci_evt_data);
    
       HAL_UART_Transmit(&huart1, (uint8_t*)p_aci_evt_data, 8 , HAL_MAX_DELAY);
       HAL_Delay(100);
       p_aci_evt_data = 0;
       .
       .
       .
    

    whereas in while(1) in main function in main.cpp, "aci_loop()" is called forever, "lib_aci_event_get" then called forever and my uart sends packet to my PC. if external interrupt doesn't occur and queue (aci_queue_dequeue()) was empty, uart sends last packet that placed in queue. I wrote my received events that form, because I wanted show explicitly.

    *I use 2 type smartphone. one: iPhone6s and two: a htc android 4.4 kitkat and BLE Enabled.(I don't know whats exactly its name) and in both I run nRF uart app form nordic.(in app store and play store)

    *I recently bought DK. I cant reach that yet.

    *in aci verification layer in section "case ACI_EVT_ECHO:" there is a "if":

    if (0 != memcmp(&echo_data[0], &(aci_evt->params.echo.echo_data[0]), sizeof(echo_data)))
    {
          Serial.println(F("Error: Echo loop test failed. Verify the SPI connectivity on the PCB."));
    }
    else
     {
          Serial.println(F("Echo OK"));
     }
    

    as I know if my program go to first brace ("Error: Echo loop test failed. Verify the SPI connectivity on the PCB."), there is a fault and if go to second brace("Echo OK") , verification is OK. but i don' know in how many cases I have to run program. we can use each member of below enumeration as "lib_aci_test" parameter.

    typedef enum
    {
    ACI_TEST_MODE_DTM_UART    = 0x01,
    ACI_TEST_MODE_DTM_ACI     = 0x02,
    ACI_TEST_MODE_EXIT        = 0xFF
    
    } _aci_packed_ aci_test_mode_change_t;
    

    in two first, i get

    Serial.println(F("Echo OK"));
    

    and in last i get:

    Serial.println(F("Error: Echo loop test failed. Verify the SPI connectivity on the PCB."));
    
Children
No Data
Related