Flash and Authorize BK3431Q

Last Updated on : 2024-06-14 18:56:53download

Firmware flashing

BK3431Q supports firmware flashing through SPI or UART.

BK3431Q firmware consists of three parts: boot, stack, and app.

  • bk3435_ble_app_merge_crc.bin is a binary after merging the boot, stack, and app. It can be flashed to the chip through SPI only.
  • bk3435_ble_app_oad.bin is the binary of the application. It can be flashed to the chip through UART.
  • bk3435_ble_app_stack_oad.bin is the binary of the stack and app. It can be flashed to the chip through UART.

SPI-based flashing

  • Hardware

    BEKEN SPI flasher
    You can purchase the flasher from the chip vendor or contact your account manager.

  • Programmer

    Flash and Authorize BK3431Q

    Flash and Authorize BK3431Q

  • Procedure

  1. Connect wires (SW SPI) as shown below.

    BEKEN SPI flasher MOSI MISO P2.4 P2.3 GND VPP VCC CS WP
    BK3431Q pin P04 P05 P02 P06 GND RST +3V P07 P03

    If you use BEKEN’s development board, you can plug it directly into the computer without wiring.

  2. Download BEKEN’s HID Download Tool to flash the firmware.

  3. Open HID Download Tool, choose Download Mode > Port Select > SPI SOFT Software.

  4. After selecting the firmware file and COM port, click Download Flash.

    The location and name of the firmware.

    Flash and Authorize BK3431Q

  5. Check the information output from UART2.

    1. After the firmware is flashed, disconnect the BEKEN SPI flasher from BK3431Q.

    2. Connect BK3431Q to the computer using a USB to TTL converter.

    3. Press the reset button to reset BK3431Q.

      If information is output from the serial port, it means the firmware runs properly.

You can output logs through UART2, at 115200 baud. TY_LOG_ENABLE and TUYA_APP_LOG_ENABLE are used to enable/disable logging, which is disabled by default.

UART-based flashing

  • Software

    Beken Writer

  • Hardware

USB to UART converter with a CH340 chip.

  • Procedure
  1. Connect wires as shown below.

    USB to UART converter VCC GND RX TX
    BK3431Q pin +3V GND UART_TX UART_RX
  2. Select the COM port, which should not exceed 10. If it exceeds, modify it in the device manager.

  3. Select the firmware to download.

  4. Click Flash to download firmware.

  5. When the software shows success status, it indicates download is finished.

  6. Then, the board can scan for advertising packets.

    The location and name of the firmware.

    Flash and Authorize BK3431Q

Firmware authorization

Get the license

For more information, see Authorize Bluetooth LE Series Modules.

Flashing and authorization

  1. Connect UART1 on the chip to a USB to TTL converter.

  2. Open Cloud Module Burning Authorization Platform, and enable Only Auth.

    Flash and Authorize BK3431Q

    If you use UART2 for authorization, ensure that you set the baud and UART on the software according to the code.

        ty_uart_init(); //9600
        ty_uart2_init(); //115200