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?