
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
This is a cross-platform Kendryte K230 chip firmware flashing tool written in Python. It provides command-line tools (CLI), graphical user interface (GUI), and programmable Python API for flashing firmware to K230 devices via USB.
This project aims to provide K230 chip users with a feature-rich, high-performance, cross-platform, and easily extensible firmware flashing tool.
EMMC
, SDCARD
, SPI_NAND
, SPI_NOR
, and automatically select corresponding loaders..kdimg
firmware packages..kdimg
address command-line override..img
files to specified memory addresses.pyusb
, runs on Windows, Linux, macOS.K230_flash_GUI
tool with source code for user reference and customization.Before using k230-flash
, please ensure that the K230 device is in flashing mode and the operating system has properly installed USB drivers.
First, hold down the boot button on the K230 device, then insert the USB cable to connect the K230 device to the computer. For Windows, you will see K230 USB Boot Device
displayed under Universal Serial Bus devices
in Device Manager
, which indicates that K230 is in flashing mode and ready for subsequent operations.
When using for the first time, you may need to install WinUSB driver for the K230 device. It's recommended to use the Zadig tool:
K230 USB Boot Device
from the dropdown list (or shown as Unknown Device
, Vendor ID: 29f1
, Product ID: 0230
).After completion, Windows will be able to recognize the device, and the k230-flash
tool can be used normally.
Linux has built-in usbfs/libusb drivers by default, usually no additional installation is required.
But you need to configure udev rules for non-root users, otherwise you may need to use sudo
to execute commands.
/etc/udev/rules.d/99-k230.rules
:SUBSYSTEM=="usb", ATTRS{idVendor}=="29f1", ATTRS{idProduct}=="0230", MODE="0666"
sudo udevadm control --reload-rules
sudo udevadm trigger
After completion, regular users can run k230-flash
directly without sudo
.
macOS comes with libusb drivers built-in, usually no additional operations are required.
If permission issues occur, try using sudo
to run, or ensure the latest libusb is installed via brew:
brew install libusb
Install from PyPI:
pip install k230-flash
Ensure the K230 device is connected to the computer via USB, then run the following command to check if the device is properly recognized:
k230-flash --list-devices
If the device is connected, you will see output similar to the following:
[
{
"bus": 1,
"address": 5,
"port_path": "1-5.1",
"vid": 10737,
"pid": 560
}
]
The tool mainly supports two flashing modes.
.kdimg
File PackageThis is the simplest mode. Just pass the .kdimg
file as a parameter.
k230-flash -m SDCARD /path/to/your/firmware.kdimg
.img
FilesYou can specify a series of [address, file path]
pairs to flash different .img
files to different memory locations.
# Format: k230-flash [address1] [file1] [address2] [file2] ...
k230-flash -m SDCARD 0x000000 uboot.img 0x400000 rtt.img
Specify Device: If multiple devices are connected, use -d
or --device-path
to specify the device path to operate on.
k230-flash -d "1-5" firmware.kdimg
Specify Storage Media: Use -m
or --media-type
to specify the target media, and the tool will select the correct loader accordingly. Default is EMMC
.
k230-flash --media-type SPI_NOR firmware.kdimg
Custom Loader: Use -lf
and -la
to specify your own loader file and load address.
k230-flash --loader-file my_loader.bin --loader-address 0x80360000 firmware.kdimg
Auto Reboot: Use --auto-reboot
to automatically restart the device after flashing is complete.
You can easily integrate the functionality of this tool into your own Python scripts.
import sys
from loguru import logger
from k230_flash import flash_kdimg, flash_addr_file_pairs, list_devices
# Configure logging to see detailed output
logger.remove()
logger.add(sys.stderr, level="INFO")
def main():
try:
# List devices
print("Connected devices:")
print(list_devices())
# Flash .kdimg file
logger.info("Flashing kdimg file...")
flash_kdimg(
kdimg_file="/path/to/your/firmware.kdimg",
media_type="EMMC",
auto_reboot=True
)
logger.info("kdimg flash completed.")
# Flash independent .img files
logger.info("Flashing individual image files...")
image_pairs = [
(0x000000, "/path/to/uboot.img"),
(0x400000, "/path/to/rtt.img")
]
flash_addr_file_pairs(
addr_filename_pairs=image_pairs,
media_type="SDCARD"
)
logger.info("Image files flash completed.")
except Exception as e:
logger.error(f"An error occurred: {e}")
if __name__ == "__main__":
main()
In addition to the command-line tool and Python library, this project also provides a feature-complete graphical user interface tool K230 Flash GUI, allowing users to perform firmware flashing operations through an intuitive interface.
You can download the latest version of pre-compiled executable files from the GitHub Releases page. After downloading, run directly without installing Python environment.
For detailed usage instructions of the GUI tool, please refer to K230 Flash GUI User Manual.
Contributions to this project are welcome!
.
├── src/ # Source code root directory
│ ├── k230_flash/ # Core flashing library
│ └── gui/ # Graphical interface tool
git checkout -b feature/AmazingFeature
).git commit -m 'Add some AmazingFeature'
).git push origin feature/AmazingFeature
).It's recommended to use black
or ruff format
to format your code.
This project is licensed under the MIT License. See the LICENSE
file for details.
FAQs
K230 flash tool for command-line usage and GUI
We found that k230-flash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.