Maix Bit cannot flash new firmware

Hello, I received my Maix Bit yesterday and was trying the sample scripts for MaixPy using the MaixPy IDE at some point when I was loading a script the screen became blank white and I have not been able to flash anything since. I have used Kflash Gui v1.5 and K-Flash 0.3 and nothing works. How can I reset the board?

Is there any output over serial when you reset (i.e. push the reset button)? Do you get any errors when flashing? Have you tried ktool? If you have a JTAG emulator, have you tried hooking it up? If you have an oscilloscope or logic analyzer, do you see signals on the SPI flash chip during boot?

I’m running Manjaro linux 20

I have not tried to use serial monitor, I dont know how.

I get a error with ktool:

[INFO] Trying to Enter K210 ROM ISP Mode… .
Greeting fail, check serial port (SLIP receive timeout (wait frame start))

kflash does flash firmware:

$ kflash -p /dev/ttyUSB1 maixpy_v0.5.0_88_gb7f0c13.bin
*[INFO] COM Port Selected Manually: /dev/ttyUSB1 *
*[INFO] Default baudrate is 115200 , later it may be changed to the value you set. *
*[INFO] Trying to Enter the ISP Mode… *
._
*[INFO] Automatically detected goE/kd233 *

*[INFO] Greeting Message Detected, Start Downloading ISP *
Downloading ISP: |=================================================================================================================| 100.0% 10kiB/s
*[INFO] Booting From 0x80000000 *
*[INFO] Wait For 0.1 second for ISP to Boot *
*[INFO] Boot to Flashmode Successfully *
*[INFO] Selected Flash: On-Board *
*[INFO] Initialization flash Successfully *
Programming BIN: |=================================================================================================================| 100.0% 10kiB/s
[INFO] Rebooting…

But I think my bootloader is broken since I cant connect to the board with the maixpy IDE. And I dont know how to flash a new one. I have been trying to flash isp.bin that comes with the ktool repo and have had not been able to get that to work. Is that isp.bin the bootloader. How do I flash it to the proper address? When I try --> kflash -p /dev/ttyUSB0 --bootloader isp.bin <-- it asks for a firmware file.

I do have a j-link and st-link although my knowledge of them is little especially the j-link, but I have not tried connecting those to he board.

I dont have a scope or analyzer.

As I said earlier this board worked when I got it but something went wrong in some way when I was trying to load a script to it in the maixpy IDE. So I have no experience with this board. I have however been playing with arduinos, esp, stm32 and adafruit circuitpython boards for close to 2 years.

If you need more info just ask. Any suggestions would be very greatly appreciated.

I have not tried to use serial monitor, I dont know how.

use picocom like

picocom -b 115200 /dev/ttyUSB1

and you should be able to use serial. You can also pass -t to ktool or kflash and they will start a terminal after flashing. Do be aware that I’ve had some issues with the enter key being hit twice for every time I press it with the ktool/kflash terminal.

I get a error with ktool:

[INFO] Trying to Enter K210 ROM ISP Mode… .
Greeting fail, check serial port (SLIP receive timeout (wait frame start))

Have you passed the board option? I have to use -B bit_mic to flash my board. If you have the version of the bit without a microphone (it has a metal package with a hole), you will need to use -B bit instead.

But I think my bootloader is broken since I cant connect to the board with the maixpy IDE. And I dont know how to flash a new one. I have been trying to flash isp.bin that comes with the ktool repo and have had not been able to get that to work. Is that isp.bin the bootloader. How do I flash it to the proper address? When I try --> kflash -p /dev/ttyUSB0 --bootloader isp.bin <-- it asks for a firmware file.

The bootloader is not the “real” bootloader. The real bootloader on the device has limited capabilities, so kflash/ktool first sends a “bootloader” over which is more capable. This “bootloader” does the actual reception and flashing of your firmware.

I do have a j-link and st-link although my knowledge of them is little especially the j-link, but I have not tried connecting those to he board.

I’ve been trying to get this to work recently, but I haven’t had any luck. There is a special version of openocd that you will need if you want to try it out.

edit: I have gotten jtag working, thought I haven’t done extensive testing.