BlueNRG-345 custom board repeatedly resets due to Hardware_Code = 0x01
I am working on a custom board with a BlueNRG-345 microcontroller, with the BlueNRG-LP Development kit 1.2.0 and using WiSE Studio as the development environment. I have taken the BLE Beacon project for the STEVAL-IDB011V1 and converted it to run on the BlueNRG-345 as described in section 6.2 of the Development Kit User Manual. The custom board is based on the reference design but it does not have an LSE so I have replaced the CONFIG_HW_LS_XTAL defined symbol with CONFIG_HS_LS_RO. I have commented out the call to HAL_PWR_MNGR_Request() so that I can run it under the debugger.
The project runs happily on an STEVAL-IDB011V1 but when I run it on the custom board it goes into a tight reset loop. The reason it is resetting is that the user code function hci_hardware_error_event() is being called with Hardware_Code = 0x01 and hence it calls NVIC_SystemReset(). If I change the code so that it only resets when Hardware_Code == 0x03, then the beacon functionality does work, at least for a while.
I have a separate project with the target application code and pins properly configured to match the custom hardware. This still suffers from the above problem but otherwise works fine. In this project I have avoided getting Hardware_Code = 0x01 by commenting out the calls to HAL_VTIMER_Tick() and BLE_STACK_Tick(). This appears not to stop the BLE Beacon function from working, which is fine so far as that is the only BLE function I need but it would be a problem if other BLE functions were needed in the future.
The bluenrg_lp_events.h files says that "Hardware_Code Error code 0x01 and 0x02 are errors generally caused by hardware issue on the PCB; another possible cause is a slow crystal startup." What hardware issues might be causing this or what might I have done wrong in the software?
