9 years, 3 months ago.

Exporting BLE mbed code to Keil, Connects to device but error on characteristic write

I'm having problems with a NRF51822 on a custom PCB. I've managed to get the SDK BLE samples working, HRS using Keil, JLink.

I was developing my solution with a MBED kit which works fine on the mkit board.

I tried to export the mbed file to keil and flashed. However, the custom board advertises and connects but the Android app cannot read the heart rate characteristic. The same happens when I export and flash other BLE samples from the mbed compiler. The app disconnects from the board with a write to descriptor fail.

Exporting the HRS example, from mbed, I can briefly connect and see the position of sensor says other and the battery says 1. The Android code is disconnecting when it tries to write to the HR notificiation descriptor with error: Error on descriptor write(3).

Would be great to have some advice to get the mbed exports working. I flash softdevice first using NRFgo and as the custom board does not have the external 32khz crystal I changed a line in the mbed source to using the 16mhz RC which works fine on the mkit board.

Many thanks

edit:

The same thing occurs if I flash softdevice using nrfgo and then flash the mbed hex directly using j lite. Connect but no service.

Summary:

Mbed code on mkit works fine. SDK samples on custom PCB work fine. mbed code exported to keil, flashed to custom PCB does not work (connects, no HR chara). mbed hex flashed to custom PCB does not work (connects, no HR chara). Blinkey demo from mbed exported to keil works fine.

Be the first to answer this question.