StarFive JH-7110 Development Manual

Devkit wifi and bluetooth
Hide thumbs Also See for JH-7110:

Advertisement

Quick Links

JH-7110 DevKit WiFi and
Bluetooth Developing and
Porting Guide
Version: 1.0
Data: 2023/06/02
Doc ID: JH7110-DGEN-002

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the JH-7110 and is the answer not in the manual?

Questions and answers

Summary of Contents for StarFive JH-7110

  • Page 1 JH-7110 DevKit WiFi and Bluetooth Developing and Porting Guide Version: 1.0 Data: 2023/06/02 Doc ID: JH7110-DGEN-002...
  • Page 2 StarFive does not assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation indirect, incidental, special, exemplary, or consequential damages.
  • Page 3: Table Of Contents

    2. Bluetooth Development Instructions..................24 2.1. Introduction..........................24 2.1.1. Bluetooth Software Architecture Overview.............. 24 2.2. Bluetooth Installation......................25 2.2.1. Dip Switch Settings....................25 2.2.2. Enable Bluetooth Function Of Linux Kernel.............. 26 2.2.3. Enable Bluetooth.......................27 2.3. Bluetooth Mac Address Configuration.................28 © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 4: List Of Tables

    Contents List of Tables Table 0-1 Revision History........................vi www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 5: List Of Figures

    Figure 1-8 CFG80211-Wireless configuration API................16 Figure 1-9 Example Output......................... 19 Figure 1-10 Wlan0 IP...........................20 Figure 1-11 Example Output....................... 22 Figure 2-1 BlueZ Overview Diagram....................25 Figure 2-2 Dip Switch Setting Locations....................26 © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 6: Preface

    About this document This document mainly provides the SDK developers with the programing basics and debugging know-how for the WiFi and Bluetooth of the StarFive next generation SoC platform - JH-7110. Audience This document mainly serves the WiFi and Bluetooth relevant driver developers. If you are developing other modules, place a request to your sales or support consultant for our complete documentation set on JH-7110.
  • Page 7: Wifi Development Instructions

    The advantage of using the dongle concept is that the wireless driver is executed externally from a host device, which means the host device does not have to use CPU or memory resources in order © 2018-2024 StarFive Technology www.starfivetech.com...
  • Page 8 DHD, which is a host-based driver used to provide a communication channel with the dongle device firmware. The following is the digram of the Broadcom SDIO WLAN Dongle concept. www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 9: Figure 1-1 Broadcom Sdio Wlan Dongle Concept

    1.1.2.3. WiFi Software Package The WiFi software package of JH-7110 DevKit contains following files: • Dongle host driver (bcmdhd): WLAN adapter host driver. • Dongle device firmware (fw_bcm4345c5_ag.bin): WLAN adapter device firmware.
  • Page 10: Porting Instruction

    // Power up/down internal regulators used by WiFi section status = "okay"; brcmf: bcmdhd_wlan { compatible = "bcmdhd_wlan"; gpio_wl_host_wake = <&gpioa 3 GPIO_ATIVE_HIGH>;//WL_HOST_WAKE The following code block displays the SDIO node reference: www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 11 "gpio_request(%d) for WL_REG_ON failed %d\n", gpio_wl_reg_on, ret); gpio_wl_reg_on = -1; return -EINVAL; ret = gpio_direction_output(gpio_wl_reg_on, 0); (ret) { dev_err(&pdev->dev, "WL_REG_ON didn't output high\n"); return -EIO; mdelay(10); ret = gpio_direction_output(gpio_wl_reg_on, 1); (ret) { © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 12: Kernel Menu Configuration

    1. Under the root directory of devkits, type the following command to enter the kernel menu configuration GUI. make linux-menuconfig 2. Enter the Device Drivers menu option. Figure 1-2 Device Drivers 3. Enter the Network device support menu option. www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 13: Figure 1-3 Network Device Support

    | 1 - WiFi Development Instructions Figure 1-3 Network device support 4. Enter Wireless LAN menu option. Figure 1-4 Wireless LAN © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 14: Figure 1-5 Broadcom Fullmac Wireless Cards Support

    • Enable Chip Interface: This is used to select the WiFi interface. In this example, SDIO is used as the WiFi interface. The following figure shows the options under Enable Chip Interface: www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 15: Figure 1-6 Enable Chip Interface

    | 1 - WiFi Development Instructions Figure 1-6 Enable Chip Interface • Interrupt type: This is used to choose the wake interrupt. Figure 1-7 Interrupt type © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 16: Setting Custom Mac Address

    Makefile. -DGET_CUSTOM_MAC_ENABLE 2. Modify the function in dhd_gpio.c to read your MAC address dhd_wlan_get_mac_addr where located in your system. 3. Then the WiFi driver will update the firmware MAC address during initialization. www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 17: Install Dongle Host Driver

    This allows wpa_supplicant to overwrite configuration files after modifying the configuration. For example, add new network statement blocks through wpa_cli tool, write configuration to wpa_gui, change password, etc. Network Settings There are 3 examples to add network for wpa_supplicant.conf file: © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 18 1.3.1.2. Install WPA Supplicant Follow the steps below to install WPA supplicant. 1. Execute the following command to connect to the network configured in wpa_supplicant.conf: wpa_supplicant -Dnl80211 -i wlan0 -c wpa_supplicant.conf -d& Example Output www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 19: Figure 1-9 Example Output

    | 1 - WiFi Development Instructions Figure 1-9 Example Output 2. After connect successfully, execute the following command to obtain the IP of wlan0 by using tool: udhcpc udhcpc -i wlan0 © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 20: Figure 1-10 Wlan0 Ip

    In addition, it can be used to configure variables such as EAPOL state machine parameters and trigger events such as re-association and IEEE 802.1X logout/login. has many functions, which can be seen through execute command. The wpa_cli wpa_cli -h following list are some example commands: www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 21: Softap Mode Operation

    2. Add the following content to the configuration file. AP Hotpot Settings The following are 2 examples to add AP hotpot for your hostapd.conf file: • Open system without encryption: interface=wlan0 driver=nl80211 ctrl_interface=/var/run/hostapd ssid=AndroidAP channel=6 © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 22: Figure 1-11 Example Output

    2. Add subnet to the main configuration file /etc/dhcp/dhcpconf of dhcp, for example: subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.10 192.168.0.20; option routers 192.168.0.1; Then, execute the following command to configure the IP address for the WiFi interface: ifconfig wlan0 192.168.0.1 www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 23 IP forwarding means that forwards the interface connecting the network cable on SBC to the wlan0 interface. The following is an example: echo 1 > /proc/sys/net/ipv4/ip_forward iptables -F iptables -P FORWARD ACCEPT iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 24: Bluetooth Development Instructions

    We use it to provide Bluetooth profiles on GB86XX and it consists of following components: • HCI Core • HCI UART, USB and Virtual HCI device drivers • L2CAP protocol module • Configuration and testing utilities www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 25: Bluetooth Installation

    In our case, we use UART as the Host Controller Interface (HCI) and AP6XXX is the Bluetooth Hardware in figure above. 2.2. Bluetooth Installation 2.2.1. Dip Switch Settings Before connecting the Bluetooth mode on JH-7110 DevKit, you need to set the following dip switch: Dip Switch for Function GPIO Group GPIO...
  • Page 26: Enable Bluetooth Function Of Linux Kernel

    2.2.2. Enable Bluetooth Function Of Linux Kernel Add following items into your kernel configuration to enable Bluetooth function of Linux kernel: CONFIG_BT_HCIUART=y CONFIG_BT_HCIUART_H4=y CONFIG_BT=y CONFIG_BT_L2CAP=y CONFIG_BT_SCO=y CONFIG_BT_RFCOMM=y CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=y CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_HIDP=y www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...
  • Page 27: Enable Bluetooth

    The following list are help some example commands: • Enter the tool: bluetoothctl ◦ Check: default-agent ◦ Register agent: agent on ◦ Scan: scan on ◦ Stop scan: © 2018-2024 StarFive Technology www.starfivetech.com All rights reserved...
  • Page 28: Bluetooth Mac Address Configuration

    # hciconfig hci0 up # hciconfig hci0: Type: BR/EDR Bus: UART BD Address: 11:22:33:44:55:66 ACL MTU: 1021:8 SCO MTU: 64:1 UP RUNNING RX bytes:1011 acl:0 sco:0 events:39 errors:0 TX bytes:208 acl:0 sco:0 commands:39 errors:0 www.starfivetech.com © 2018-2024 StarFive Technology All rights reserved...

Table of Contents