cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot build a working DTM_SPI BLE Firmware for BlueNRG-M2SA

gada
Associate III

A BLE Project for developed on steval-mksbox1v1 which had SPBTLE-1s.
Since it became NRND we switched to BlueNRG-M2SA Module which has same footprint.
Using the BlueNRG-1_2 DK 3.2.3 I have tried to get build the project with following pin changes as per mksbox connections - in hw_config.h

#define SPI_CS_PIN GPIO_Pin_1
#define SPI_OUT_PIN GPIO_Pin_2
#define SPI_IN_PIN GPIO_Pin_3
#define SPI_CLCK_PIN GPIO_Pin_0

 

But to my despair the in the built project binaries flashed into the module, the IRQ pin never becomes high in this firmware and the HCI code does not progress as IRQ low. In short the module does not initialize.

I have used projects from following paths.

BlueNRG-1_2 DK 3.2.3\Project\BLE_Examples\DTM\MDK-ARM\STEVAL-IDB008V1M

BlueNRG-1_2 DK 3.2.3\Project\BLE_Examples\DTM\MDK-ARM\STEVAL-IDB007V1M

After nothing of above worked, we had previous removed the ble firmware from the mksbox ble module and this particular firmware works fine on both the SPBTLE-1S and BlueNRG-M2SA with a issue that in M2SA Sleep currents are 5mA which is very high and thus we want correct firmware to be loaded in M2SA module to get lower currents.

We want the correct firmware DTMSPI for M2SA Module for Connections that are same of MKSBOX Board. Please help.

 

Regards

14 REPLIES 14
Laurent LOUAZON
ST Employee

Hello,

 

Please note DTM SPI FW for BlueNRg-M2 is already provided in BlueNRG-1_2 DK 3.2.3.

 

You will also find in this SDK documentation, the recommended mammping for SPI and IRQ (corresponding to this FW).

I then recommend this SPI mapping and the provided DTM SPI FW.

LaurentLOUAZON_0-1715958005932.png

 

 

Regards

Laurent

Hi Laurent,

If you check steval-mksbox1v1 sensortile board schematic, in that board the pins are not same as the firmware binary or source code provided in BlueNRG-1_2 DK 3.2.3.

Our board was made on that basis thus my pins are as following -

#define SPI_CS_PIN GPIO_Pin_1
#define SPI_OUT_PIN GPIO_Pin_2
#define SPI_IN_PIN GPIO_Pin_3
#define SPI_CLCK_PIN GPIO_Pin_0
#define GPIO_MODE_SPI Serial0_Mode

#define SPI_IRQ_PIN GPIO_Pin_14

 

Regards

 

 

 

Laurent LOUAZON
ST Employee

Hello,

Ok but the point is that  if you refer BlueNRG-2 datsheet (BlueNRg-2 is the SoC included inside BlueNRG-M2 module), you will see SPI CS can be set using aither DIO1 or DIO11 (see bluenrg-2 datsheet table 130)

But DIO1 is not a wake up capble IO (see BlueNRG datasheet chapter 3.4.1.3)

So if you use a DTM SPI FW inside BlueNRG-2 that is having sleep mode enabled, DIO1 will not be able to wake up BlueNRG-2/BlueNRg-M2

 

So either you use DIO11 pin as CS pin and you can use a DTM SPI FW with sleep mode, either you need to disable sleep mode in DTM SPI FW if you want to use DIO1.

 

Regards

Laurent

Hi,

 

I very well get your this point. Due to this concern what I did is I keep DIO1 as the chip select but I also operate DIO11 from another GPIO(USAR2_BLE_RX_UC_TX) along with the CS function to wakeup and sleep the BlueNRG Chip.

gada_0-1716372582515.png

The question though is not about sleep majorly but basic SPI Communication with the BLE IC.

I have noticed the BLE SPI INT Pin does not go high and due to which other codes SPI Write gets stuck waiting for it.

Regards

Kashyap

Laurent LOUAZON
ST Employee

Hello,

 

OK clear now.

which DTM SPI project have you used with BlueNRG-1_2 DK 3.2.3\Project\BLE_Examples\DTM\MDK-ARM\STEVAL-IDB008V1M?
Do you have same issue if you select "SPI" or "SPI no updater"?

 

Regards

Yes, Both projects have same issue.

Laurent LOUAZON
ST Employee

Hello,

 

Can you try below :
- Do a full mass erase
- Flash the DTM SPI no updater version you will have rebuilt but having set MEMORY_FLASH_APP_OFFSET=0x0 instead of 0x2000 in the linker option

Regards
Laurent

 

In SPI no updated version

Kept preprocessor values as follows

SPI_INTERFACE WATCHDOG WATCHDOG_TIME=1 BLE_STACK_CONFIGURATION=BLE_STACK_FULL_CONFIGURATION BLUENRG2_DEVICE HS_SPEED_XTAL=HS_SPEED_XTAL_32MHZ USER_BUTTON=BUTTON_2 LS_SOURCE=LS_SOURCE_INTERNAL_RO SMPS_INDUCTOR=SMPS_INDUCTOR_NONE

and Linker as --predefine="-DMEMORY_FLASH_APP_OFFSET=0 "

 

BLE init failed. Same code with original firmware

Laurent LOUAZON
ST Employee

Hello,

 

On BlueNRG-M2SA, 32kHz is used and SMPS is implemented so you must defined

LS_SOURCE=LS_SOURCE_EXTERNAL_32KHZ

SMPS_INDUCTOR=SMPS_INDUCTOR_10uH

See DT037 documentation.

 

Laurent