cancel
Showing results for 
Search instead for 
Did you mean: 

How to rebuilt BlueNRG-2 for UART

SBukh.1
Associate II

I need to update the pins used for UART communication by the BlueNRG-2 chip. I have found documentation that states you can update the source code as necessary.

Is there any documentation on how to actually build the target .bin or .hex file after you've edited the file(s) to change pin assignments?

Is there any support for this chip using VisualGDB with Visual Studio?

Thank you in advance.

4 REPLIES 4
Winfred LU
ST Employee

Not quite understand the question, do you mean to configure different pins for UART communication?

Please reference for example, BlueNRG1_Periph_Examples\UART\Polling

UART pins are defined in SDK_EVAL_Config.c

const uint32_t s_UartTxPinVersion[SDK_PLATFORMS_NUMBER] = {GPIO_Pin_8};
const uint32_t s_UartTxModeVersion[SDK_PLATFORMS_NUMBER] = {Serial1_Mode};
const uint32_t s_UartRxPinVersion[SDK_PLATFORMS_NUMBER] = {GPIO_Pin_11};
const uint32_t s_UartRxModeVersion[SDK_PLATFORMS_NUMBER] = {Serial1_Mode};

Please modify according your needs.

Regarding to VisualGDB,

i tested OpenOCD for a couple of times, so i think VisualGDB shall work similarly. Just connect ST-Link to SWD and configure accordingly.

Thank you for the response. To clarify, I am attempting to build the UART DTM "BlueNRG-1_2 DK 3.1.0\Project\BLE_Examples\DTM" in order to use the co-processor mode with UART comms as opposed to SPI. I believe SPI can be configured through CubeMX but UART cannot, the only information I can find about the UART co-processor mode led me to the provided DTM packages.

In the case of the DTM project, I believe the pins are defined in hw_config.h. My question was regarding what compiler, etc is expected to be used to build these projects. I eventually found the TrueStudio settings and was able to load the project into TrueStudio, which helps.

I need to import the source for the DTM into Visual Studio and build the binary/hex as part of my overall project. Do you happen to know the model for the Cortex M0 chip that the BlueNRG-2 uses? I will need to reference a specific chip from ST when creating the Embedded project using VisualGDB.

I am also assuming that in order to build the DTM project from source I will need the majority of the files located within the "BlueNRG-1_2 DK 3.1.0\Library" directory? If you could also confirm that for me, that would be a big help. I see there are static library files in some of the sub-folders in the "Library" directory

Thank you again.

Winfred LU
ST Employee

CubeMX doesn't seem to support BlueNRG-2 because the core in BlueNRG-2 is not from the STM32 series.

> I am also assuming that in order to build the DTM project from source I will need the majority of the files located within the "BlueNRG-1_2 DK 3.1.0\Library" directory? If you could also confirm that for me, that would be a big help. I see there are static library files in some of the sub-folders in the "Library" directory

Confirm, with the application code in the Project folder, and the HAL and library source code in the Library folder.

Most of the files are released in source code except BLE stack and libcrytpo.a.

Thank you for the reply. Looking at the DTM code provided, I see a transport_layer_send_data method for UART, but the transport_layer_receive_data logic is only available for SPI. Are you familiar with what the UART DTM uses to receive data over the UART?