Code Monkey home page Code Monkey logo

kflash_gui's People

Contributors

mkgin avatar neutree avatar orgmar avatar vowstar avatar xelll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kflash_gui's Issues

Failed to enter the next stage after booting using OpenSBI on MaixDock

Development Environment

Software

Hardware

  • Board: MaixDock

Problem Description

I wanted to set an execution environment for my own RISC-V kernel on MaixDock, so I tried to use OpenSBI to initialize some registers in Machine mode and switch to Supervisor mode while jumping to my kernel code. Because the kernel need to be put into a fixed location of memory, I changed the firmware mode of OpenSBI to FW_JUMP, which allows OpenSBI jump to a fixed location after it quits.

To be specific, I changed platform/kendryte/k210/config.mk from:

FW_PAYLOAD=y
FW_PAYLOAD_ALIGN=0x1000
FW_PAYLOAD_FDT=k210.dtb

to:

FW_JUMP=y
FW_JUMP_ADDR=0x80200000

Using make PLATFORM=kendryte/k210 I got the FW_JUMP styled OpenSBI image in build/platform/kendryte/k210/firmware/fw_jump.bin.
In order to test if it was working, I chose a substitution of kernel, the simple payload automatically generated by OpenSBI test.bin. You can change the config.mk back to default and find it in build/platform/kendryte/k210/firmware/payload/test.bin. Its functionality is just printing a message to UART and spinning.
However, when I used the kflash_gui tool to load the OpenSBI image fw_jump.bin and the payload test.bin into flash, at a offset of 0x000000 and 0x2000000 respectively, the output was:

[00:17:29:600] OpenSBI v0.4 (Jul  5 2020 22:41:22)␍␊
[00:17:29:607]    ____                    _____ ____ _____␍␊
[00:17:29:607]   / __ \                  / ____|  _ \_   _|␍␊
[00:17:29:617]  | |  | |_ __   ___ _ __ | (___ | |_) || |␍␊
[00:17:29:617]  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |␍␊
[00:17:29:617]  | |__| | |_) |  __/ | | |____) | |_) || |_␍␊
[00:17:29:627]   \____/| .__/ \___|_| |_|_____/|____/_____|␍␊
[00:17:29:627]         | |␍␊
[00:17:29:627]         |_|␍␊
[00:17:29:627] ␍␊
[00:17:29:627] Platform Name          : Kendryte K210␍␊
[00:17:29:638] Platform HART Features : RV64ACDFIMSU␍␊
[00:17:29:638] Platform Max HARTs     : 2␍␊
[00:17:29:638] Current Hart           : 0␍␊
[00:17:29:638] Firmware Base          : 0x80000000␍␊
[00:17:29:649] Firmware Size          : 56 KB␍␊
[00:17:29:649] Runtime SBI Version    : 0.1

Dramatically, when I put the two files together using Merge to .bin of kflash_gui(the gap between them still existed because the size of the merged binary was 2.1MiB) and flushed it into flash at a offset of 0x000000, the output was:

[00:21:22:935] Cause 0x0000000000000004, EPC 0x0000000080000004, Core 0␊
[00:21:22:938] reg[00](zero ) = 0x0000000000000000, reg[01](ra   ) = 0x000000008800b32c␊
[00:21:22:955] reg[02](sp   ) = 0x00000000805ffdd0, reg[03](gp   ) = 0x00000000805fc800␊
[00:21:22:955] reg[04](tp   ) = 0x0000000080600000, reg[05](t0   ) = 0x000000008800af88␊
[00:21:22:958] reg[06](t1   ) = 0x0000000000000000, reg[07](t2   ) = 0x0000000000000000␊
[00:21:22:972] reg[08](s0/fp) = 0x00000000805fff18, reg[09](s1   ) = 0xffffffffffffffd2␊
[00:21:22:972] reg[10](a0   ) = 0x0000000000000000, reg[11](a1   ) = 0x00000000805ffeb8␊
[00:21:22:989] reg[12](a2   ) = 0x0000000000000008, reg[13](a3   ) = 0x0000000000000000␊
[00:21:22:989] reg[14](a4   ) = 0x0000000002000004, reg[15](a5   ) = 0x0000000000000000␊
[00:21:23:007] reg[16](a6   ) = 0x000000008800bc30, reg[17](a7   ) = 0x0000000000000000␊
[00:21:23:007] reg[18](s2   ) = 0x00000000800103a8, reg[19](s3   ) = 0x0000000000000000␊
[00:21:23:007] reg[20](s4   ) = 0x0000000000000000, reg[21](s5   ) = 0x0000000000000000␊
[00:21:23:007] reg[22](s6   ) = 0x0000000000000000, reg[23](s7   ) = 0x0000000000000000␊
[00:21:23:025] reg[24](s8   ) = 0x00000000805ffeb0, reg[25](s9   ) = 0x00000000805ffff0␊
[00:21:23:025] reg[26](s10  ) = 0xffffffffffffffd2, reg[27](s11  ) = 0x0000000000000000␊
[00:21:23:042] reg[28](t3   ) = 0x0000000000000000, reg[29](t4   ) = 0x0000000000000000␊
[00:21:23:042] reg[30](t5   ) = 0x0000000000000000, reg[31](t6   ) = 0x0000000000000000␊
[00:21:23:042] Reason: fuck the chip is dead!␊
[00:21:23:062] interesting, something's wrong, boot failed with exit code 666, go to find your vendor.␊

