ASF Bluetooth Low Energy (BLE) API - Issue with Get/Set Characteristic

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I am currently using ASF version 3.29 with Atmel Studio 7. I'm working with the BLE API on a SAML21 Xplained Pro with a BTLC1000 add-on card. The BTLC1000 hardware has been modified for the chip enable workaround described in the user guide. I've got two sets of hardware with one executing as a peripheral device and the other as a central device. I've been able to establish a connection between the devices, and the central device is able to discover services and characteristics managed by the peripheral device. However, when I use the API calls for getting and setting the characteristic values I run into a few different issues.

 

When I call at_ble_characteristic_value_get() or at_ble_characteristic_value_set() from the central device after discovering a characteristic, I receive a hardware fault interrupt:

case AT_BLE_CHARACTERISTIC_FOUND:
{
    uint8_t value = 0;
    uint16_t length = 1;
    at_ble_characteristic_found_t* characteristic = (at_ble_characteristic_found_t*)params;
    at_ble_characteristic_value_get(characteristic->value_handle, &value, &length);
}

When I call at_ble_characteristic_value_set() from the peripheral device using the handle obtained from calling at_ble_primary_service_define(), the program hangs in a while loop inside serial_drv.c (see while(ble_txbyte_count) below).

uint16_t serial_drv_send(uint8_t* data, uint16_t len)
{
  system_interrupt_enter_critical_section();
  ble_txbuf_ptr = data;
  ble_txbyte_count = len;
  system_interrupt_leave_critical_section();

  if(ble_txbyte_count)
  {
	  g_txdata = *ble_txbuf_ptr;
	  while(STATUS_OK != usart_write_job(&usart_instance, &g_txdata));
	  if(--ble_txbyte_count)
	  {
		  ++ble_txbuf_ptr;
	  }
  }
  /* Wait for ongoing transmission complete */
  while(ble_txbyte_count);
  return STATUS_OK;
}

 

Any help is much appreciated. 

 

* Please use link in post#5 below. Moderator*

 

Last Edited: Wed. Dec 30, 2015 - 09:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

chris75f wrote:
I'm working with the BLE API on a SAML21 Xplained Pro with a BTLC1000 

So nothing to do with AVR, then.

 

You'd be better asking here: https://community.atmel.com/forum...

 

Or, perhaps, here: https://community.atmel.com/forum...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, Did u get any success in this ? I too wanna start using BTLC1000 for my application. I wanna know the flow of APIs for transmitting and receiving few Bytes of data (like wireless UART but not at high data rate). 

Salman Ali

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My mistake. I've posted my question to the correct forum. Thanks.

 

Link: https://community.atmel.com/forum...

Last Edited: Wed. Dec 30, 2015 - 06:22 PM
Topic locked