Problem programming custom PCBs on nrf51822

Hi, I tried my best to solve my problem via forum but unfortunately no success. I got nrf51 DK and played with it a lot. successfully program the samples and tweak them a bit. using SDK 5.1 and s110 v6.

The problem starts when I try custom boards. I have made one based on QFAAC0 for which:

I have same problem with a board I purchased online, PTR5528 which is based on CEAA . Can program blinky but no BLE.

Is there something that I am doing wrong. I did connect the board to 3 V and connected the segger programmer pins as explained in the forum (That's how I program without an error)

Thanks in advanced for your help, Ali

Parents
  • OK, good. Since blinky runs your custom board hardware is generally OK & this could be a Soft Device resource issue. I got bit at first because the custom board I was working with didn't have a 32 KHz crystal, so no BLE (SD-dependent) stuff worked until I changed the clock designation in ble_stack_init(). Since the advertising LED isn't even blinking (assuming you redefined the pin selection for your board) I'd guess that one of your SD stack calls is failing. You might want to modify the app_error_handler() & see if you can break there & get a stack trace. Good luck!

Reply
  • OK, good. Since blinky runs your custom board hardware is generally OK & this could be a Soft Device resource issue. I got bit at first because the custom board I was working with didn't have a 32 KHz crystal, so no BLE (SD-dependent) stuff worked until I changed the clock designation in ble_stack_init(). Since the advertising LED isn't even blinking (assuming you redefined the pin selection for your board) I'd guess that one of your SD stack calls is failing. You might want to modify the app_error_handler() & see if you can break there & get a stack trace. Good luck!

Children
  • Thanks for the suggestion, I did add the proper lines for internal 32 kHz . NRF_CLOCK->XTALFREQ = CLOCK_XTALFREQ_XTALFREQ_16MHz; NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1; while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) {} nrf_gpio_pin_set(ALERT_PIN_NO); //use this pin to check if program halts BLE_STACK_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, BLE_L2CAP_MTU_DEF, ble_evt_dispatch, false);

    The program runs smoothly on PCA10006 when I disconnect the external 32khz oscillator but when I test the same hex file and stack on my custom board, it stops in the while loop, i.e. the HF Clock does not start. any Idea? (The PCA10006 uses a QFAAG0 chip while mine is QFAAC0, use s110 v5.2.1 and SDK 4.4.2 that are supposed to be compatible with both chips according to the compatibility table of RM)

Related