2019-09-02 01:42 AM
Hi,
I'm starting to play around with ST BLE.
I'm using X-NUCLEO-IDB05A1 on NUCLEO-F401RE.
I've just followed the "Getting started" https://www.youtube.com/watch?v=AIJA4yRxuP4
But BlueNRG App v1.1 doesn't recognize any device.
What could I check to find the problem?
Thanks a lot
2019-09-07 06:20 PM
Hi,
Do you have other boards to verify the behavior ?
Can you check in debugging if the BLE is getting initialized or not.
Can you check in the BLE scanner or any application if the board is recognized or not
Thanks
2019-09-08 11:15 AM
Hi Alok,
thanks a lot for your reply.
Board works good with others projects.
I'm debugging the code mode in deep and find a problem in the MX_USART2_UART_Init, it return BSP_ERROR_PERIPH_FAILURE.
It has called by MX_BlueNRG_MS_Init(void) -> User_Init(void) -> BSP_COM_Init(COM1).
Do you have suggestions?
int32_t BSP_COM_Init(COM_TypeDef COM)
{
int32_t ret = BSP_ERROR_NONE;
if(COM > COMn)
{
ret = BSP_ERROR_WRONG_PARAM;
}
else
{
hcom_uart[COM].Instance = COM_USART[COM];
#if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
/* Init the UART Msp */
USART2_MspInit(&hcom_uart[COM]);
#else
if(IsUsart2MspCbValid == 0U)
{
if(BSP_COM_RegisterDefaultMspCallbacks(COM) != BSP_ERROR_NONE)
{
return BSP_ERROR_MSP_FAILURE;
}
}
#endif
if (MX_USART2_UART_Init(&hcom_uart[COM]))
{
ret = BSP_ERROR_PERIPH_FAILURE;
}
}
return ret;
}
2019-09-09 05:40 AM
What UART is used for in that application?
2019-09-10 08:59 AM
Hi Alok,
I've commented the UART init (probably only used for PRINTF?) and I went ahead and found a problem in MX_BlueNRG_MS_Init -> getBlueNRGVersion -> staus of hci_le_read_local_version(...) return an ERROR (0xFF).
Do you have an idea? Do you have working code as example?
Thanks a lot
uint8_t getBlueNRGVersion(uint8_t *hwVersion, uint16_t *fwVersion)
{
uint8_t status;
uint8_t hci_version, lmp_pal_version;
uint16_t hci_revision, manufacturer_name, lmp_pal_subversion;
status = hci_le_read_local_version(&hci_version, &hci_revision, &lmp_pal_version,
&manufacturer_name, &lmp_pal_subversion);
if (status == BLE_STATUS_SUCCESS) {
*hwVersion = hci_revision >> 8;
*fwVersion = (hci_revision & 0xFF) << 8; // Major Version Number
*fwVersion |= ((lmp_pal_subversion >> 4) & 0xF) << 4; // Minor Version Number
*fwVersion |= lmp_pal_subversion & 0xF; // Patch Version Number
}
return status;
}