cancel
Showing results for 
Search instead for 
Did you mean: 

X-NUCLEO-BNRG2A1 stuck on reset using X-CUBE-BLE2

PFuen.1
Associate III

Hi, recently I got a X-NUCLEO-BNRG2A1 and I am trying to use it with NUCLEO-G070RB without success. I have created a project with STM32CubeMx assistance using SampleApp of X-CUBE-BLE2, mapping the pins of the expansion board to my nucleo board as follows:

RST - PA8

SPI_SCK - PA5

SPI_MOSI - PA7

SPI_MISO - PA6

CS - PA1

SPI_EXTI_IRQ - PA0

The project successfully built and uploaded into the MCU, however the application does not do anything it just stuck in the function HCI_TL_SPI_Reset. I have already tried installing the DTM hex file into X-NUCLEO-BNRG2A1, however it does not solve the problem.

is it a problem of the DTM software?

23 REPLIES 23
VMach.1
Associate III

Hi @PFuen.1​ did you manage to solve this issue?

PFuen.1
Associate III

Hi,

No, I didn't. It seems like the SPI_EXTI_IRQ never exits.

PD. I saw this answer after having seen your actual question 😅 . I am still looking for answers but I haven't had any success.

VMach.1
Associate III

Hi,

yeah...I don't know why is so hard to find support on this.

SPI_EXTI_IRQ never exits? But when exactly does this happen?

I got stuck in hci_reset(), when it performs the CS reset the BlueNRG-2 seems not to be ready.

in file hci_tl_interface.c

    /* CS reset */
    HAL_GPIO_WritePin(HCI_TL_SPI_CS_PORT, HCI_TL_SPI_CS_PIN, GPIO_PIN_RESET);
 
    /*
     * Wait until BlueNRG-2 is ready.
     * When ready it will raise the IRQ pin.
     */

Do you also get stuck here or somewhere else?

-Víctor

VMach.1
Associate III

Also, I found this thread https://community.st.com/s/question/0D50X00009XkeEaSAJ/firmware-update

where they say the very first time the FW needs to be updated.

I've been using the X-NUCLEO-BRNG2A1 + NUCLEO-L476RG without flashing any FW.

Hi, yes I got stuck there too. However, it is because of the interrupt, when we release the reset pin of the BlueNRG-2, the module should start to generate interrupts, but it does not exit never (because there is no data available ?). I tried this code in hci_tl_lowlevel_isr:

volatile uint32_t cnt = 0;
// HCI Transport Layer Low Level Interrupt Service Routine
void hci_tl_lowlevel_isr(void) {
  cnt = 0;
  // Call hci_notify_asynch_evt()
  while (IsDataAvailable() && cnt < 100) {
    hci_notify_asynch_evt(NULL);
    cnt++;
  }
}

And you can see, that now you haven't got stuck in reset, but obviously, this will lead to errors in the initialization. Also if you don't connect the interrupt pin, you haven't got stuck, so I think that probably the problem is there. Hmm, maybe the interrupt pin is receiving at first time an undesired voltage that triggers the interrupt service, and as consequence there is no data available and loops, in that case we could add a pull resistor, but I am not sure.

That's no the solution, 'cause I have flashed the FW again, but unfortunately that not solve the problem :downcast_face_with_sweat:

The interrupt is enabled in the NVIC interrupt table, right?

The deafult SPI_SCK is PB3 in the nucleo board. If you you are using the PA5, did you switch the J14 jumper of the x-nucleo-bnrg2a1 to 1-2 instead of 2-3 position?

yep