cancel
Showing results for 
Search instead for 
Did you mean: 

X-NUCLEO-IDB05A1 and NUCLEO_F401RE not working with X-CUBE-BLE1

andreaspiezia9
Associate III

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

  1. I've drag .bin over the icon: NUCLEO_F401RE (C:\Users\andre\Documents\BlueNRG MS Stack\en.X-CUBE-BLE1\en.X-CUBE-BLE1\STM32CubeExpansion_BLE1_V4.4.0\Projects\STM32F401RE-Nucleo\Applications\SensorDemo\Binary)
  2. Board is fleshed and LD2 is green

But BlueNRG App v1.1 doesn't recognize any device.

What could I check to find the problem?

Thanks a lot

4 REPLIES 4
alok
Senior

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

andreaspiezia9
Associate III

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;
}

What UART is used for in that application?

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;
}