&uart1 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
assigned-clocks = <&clk IMX8MN_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MN_SYS_PLL1_80M>;
fsl,dte-mode;
fsl,uart-has-rtscts;
resets = <&modem_reset>;
status = "okay";
};
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MN_IOMUXC_UART1_RXD_UART1_DTE_TX 0x140
MX8MN_IOMUXC_UART1_TXD_UART1_DTE_RX 0x140
MX8MN_IOMUXC_UART3_RXD_UART1_DTE_RTS_B 0x140
MX8MN_IOMUXC_UART3_TXD_UART1_DTE_CTS_B 0x140
>;
};
/*
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MN_IOMUXC_UART1_RXD_UART1_DCE_RX 0x140
MX8MN_IOMUXC_UART1_TXD_UART1_DCE_TX 0x140
MX8MN_IOMUXC_UART3_RXD_UART1_DCE_CTS_B 0x140
MX8MN_IOMUXC_UART3_TXD_UART1_DCE_RTS_B 0x140
>;
};
*/
Hi,
What is the dtron parameter passed into the hciattach command? My configuration is nearly identical to what you show, but without that dtron param. I'm also not passing reset as a parameter to the hciconfigcommand. I will try to add both of those and see if it makes a difference. Still it would be nice to know what the dtron param does since I can't find any documentation on it.
Thanks.
HI, dvlogic,
The parameter "dtron" means DTR(Data Terminal Ready) on.
It is not necessary to use this parameter during change baud rate to 3Mbps.
Without this parameter, should also be successful to change. Need to remind you that, please firstly set it to 115200 after loading driver, then change it to 3M bps.
We have tested it on i.mx 8MNano built-in 88W8987 chip.
Below is our test screenshot:
Please have a try and let us know the result, thanks.
Best regards,
Christine.
Hi,
We are still getting failures about 5% of the time, but only when we increase the baud to 3Mbps. If we comment out the code to increase the UART speed, we never have a failure. Here is the code we are using (which is very similar to what you shared and what is in other documents).
function increase_port_speed
{
rate=${1:-3000000}
echo "change the speed to $rate"
rateStr=$(printf "0x3f 0x0009 0x%x 0x%x 0x%x 0x%x" \
$((rate & 255)) $((rate>>8 & 255)) $((rate>>16 & 255)) $((rate>>24 & 255)))
hcitool -i hci0 cmd $rateStr
sleep 1
killall hciattach
sleep 1
hciattach /dev/ttymxc0 any -s $rate $rate flow nosleep
hciconfig hci0 reset || fail "Can't bring hci0 up at rate $rate"
}
function start
{
echo "Starting server.."
# make sure the WIFI driver is loaded
modprobe moal mod_para=nxp/wifi_mod_para.conf
sleep 5
# make sure the Bluetooth is configured
hciattach /dev/ttymxc0 -b -s 115200 any 115200 flow nosleep
hciconfig hci0 up || fail "Can't start at 115200"
sleep 1
# Increase the BT baud rate
increase_port_speed 3000000
echo "256" > /sys/kernel/debug/bluetooth/hci0/adv_min_interval || fail "Can't set adv_min"
echo "1024" > /sys/kernel/debug/bluetooth/hci0/adv_max_interval || fail "Can't set adv_max"
}
Let me know if you you additional ideas on how to determine what is causing the failures.
Thanks,
Dave
HI, Dave,
Could you please have a try with below code and add more sleep time?
Like below:
function increase_port_speed
{
rate=${1:-3000000}
echo "change the speed to $rate"
rateStr=$(printf "0x3f 0x0009 0x%x 0x%x 0x%x 0x%x" \
$((rate & 255)) $((rate>>8 & 255)) $((rate>>16 & 255)) $((rate>>24 & 255)))
hcitool -i hci0 cmd $rateStr
sleep 5
killall hcitool
sleep 5
killall hciattach
sleep 5
hciattach /dev/ttymxc0 any -s $rate $rate flow
hciconfig hci0 up || fail "Can't bring hci0 up at rate $rate"
}
function start
{
echo "Starting server.."
# make sure the WIFI driver is loaded
modprobe moal mod_para=nxp/wifi_mod_para.conf
sleep 5
# make sure the Bluetooth is configured
hciattach /dev/ttymxc0 any -s 115200 115200 flow
hciconfig hci0 up || fail "Can't start at 115200"
sleep 5
# Increase the BT baud rate
increase_port_speed 3000000
echo "256" > /sys/kernel/debug/bluetooth/hci0/adv_min_interval || fail "Can't set adv_min"
echo "1024" > /sys/kernel/debug/bluetooth/hci0/adv_max_interval || fail "Can't set adv_max"
}
And if still fail, please also share me the related logs. Thanks.
Best regards,
Christine.
Dear Customer,
To change the baud rate to 3 Mbps, execute the following commands:
# clean up any existing UART conn
killall hciattach
# assume initial rate is 115200 bps
hciattach ttyUSB0 any -s 115200 115200 flow dtron
# change baud rate to 3 Mbps
hcitool -i hci0 cmd 0x3F 0x0009 0xC0 0xC6 0x2D 0x00 &
killall hcitool
killall hciattach
# reconnect at 3 Mbps
hciattach ttyUSB0 any -s 3000000 3000000 flow dtron
hciconfig hci0 reset
sleep 1
hciconfig
We default works as DCE, please have a try with above command. It is not necessary to do any changes in DTS.
Kindly remind, please use 115200 bps to do hciattach firstly after insmod Bluetooth driver, then change it to 3Mbps with hciattach commands.
Best regards,
Christine.