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.