Hi,
I've undertaken my very first custom Bluetooth PCB project, choosing an nRF52810 as the MCU of choice.
Having already tried and tested a SparkFun nRF52832 breakout board, I was hopeful that moving down to the 52810 should be straightforward. However, I'm having issues which my many years of embedded development experience cannot explain and I would appreciate some help from those more experienced with these devices.
I have downloaded the nRF5 SDK (version 15.0) and promptly loaded up the Blinky App in IAR 8.22.1 for PCA10040e. I've implemented my own "custom_board.h" header, added a BOARD_CUSTOM symbol to the project and ensured that all the relevant pin mappings for LEDs and buttons are correct. I am able to download the S112 softdevice file to the micro and I then proceed to download the Blinky App to my board via IAR and a Segger J-Link.
Following the download, I can single-step through the code up until the main loop before executing disappears and a few seconds later, an error will appear saying:
"Failed to get CPU status after 4 retries".
IAR then promptly crashes and closes (possibly the worst development environment I have ever had the displeasure of using - but thats another story), providing no help whatsoever.
Usually, in past applications, this has meant that a hard-fault exception has occurred but the platform is still running. Using the nRF Connect app on my iPhone, I am still able to see the device and I can attempt to connect to it.
A few things that I am unsure of here are:
- Is the on-board 32MHz external crystal used out-the-box in the SDK examples
- Is the 32.768kHz crystal required
The reason I ask the above is that there is next to no activity on both of these devices. Having looked in the "sdk_config.h" file, the following symbols are defined:
NRF_SDH_CLOCK_LF_SRC 1
CLOCK_CONFIG_LF_SRC 1
Both of these would indicate that the Xtal is used for clocking but given there is no activity, this wouldn't make sense unless there is a hardware issue - but if there was, I surely wouldn't be able to detect the board in nRF Connect?!
So, with the above in mind I also observe the following:
- One of the LEDs pulses quickly at about 5Hz - my guess is that this is the advertisiting LED
- When attempting to connect, a second LED flickers (together with the first) sometimes at a 1Hz rate but then less frequently
- Ultimately, a connection can be made but if one is made it is then lost almost immediately
The reported RSSI is -57dBm and the time is approximately 250ms which seems pretty slow. As I'm new to this game, I'm not really sure what the time period represents (advertising rate?)
I would also like to add here that I have a second board which reports an RSSI of -78dBm and a time of 43ms - but the observations for this are different to the other whereby at times, I can connect to this board (in which case the second LED comes on immediately) and nRF Connect shows me all services available. The advertising LED flashes much more slowly on this board though and goes off completely once connected to it. If I disconnect, the advertising LED starts flashing again.
I would greatly appreciate any help or advice on any aspects of the above and any strategies to combat IAR crashing every time I hit the error.
I will also add that more often than not, I struggle to re-program the devices due to RAMCode issues. I have checked ALL signals on the SWD side of things, the RESET line is not being pulled by anything other than the J-Link and the voltage rails and ground planes are stable and clean.
Thanks in advance.