2020-09-16 08:09 PM
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?
2020-09-22 07:41 AM
Hi @PFuen.1 did you manage to solve this issue?
2020-09-22 11:27 AM
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 :grinning_face_with_sweat: . I am still looking for answers but I haven't had any success.
2020-09-23 01:02 AM
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
2020-09-23 01:05 AM
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.
2020-09-23 01:35 AM
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.
2020-09-23 01:37 AM
That's no the solution, 'cause I have flashed the FW again, but unfortunately that not solve the problem :downcast_face_with_sweat:
2020-09-23 02:43 AM
The interrupt is enabled in the NVIC interrupt table, right?
2020-09-23 02:47 AM
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?
2020-09-23 11:36 AM
yep