It could be seen that the payload worked normally. After changing the config.mk back to default and build, the reuslt fw_payload.bin was expected:

[00:26:13:085] OpenSBI v0.4 (Jul  5 2020 22:41:22)␍␊
[00:26:13:088]    ____                    _____ ____ _____␍␊
[00:26:13:105]   / __ \                  / ____|  _ \_   _|␍␊
[00:26:13:105]  | |  | |_ __   ___ _ __ | (___ | |_) || |␍␊
[00:26:13:105]  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |␍␊
[00:26:13:105]  | |__| | |_) |  __/ | | |____) | |_) || |_␍␊
[00:26:13:122]   \____/| .__/ \___|_| |_|_____/|____/_____|␍␊
[00:26:13:122]         | |␍␊
[00:26:13:122]         |_|␍␊
[00:26:13:122] ␍␊
[00:26:13:122] Platform Name          : Kendryte K210␍␊
[00:26:13:122] Platform HART Features : RV64ACDFIMSU␍␊
[00:26:13:122] Platform Max HARTs     : 2␍␊
[00:26:13:122] Current Hart           : 0␍␊
[00:26:13:144] Firmware Base          : 0x80000000␍␊
[00:26:13:144] Firmware Size          : 56 KB␍␊
[00:26:13:144] Runtime SBI Version    : 0.1␍␊
[00:26:13:144] ␍␊
[00:26:13:144] ␍␊
[00:26:13:144] Test payload running␍␊

I do not know if there is anything wrong in OpenSBI(actually, the version of OpenSBI matters), kflash, or the board. Thank you!

can't open the kflash_gui on ubuntu16.04

[13924] Error loading Python lib '/home/xxx/.local/share/Trash/files/kflash_gui_v1.0.0_linux/libpython3.6m.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /home/thundersoft/.local/share/Trash/files/kflash_gui_v1.0.0_linux/libpython3.6m.so.1.0)

kflash module not found

Hello,

I execute the commands like on documentation but kflash not found :x
How I do make to corrected the problem ?

user@post:/workspace/ia/sipeed/kflash_gui$ sudo pip3 install -r requirements.txt
[sudo] Mot de passe de user :
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: bs4>=0.0.1 in /home/user/.local/lib/python3.6/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied: PyQt5>=5.12.2 in /home/user/.local/lib/python3.6/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied: pyserial>=3.4 in /home/user/.local/lib/python3.6/site-packages (from -r requirements.txt (line 3))
Requirement already satisfied: requests>=2.22.0 in /home/user/.local/lib/python3.6/site-packages (from -r requirements.txt (line 4))
Requirement already satisfied: urllib3>=1.25.3 in /home/user/.local/lib/python3.6/site-packages (from -r requirements.txt (line 5))
Requirement already satisfied: beautifulsoup4 in /home/user/.local/lib/python3.6/site-packages (from bs4>=0.0.1->-r requirements.txt (line 1))
Requirement already satisfied: PyQt5_sip<13,>=4.19.14 in /home/user/.local/lib/python3.6/site-packages (from PyQt5>=5.12.2->-r requirements.txt (line 2))
Requirement already satisfied: idna<2.9,>=2.5 in /home/user/.local/lib/python3.6/site-packages (from requests>=2.22.0->-r requirements.txt (line 4))
Requirement already satisfied: certifi>=2017.4.17 in /home/user/.local/lib/python3.6/site-packages (from requests>=2.22.0->-r requirements.txt (line 4))
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/user/.local/lib/python3.6/site-packages (from requests>=2.22.0->-r requirements.txt (line 4))
Requirement already satisfied: soupsieve>=1.2 in /home/user/.local/lib/python3.6/site-packages (from beautifulsoup4->bs4>=0.0.1->-r requirements.txt (line 1))
user@post:
/workspace/ia/sipeed/kflash_gui$ sudo pip3 install KFlash
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: KFlash in /home/user/.local/lib/python3.6/site-packages
Requirement already satisfied: pyelftools>=0.25 in /home/user/.local/lib/python3.6/site-packages (from KFlash)
Requirement already satisfied: enum34>=1.1.6 in /home/user/.local/lib/python3.6/site-packages (from KFlash)
Requirement already satisfied: pyserial>=3.4 in /home/user/.local/lib/python3.6/site-packages (from KFlash)
user@post:~/workspace/ia/sipeed/kflash_gui$ python3 kflash_gui.py
Traceback (most recent call last):
File "kflash_gui.py", line 25, in
from kflash_py.kflash import KFlash
ModuleNotFoundError: No module named 'kflash_py.kflash'

