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

BLE HID Keyboard demo code not working

I just got an 32u4 BlueFruit LE board. and want to create a customized FW for its nRF51822 v3 chip.

I am using STLink v2 and OpenOCD connected to this chip. To verified the connection, I did mass_erase, reflash the default FW from Adafruit, flash blinky demo and flash blinky demo with s130. All these work properly. I am using the blinky demo code from nRF5 SDK 11.0.0. I remapped the LED and button pins because BlueFruit only wired out two LEDs and one SPI interface.

But when I am trying to flash ble_app_hids_keyboard demo project, it's always not working. The code keeps going into a dead loop with WFE and BEQ.N, and nothing happens anymore. I also tried with ble_app_hids_mouse, same result. Seems all the demo projects in ble_peripheral are not working for me, but all projects in example/peripheral working correctly.

I compiled projects with armgcc 5.3 2016q1. The chip revision is nRF51822 QFAC_A0, I have tried with s110, s130 from SDK 10 and SDK 11, none of them works. And I used the default memory config for linker because it looks matching the spec.

MEMORY
{
     FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
     RAM (rwx) :  ORIGIN = 0x20002080, LENGTH = 0x5f80
}

This really confused me a lot. Even debuging cannot go to main() function. I dumped out whole memory for hid keyboard, blinky with s130, and adafruit default FW(S110 2.0.0), and compared them. Everything looks correct, no overlap.

Could anybody help me to check which part I missed? Any special requirement for hid keyboard demo project to run? Is bootloader or any other lib required?

Parents
  • @zn: Please make sure you have configured the clock source correctly. Most likely the module on your board doesn't have the 32kHz crystal that used by the default code in the SDK. If you don't have you should use the RC LFCLK instead of the crystal LFCLK.

    Please use NRF_CLOCK_LF_SRC_RC instead of NRF_CLOCK_LF_SRC_XTAL in the definition of NRF_CLOCK_LFCLKSRC when calling ble_stack_init()

  • No, I double checked with the schematic, it is using a MDBT40 module which should be connected to an external 32k crystal, and this is missing on my board. I will try it out and come back to you later. Thanks a lot.

Reply
  • No, I double checked with the schematic, it is using a MDBT40 module which should be connected to an external 32k crystal, and this is missing on my board. I will try it out and come back to you later. Thanks a lot.

Children
No Data