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?

24 REPLIES 24

0693W00000WLbIMQA1.png

and I feel that problem is something else may be.

@satyam9896​  Hmm, have you already flashed the BlueNRG-M2 with the firmware DTM_SPI.hex? The chipset needs to have that firmware to work as a network co-processor, otherwise it is in host mode.

ya, I have flashed it with DTM HEX but still same issue. if dont mind can you please verify this code.... im working with sampleapp in project you can findout.

gorgonaut
Associate

The ideas here were very useful! They took care of a lot of the issues I was having, but I still had a couple more issues. For the benefit of others, I will list them here:

  • Make sure all your SPI settings are correct! Refer to the Central.ioc file in the example project on github if you are adding the Central demo to your own project (I had the stm32WL55 nucleo, not the standard L-series Nucleo, but I was still able to use the Central sample application using CubeMX) 
    • SPI Data size defaults to 4, needs to be 8 (SPI_DATASIZE_8BIT)
    • Adjust the prescaler according to your CPU speed so that the baud rate is 2 > x >= 1mbps. I have 48 MHz, so SPI_BAUDRATEPRESCALER_32 gave 1.5 mbps, which works great! using prescaler of 16 did not!
  • I set EXTI pin to pulldown, so it couldn't accidentally be left high and cause spamming of interrupts
  • In GPIO section, click NVIC tab, and enable EXTI Line x Interrupt (where x is the pin number that EXTI pin is connected to on your board. On the L-series nucleo, it seems to be PA0, on mine it was PB1, so I selected EXTI Line 1 Interrupt). This creates and enables the appropriate callbacks that others have manually added.
  • Set ble RESET and CS gpio output pins default to High 

Good luck!