Setup of nrf52832 bluetooth

Hello,

Our company developed software for a machine to work. We wanted to use the software on an existing factory board. We wanted to communicate with an app (ble) to the board via the nrf52832 chip. Therefor we need to set the name of the bluetooth device and advertise it. The factory of the board offered us the next C code to do this:

void SetBTName() {
uint8_t set_ren_command[17]="TTM:REN-PT2220809";

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, 1); // high
HAL_Delay(50);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, 0); // low
HAL_Delay(200);
HAL_UART_Transmit(&huart1, "TTM:TPL-\x07", strlen("TTM:TPL-\x07"), 12); // Set BT Power setting
HAL_Delay(200);
HAL_UART_Transmit(&huart1, "TTM:ADP-\x01", strlen("TTM:ADP-\x01"), 12); // Set BT ADTimer setting
HAL_Delay(200);
HAL_UART_Transmit(&huart1, set_ren_command, strlen(set_ren_command), 23);
HAL_Delay(200);
HAL_UART_Transmit(&huart1, "TTM:RST-SYS", strlen("TTM:RST-SYS"), 12); // Set BT Reset command
HAL_Delay(200);

}

Renaming the bluetooth device is working fine but, when starting the machine, the bluetooth device is advertised only a few seconds. The factory tells us that the problem should be the last line that the chip is not changed from "command mode" to "passthrough mode". We used the "nrf Connect" app to see if the machine is advertising.

What is wrong with this?

Parents
  • Hi,

    This code looks like STM code to me, which I am not familiar with. I see you are also using an nRF52832 for something but I am not sure about the relationship here. Can you elaborate a bit more, and explain which issues you are having on the nRF side and what you need help with on that end?

  • Hi Einar,

    Indeed, the board has been made for a STM32F103 and they are using the nrf52 in a MS50SFB for bluetooth communication. So the factory advised us to setup this nrf52 ble by sending some commands via the UART. The nrf52832 is programmed this way and the name could be changed. When starting the machine, the new name is visible (nrf Connect app shows the name in the scanner tab). But after a few seconds, the ble name is greyed and, when refreshing the devices in the scanner tab, the name is not showing anymore. We tried with longer delay between the commands but this didn't help. I am not experienced in this and i also couldn't find information on the internet about "TTM commands", so maybe you can explain what this is and where i can find more information about these commands?

  • Hi,

    OK, so you hare an host MCU (STM) and needs to use a nRF for BLE connectivity, and the host MCU communicates with the nRF over UART. Is that the case? Is it so that the nRF has some firmware running on it that handles this serialization and that use "TTM commands"? I have never heard about "TTM commands" and that is not something that is supplied by Nordic. So if you need to keep the firmware on the nRF (?) and use that, the first thing should be to figure out what it is and why supplied it. Perhaps the module manufacturer has some firmware running on it for BLE serialization? Or there is some other custom firmware running on it? If not, whoever designed this initially should know what they were using. When you learn about that, hopefully you can find some documentation on the protocol/API (this "TTM") and how to use it.

  • What if I remove all the factory firmware? How can I use this nrf52832 chip for bluetooth? Can I upload the original Nordic firmware to use it? How can I then use it with C? Do I need a library for it?

  • Yes, if you program the nRF yourself you have full flexibility. We ship empty ICs and a flexible SDK, that includes among other things a Bluetooth stack and a lot of examples for different use cases. Have a look at the nRF Connect SDK. (If this makes sense in your project or not and how you want to do it I cannot say as It is not entirely clear to me what you would want to do in this case, and what the split between the nRF and the other MCU would be like).

Reply Children
No Data
Related