Support for Maix Dock II

I can not seem to get any firmware downloaded to the Maix Dock II, all other boards work including Maixduino, Maix Bit, Maix Dock.

The error is always fail to detect board - even though the 2 COM serial ports show up successfully in the Windows Device manager.

kflash_gui can not run in manjaro19

when click "Open File“,the app exit with an error like this:

icon path:/home/zsp/maixpy/kflash_gui/kflash_gui_data/assets/logo.png
config file path: /home/zsp/.config/kflash_gui/kflash_gui.conf
data path:/home/zsp/maixpy/kflash_gui/kflash_gui_data
2
error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>
/usr/lib/gio/modules/libgioremote-volume-monitor.so: undefined symbol: g_mount_operation_get_is_tcrypt_system_volume
Failed to load module: /usr/lib/gio/modules/libgioremote-volume-monitor.so
/usr/lib/gio/modules/libgioremote-volume-monitor.so: undefined symbol: g_mount_operation_get_is_tcrypt_system_volume
Failed to load module: /usr/lib/gio/modules/libgioremote-volume-monitor.so

(kflash_gui:2286): GdkPixbuf-WARNING **: 08:02:55.979: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': 没有那个文件或目录

This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.

(kflash_gui:2286): Gtk-WARNING **: 08:02:55.979: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.

(kflash_gui:2286): GdkPixbuf-WARNING **: 08:02:55.980: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': 没有那个文件或目录

This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/gnome/16x16/status/image-missing.png: 无法识别的图像文件格式 (gdk-pixbuf-error-quark, 3)
[1] 2285 abort (core dumped) ./kflash_gui

Does not run on Ubuntu xenial

Hi, thanks for making an AppImage. However, it does not run on xenial since it likely was built on a too new system:

kflash_gui: relocation error: /run/firejail/appimage/.appimage-9355/usr/lib/libc.so.6: symbol _dl_exception_create, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

Reference:
AppImage/appimage.github.io#2153

windows version shows up as malware

Windows defender quarantines the file.
Threat detected: Trojan:Win32/Fuery.B!cl
Alert level: Severe
Category: Trojan
Details: This program is dangerous and executes commands from an attacker.

kflash_gui_v1.2.5_windows.zip
file: C:\Users\all\Downloads\kflash_gui_v1.2.5_windows.zip->kflash_gui.exe

kflash gui error - No such file or directory when trying to burn .kmodel packaged in .kfpkg

Greetings, I was trying to burn my mobilenet v1 model that i trained via transfer learning on Sipeed Maix Dock. I packaged it in .kfpkg file with a flash-list.json specifying the address of the kmodel. I used the maixpy_v0.3.2_minimum.bin firmware. First i downloaded the firmware on the board and it successfully gets downloaded. But when i try to burn the .kfpkg file via kflash_gui i get this error -
No such file or directory: 'C:\Users\user_name\AppData\Local\Temp\tgmslflsdag8kl\flash-list.json
How can i resolve this? TIA.

Can't upload with v1.3.2 on macOS

Hi,

kflash_gui v1.2.5 works fine for me on macOS 10.15 Beta (19A512f) with my M5StickV (with m5stickV_Firmware_0630Fixed.kfpkg). However, I can't upload with the latest release version (i.e., v1.3.2). I want to share a screenshot for your reference.

Screenshot 2019-07-19 17 18 53

Anyway, thank you very much for developing such a useful tool. 😉

Does not work on Linux Mint 20.3

It seems requiring GLIBC_2.35 but on Mint there is only the 2.31.

$ ./kflash_gui
[40197] Error loading Python lib './kflash_gui/libpython3.8.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by ./kflash_gui/libpython3.8.so.1.0)

$ ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.