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

Sending custom BLE characteristic to SD card

I have developed my own custom BLE service. I need to send BLE characteristic to an SD card. I have implemented the FATFS example and it works.

Now I'm trying to merge my custom BLE application with FATFS. However, I've not been able to link a BLE characteristic WRITE event to write to writing to FATFS. 

Here is the code snippet. Here I'm just trying to link a BLE WRITE event to a FATFS WRITE function to write a generic string to the file (not sending characteristic data).

However, on debugging, the program execution never seems to enter the fatfs_write() function. 

What could be happening? Is there something wrong in the program flow logic? Please help. 

Thanks

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void on_cus_evt(ble_cus_t * p_cus_service,
ble_cus_evt_t * p_evt,
ble_evt_t const * p_ble_evt_main)
{
ret_code_t err_code;
switch(p_evt->evt_type)
{
case BLE_CUS_EVT_WRITE:
nrf_gpio_pin_toggle(LED_3);
printf("%s"," write to sd card ");
flag =1;
break;
case 2: ....
case 3: ....
}
void fatfs_write()
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX