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?