Hi Team,
Iam using DSPS sdk: 6.150.6.77, DA14531MOD.
As per my requirement i have to use DSPS sdk for high data flow.
So, further i want to add other feature like,
1. when BT module not connected to host Application it should be set to command mode.
2. when BT module connected to host Application it should be in data mode.
please let me know at which piece of code App connection and disconnection flags are placed.
Regards,
Laxmi Narayana.
Hi,
Thank you for reply,
laxmi said:please let me know at which piece of code App connection and disconnection flags are placed
As I asked could pls tell use where can we have App connected and App disconnected?
Laxmi Narayana
Hi Laxmi,
The SPS SDK structure just like SDK6 general, you can find the event call backs here:
BR,
JH_Renesas
Hi OV,
The requirement what i have is when BT module is not connected with Application, the host MCU will send some BT parameter to save in SPI Flash.
So, for this i require the flag where it tells When BT module connects to Android App and when BT module disconnected with Android Application.
Hi Laxmi,Thank you for the reply.
laxmi said:So, for this i require the flag where it tells When BT module connects to Android App and when BT module disconnected with Android Application.
You can do that on the callback functions:
laxmi said:The requirement what i have is when BT module is not connected with Application, the host MCU will send some BT parameter to save in SPI Flash.
When you are not connected, the UART is automatically shut down. You will have to change that but keep in mind that it will affect the current consumption.Best Regards,OV_Renesas
OV_Renesas said:When you are not connected, the UART is automatically shut down. You will have to change that but keep in mind that it will affect the current consumption.
I want to use UART communication when BT module not connected to Android App also. how can i do that.
Please suggest.
Hi Laxmi,Thank you for the reply.Please keep in mind that the SPS SDK was not designed to have the UART enabled all the time. You can test this on your side.UART is initialized when we establish a connection, please refer on the user_on_connect callback functionYou can see that we call the dma_uart_on_connect function:
void dma_uart_on_connect(void){ dma_uart.tx_size = DEFAULT_TX_SIZE; if( app_default_sleep_mode == ARCH_SLEEP_OFF ){ dma_uart_sps_init(cfg_uart_sps_baudrate, 3); dma_uart_rx_activate(); dma_uart_assert_rts(); } }
OV_Renesas said:You could try to remove the dma_uart_on_connect function from the user_on_connection callback and set it on app_on_init callback function.
I Tried the same, still not able to establish UART communication which App is disconnected.
Can you help me in this implementation?
OV_Renesas said:Please refer here: DA14531 sending BD address after receiving certain command or custom string in serial port service - Bluetooth Low Energy - Wireless Connectivity - Renesas Engineering Community
Please take above implementation as reference. You can use this to keep UART initialized when you are not connected. On user_on_connection you can disable the UART and let dma_uart_on_connect to initialize it correctly for the Serial Port Service feature.Best Regards,OV_Renesas
Thank you for supporting,
when Application not connected to BT module i enabled uart in function periph_init() as shown in below
Initially i tried to do loopback test to verify UART Tx and Rx. but it didn't worked for me.
So, I tried to send fixed string ACK. which i able receive the string for first 3 times and further receiving junk bytes continuously as shown below.
Please help me in fixing this issue.
Hi Laxmi,Thank you for the reply.Are you sure you have completed removed the Extended Sleep from your device?The SPS SDK will use UART HW Flowcontrol (RTS/CTS) to control the Extended Sleep mode as well.On the implementation I shared, we briefly initialize the UART (2-wire) to send some data and then turn it off. The SPS SDK will constantly check (every advertising interval) for the sleep mode via the RTS which has been reconfigured as a normal GPIO.This might be the issue that you are facing with the UART transmission.I have also not understood if you want to have UART with DMA, with Interrupts or Blocking on your project.Best Regards,OV_Renesas
Thank you for quick response,
OV_Renesas said:Are you sure you have completed removed the Extended Sleep from your device?
Iam not sure, I followed the printme() function procedure in my implementation.
As i want to use 2 wire uart when App not connected mode I calling arch_set_sleep_mode(ARCH_SLEEP_OFF); function.
Does this means removing Extended Sleep from device?
OV_Renesas said:The SPS SDK will constantly check (every advertising interval) for the sleep mode via the RTS which has been reconfigured as a normal GPIO.
So, should we use RTS GPIO also?
OV_Renesas said:I have also not understood if you want to have UART with DMA, with Interrupts or Blocking on your project.
As i want to use UART communication with interrupt when App is not connected to BT module.
Can you please update on above point.