Hi sir,
I made the equipment using da14531 mod.
The MCU and DA14531 we use use UART communication.
DA14531 is applied with DSPS_device f/w. DA14531 is connected to the mobile phone, and eventually, the mobile phone and our equipment are wirelessly communicating.
The problem isThere are hundreds of developed equipment and use basic DSPS_device f/w, so device_name is all the same when searching for a mobile phone (there is a situation where various equipment is turned on in the same space)Of course, you can change device_name through f/w compilation, but you can't compile all of the hundreds of modules.
What I am curious about is the content below.
1. I was wondering if there is a way to change device_name separately in the module except for the compilation tool.
2. Is there a way to read BD address from MCU to UART from MCU connected to uart if number 1 doesn't work? (All communications sent from mcu to uart to da14531 are sent to mobile phone. I don't know how.)
If it is applied as mass production, I don't think it will be our own problem. I wonder if there are any other solutions
thanks
Thanks ,
Hi Micky,
Thank you for posting your questions online.
Good question, 1, we have PLT tool for production, so, you can directly set the BD name in range.UM-B-163: DA1453x-DA1469x Production Line Tool Software and HW User Manual (renesas.com)
2, you can follow this tutorial for dynamically change the BD name 6. The Bluetooth® Device Name — DA145XX Tutorial SDK Getting started (renesas.com)
Thanks
JH_Renesas
Thank you for your answer.
Then, the MCU and DA14531 (DSPS ver) communicate with uart. Please tell me how the MCU can read DA14531 (DSPS ver) device_name through UART communication
(This is because even if the device name is changed to UM-B-163, it is difficult to distinguish which equipment several different device names have been applied to.)
(I want to read the device_name of DA14531 in uart in our equipment and express it on the display in our equipment.)
thanks.
Our DSPS does not support this feature, let me have a try if it can work by some modifications.
I will back to you if there are any updates.
BR,
Thank you. I'll be waiting for your reply
I'm trying to change the program too, but if I modify uart, BLE won't work.
If you find a way, please let me know
My teammate has created one demo for responding BD address, you can take this as a reference:
I worked on the SPS SDK v6.150.6.77 with Security enabled.At the top of the user_sps_device_dma.c file I added the following functions:
#include "user_periph_setup.h" #include "uart.h" uint8_t addr2[BD_ADDR_LEN] = {0}; static void enable_uart1() { //Configure UART pins for 2-Wire UART GPIO_ConfigurePin(gpio_uart1_tx.port, gpio_uart1_tx.pin, OUTPUT, PID_UART1_TX, false); GPIO_ConfigurePin(gpio_uart1_rx.port, gpio_uart1_rx.pin, INPUT_PULLUP, PID_UART1_RX, false); GPIO_ConfigurePin(gpio_uart1_rts.port, gpio_uart1_rts.pin, INPUT_PULLUP, PID_GPIO, false); GPIO_ConfigurePin(gpio_uart1_cts.port, gpio_uart1_cts.pin, INPUT_PULLUP, PID_GPIO, false); //Uart Configuration uart_cfg_t uart_cfg = { .baud_rate = UART_BAUDRATE_921600, .data_bits = UART_DATABITS_8, .parity = UART_PARITY_NONE, .stop_bits = UART_STOPBITS_1, .auto_flow_control = UART_AFCE_DIS, .use_fifo = UART_FIFO_EN, .tx_fifo_tr_lvl = UART_TX_FIFO_LEVEL_0, .rx_fifo_tr_lvl = UART_RX_FIFO_LEVEL_0, .intr_priority = 0, }; //Iniitialize UART1 uart_initialize(UART1, &uart_cfg); } static void disable_uart1() { uart_disable(UART1); //Reconfigure UART pins for 4-Wire UART GPIO_ConfigurePin(gpio_uart1_tx.port, gpio_uart1_tx.pin, OUTPUT, PID_UART1_TX, false); GPIO_ConfigurePin(gpio_uart1_rx.port, gpio_uart1_rx.pin, INPUT_PULLUP, PID_UART1_RX, false); GPIO_ConfigurePin(gpio_uart1_rts.port, gpio_uart1_rts.pin, OUTPUT, PID_GPIO, true); GPIO_ConfigurePin(gpio_uart1_cts.port, gpio_uart1_cts.pin, INPUT_PULLUP, PID_UART1_CTSN, false); } static void print_me(void) { arch_set_sleep_mode(ARCH_SLEEP_OFF); //Initialize UART1 enable_uart1(); #if USER_CFG_ADDRESS_MODE == APP_CFG_ADDR_STATIC // Send the BDA uart_send(UART1, addr2, (sizeof(addr2)+ 2), UART_OP_BLOCKING); #else uint32_t bdaddr_msb = (GetWord32(BLE_BDADDRU_REG))&0x1FFFF; uint32_t bdaddr_lsb = (GetWord32(BLE_BDADDRL_REG)); uint8_t addr[6]; memcpy(&addr2, &bdaddr_lsb, 4); memcpy(&addr2[4], &bdaddr_msb, 2); uart_send(UART1, addr2, (sizeof(addr2)+ 2), UART_OP_BLOCKING); #endif //Disable UART1 and reconfigure the UART pins for 4-Wire UART disable_uart1(); arch_set_sleep_mode(app_default_sleep_mode); }
You should also modify the default_app_generate_static_random_addr API on app_default_handlers.c file as shown below:
extern uint8_t addr2[BD_ADDR_LEN]; void default_app_generate_static_random_addr(struct bd_addr *addr) { // Check if the static random address is already generated. // If it is already generated the two MSB are equal to '1' if (!(addr->addr[BD_ADDR_LEN - 1] & GAP_STATIC_ADDR)) { // Generate static random address, 48-bits co_write32p(&addr->addr[0], co_rand_word()); co_write16p(&addr->addr[4], co_rand_hword()); // The two MSB shall be equal to '1' addr->addr[BD_ADDR_LEN - 1] |= GAP_STATIC_ADDR; } memcpy(&addr2, &addr->addr, BD_ADDR_LEN); }
In order for the project to be able to compile, you will have to change the value of the MSG_HEAP_SZ on the da14531_config_advanced.h file:#define MSG_HEAP_SZ (4020)
Finally, you can call the print_me function whenever you want inside the user_sps_device_dma.c file.I called it inside the user_advertise_operation(void). Each time we start advertising, we will initialize briefly UART1 and send the BDA to the Host MCU. The Host MCU should handle the BDA and save it on his side.Please also refer on the dsps_uart1_bda.mp4 video as well.
Note: The implementation could change depending on the value of the USER_CFG_ADDRESS_MODE macro.Note2: If you want the Host MCU to be able to request the BDA from the DA14531 via a command, that would require a different implementation and it will need to reduce the Heap size more that could affect the performance of the SPS SDK.
Thank you for your reply
It's a bit complicated, so I should read it carefully
The way I've implemented it is
static const uart_cfg_t uart_cfg_tem = { // Set Baud Rate .baud_rate = UART_BAUDRATE_115200, // Set data bits .data_bits = UART_DATABITS_8, // Set parity .parity = UART_PARITY_NONE, // Set stop bits .stop_bits = UART_STOPBITS_1, // Set flow control .auto_flow_control = UART_AFCE_DIS, // Set FIFO enable .use_fifo = UART_FIFO_EN, // Set Tx FIFO trigger level .tx_fifo_tr_lvl = UART_TX_FIFO_LEVEL_0, // Set Rx FIFO trigger level .rx_fifo_tr_lvl = UART_RX_FIFO_LEVEL_0, // Set interrupt priority .intr_priority = 2,
};
uart_initialize(UART1, &uart_cfg_tem);
GPIO_ConfigurePin(UART1_TX_PORT, UART1_TX_PIN, OUTPUT, PID_UART1_TX, false); GPIO_ConfigurePin(UART1_RX_PORT, UART1_RX_PIN, INPUT, PID_UART1_RX, false);
uart_send(uart, (uint8_t *) str, strlen(str), UART_OP_BLOCKING); // use uart_send function
First of all, we tested sending Devicename to uart TX while looking at the DSPS source code.
I don't know and made the code, so I'll apply the method you told me.
-------------------------------------------------------------------------------------------
I think this will be the last question.
Looking to buy a UM-B-163, but I can't pick it up right away.
I'm waiting for the equipment to arrive now.
You said that you can change the devicename using UM-B-163.
If read it through &device_info.dev_name.name , can I read it under the device name changed to UM-B-163 equipment?
The device name is fixed with #defineUSER_DEVICE_NAME and it says it's changing to UM-B-163 but I'm worried if it becomes the old devicename again when I power off.
We don't have UM-B-163 equipment right now so We haven't been able to test to change the devicename, and we are already putting 100 units into mass production.
(I used DSPS source code)
I'll be waiting for your reply and looking at the code you gave me.
Sorry for the mistake, about BT name, if you want to modify it later through UART, you can story it in the flash.
Or you can write it to the OTP during PLT or smart snippets toolbox.
1, Do you need SUOTA service?
2, if using SUOTA the configuration will be a little complicated, if not, you can use the last sector of the flash to store customized data.
About how to use flash for NVPARAM please refer to this tutorial.7. SPI Flash — DA145XX Tutorial SDK peripherals (renesas.com)
I will send you an example in private message.