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

BLE ACI verification

Hi, i'm kinda a newbie on this, and i'm trying to port the SDK available for arduino to a PIC, i followed the instructions on the SDK and also here

Now i want to verify that my code is alright by running the ble_aci_transport_layer_verification, but the if statement in the loop function never triggers due to "aci_queue_is_empty" always returns true (aci_q->head == aci_q->tail).

On the other hand, the setup funcion calls aci_queue_init (via hal_aci_tl_init), but this function sets aci_q->head and aci_q->tail to zero. I debugged the rest of the program one line at a time and no other function modifies those values.

So, I'm starting to think that maybe there is a bug on the code, i hope somebody could help me pointing out where the aci queue is initialized (or if i should write a call to aci_queue_enqueue somewhere), thanks in advance

Parents
  • the most typical was: 0xAC 0x00 (just that)

    i read the datasheet again and did some changes to the code, in particular i commented some lines (hal_aci_tl -> m_aci_event_check):

        // If the ready line is disabled and we have pending messages outgoing we enable the request line
      if (HIGH == !digitalRead(a_pins_local_ptr->rdyn_pin))
      {
        //if (!aci_queue_is_empty(&aci_tx_q))
        //{
          m_aci_reqn_enable();
        //}
    
        //return;
      }
    

    Since "devide started" its an event, if rdyn is set low by nRF8001 then reqn should be set low too and then start the SPI communication (this was not happening because of the return statement)

    Now i get this package: 0x01 0x04 0x81 0x02 0x00 0x02. Clearly more familiar with the nomenclature specified with the datasheet, but i'm not sure if that changes would cause some overflow or another bug afterwards.

Reply
  • the most typical was: 0xAC 0x00 (just that)

    i read the datasheet again and did some changes to the code, in particular i commented some lines (hal_aci_tl -> m_aci_event_check):

        // If the ready line is disabled and we have pending messages outgoing we enable the request line
      if (HIGH == !digitalRead(a_pins_local_ptr->rdyn_pin))
      {
        //if (!aci_queue_is_empty(&aci_tx_q))
        //{
          m_aci_reqn_enable();
        //}
    
        //return;
      }
    

    Since "devide started" its an event, if rdyn is set low by nRF8001 then reqn should be set low too and then start the SPI communication (this was not happening because of the return statement)

    Now i get this package: 0x01 0x04 0x81 0x02 0x00 0x02. Clearly more familiar with the nomenclature specified with the datasheet, but i'm not sure if that changes would cause some overflow or another bug afterwards.

Children
No Data
Related