Difference between revisions of "3 Try burning the board"

From Banana Pi Wiki
Jump to: navigation, search
(Erase the board firmware)
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[File:Webduino_gif.gif|thumb|Overview: [[BPI-Bit]]]]
 +
[[File:Micropython3.png|thumb|[[1 Get the development suite]] ]]
 +
[[File:Micropython2.png|thumb|[[2 Wired connection board]] ]]
 +
[[File:Micropython2.png|thumb|[[3 Try burning the board]] ]]
 +
[[File:Micropython2.png|thumb|[[4 Hello, World!]] ]]
 +
[[File:Micropython2.png|thumb|[[5 Light up all kinds of LED]] ]]
 +
 +
 +
[[File:Micropython4.png|thumb|[[1  Auto series one key burn]] ]]
 +
[[File:Micropython2.png|thumb|[[2  ESPBlocks Beginner's only]] ]]
 +
[[File:Micropython2.png|thumb|[[3 Mpfshell details]] ]]
 +
[[File:Micropython2.png|thumb|[[4 Pycharm IDE programming]] ]]
 +
 +
 +
[[File:Micropython5.png|thumb|[[1. Panel scrolling text]] ]]
 +
[[File:Micropython2.png|thumb|[[2. Panel display images]] ]]
 +
[[File:Micropython2.png|thumb|[[3 Bottom IO port control]] ]]
 +
[[File:Micropython2.png|thumb|[[4 Panel key detection]] ]]
 +
[[File:Micropython2.png|thumb|[[5 Gets the board temperature]] ]]
 +
[[File:Micropython2.png|thumb|[[6 Play MIDI music]] ]]
 +
[[File:Micropython2.png|thumb|[[7 Photosensitive gesture]] ]]
 +
[[File:Micropython2.png|thumb|[[8. MPU-9250 9-axis sensor]] ]]
 +
[[File:Micropython2.png|thumb|[[9. Make a compass]] ]]
 +
[[File:Micropython2.png|thumb|[[10 Free to define gestures]] ]]
 +
[[File:Micropython2.png|thumb|[[11 Random number generator]] ]]
 +
[[File:Micropython2.png|thumb|[[12 S2m Scratch2]] ]]
 +
[[File:Micropython2.png|thumb|[[13 Codelab Scratch3]] ]]
 +
 +
 +
[[File:Micropython6.png|thumb|[[1 The basic algorithm]]  ]]
 +
[[File:Micropython2.png|thumb|[[2 WiFI wireless connection]] ]]
 +
[[File:Micropython2.png|thumb|[[3 WiFI wireless programming]] ]]
 +
[[File:Micropython2.png|thumb|[[MQTT communication applications]]]]
 +
 +
 
'''Try burning the board'''
 
'''Try burning the board'''
  
Line 30: Line 65:
 
In Windows system, for example, double-click to run  '''autoeraser.Exe''' , which recognizes the serial port where the computer inserted the latest board and automatically erases the board, so you only need to make sure the board is the latest device to insert.
 
In Windows system, for example, double-click to run  '''autoeraser.Exe''' , which recognizes the serial port where the computer inserted the latest board and automatically erases the board, so you only need to make sure the board is the latest device to insert.
  
- ![erase_succeed](how_to_flash/erase_succeed.png)
+
[[File:Erase_succeed.png]]
  
- 以上即为成功擦除,如果失败请重试,仍然失败,请检查或设备的串口。
+
the above is the successful erasure, if failed, please try again, still failed, please check or the serial port of the device.
  
#### 2. 更新板子固件
+
== 2. Update the board firmware==
  
- 遇到以下情况时,建议更新一次板子。
+
it is recommended to update the board once in the following situations.
  
  - 擦除板子后
+
*after erasing the board
  - 需升级固件
+
*firmware needs to be upgraded
  
- 以 Windows 为例,双击运行 **AutoFlash.exe**,它会识别最新插入的板子的串口,并自动将同一目录下的 **firmware.bin** 固件文件烧写到板子当中。
+
in Windows, for example, double-click to run  '''autoflash.exe''' . It will recognize the most recently inserted serial port of the board and automatically write all firmware files in the same directory to the board.
  
- ![flash_succeed](how_to_flash/flash_succeed.png)
+
[[File:Flash_succeed.png]]
  
- 以上即为成功烧写,如果失败请重试,仍然失败,请检查或设备的串口。
+
The above is a successful burn, if the failure, please try again, still failed, please check or device serial port
  
- 至此已经完成了烧写,可以进入下一章节[Hello, World!](https://github.com/BPI-STEAM/BPI-BIT-MicroPython/wiki/helloworld)了,如有其他疑问或想知道更多的,可以继续往下看。
+
Now that the burn is complete, you can move on to the next chapter [[3 Hello, World!]],If you have any other questions or want to know more, please read on.
  
# 烧写工具详解*
+
=Burn tool details=
  
## 使用 windows 系统*
+
==Use windows System==
  
- 运行 `AutoFlash.exe` 程序会自动查找最新插入的串口并将同一目录下的`fimware.bin`文件一键烧写至芯片当中。
+
Run ` AutoFlash. Exe ` program will automatically find the latest inserted into the serial port and will be the same directory ` fimware. Bin ` file burn write to the chip of a key.
  
- ![auto_flash_running](how_to_flash/auto_flash_running.png) 。
+
[[File:Auto_flash_running.png]]
  
- 使用 `AutoErase.exe` 程序可以将固件擦除,如果此前有其他固件存在,或遇到了不可解决的问题,均可通过该修复(擦除)工具重置板子后烧写固件,注意,它会将板子的所有文件全部删除。
+
Using ` AutoErase. Exe ` program firmware can be erased, if there are other firmware, or have a unsolvable problems, are available through the repair (erase) tool to reset the board after burning firmware, note that it will be the board all the file is deleted.
  
- ![auto_erase_running](how_to_flash/auto_erase_running.png) 。
+
[[File:Auto_erase_running.png]]
  
- 上述程序经由相关 Python 脚本与`Pyinstller X86`模块打包而成。
+
The above procedure through related Python scripts and ` Pyinstller X86 ` module packaging
  
- 以上两工具均支持命令行 ` AutoErase.exe --port COM4 --baud 115200 --port` 的用法,具体可以看下方配置参数介绍。
+
more than two tools support command line ` AutoErase. Exe - port COM4 - baud 115200 - port ` usage, specific can see below the configuration parameters are introduced.
  
## 使用 linux 系统*
+
==Use linux system==
  
``` Shell
+
Shell  
sudo esptool.py --chip esp32 --port COM3 --baud 1152000 write_flash -z --flash_mode dio --flash_freq 40m 0x1000 firmware.bin
+
sudo esptool.py --chip esp32 --port COM3 --baud 1152000 write_flash -z --flash_mode dio --flash_freq 40m 0x1000 firmware.bin
 
```
 
```
  
- 在此之前需用户安装 python 与安装其依赖项 esptool ,例如`pip install esptool`
+
*Before this need users to install python and installing the dependencies esptool, such as ` PIP install esptool `
 
+
*esptool.py is ESP chip series of burn script tools
- esptool.py ESP 芯片系列的烧写脚本工具。
+
*`--chip esp32` is esp32 chip
 
+
*`--port COM3` COM3 is the name of a serial port in Windows and /dev/ttyusb0 in Linux.
- `--chip esp32` 指esp32芯片。
+
*`--baud 921600`,If a burn error occurs, it can be lowered to 460800, which will slow down the burn.
 
+
* `firmware.bin`,Refers to the location of a file that is burned. If there is no path, the default is the same directory.
- `--port COM3` 指烧写端口,COM3是Windows环境下的串口命名,在Linux下则是/dev/ttyUSB0。
+
*The others remain unchanged
 
 
- `--baud 921600`,如果出现烧写错误,可以下调到460800,这会导致烧写的速度下降。
 
 
 
- `firmware.bin`,指烧写文件的位置,如果没有路径则默认是同一目录下。
 
 
 
- 其他保持不变,如果有疑问向我们可以提出。
 
 
 
## 在 Python 解释器环境当中执行烧写*
 
 
 
- [AutoFlash.py](https://github.com/junhuanchen/AutoTools/blob/master/AutoFlash.py) 跟Linux的Shell一致,可在Py代码中查阅得知。
 
 
 
- [AutoErase.py](https://github.com/junhuanchen/AutoTools/blob/master/AutoErase.py) 是指擦除当前硬件的固件,当遇到无法解决的问题时候,可以尝试擦除。
 
  
# 烧写之后?
+
==Performs a burn in the Python interpreter environment==
  
- 烧写之后,如果烧写成功会如下图,否则会闪退或出现红色警告内容,等其他信息报告。
+
[https://github.com/junhuanchen/AutoTools/blob/master/AutoFlash.py AutoFlash.py] Consistent with the Linux Shell, you can see this in the Py code
  
- ![flash_finish](how_to_flash/flash_finish.jpg)
+
[https://github.com/junhuanchen/AutoTools/blob/master/AutoErase.py AutoErase.py] To erase the firmware of the current hardware. When you encounter a problem that cannot be solved, you can try to erase it.
  
# 出现问题?
+
=After burning?=
  
- 当不知道怎么解决的时候,请直接提交问题给我们进行解决。
+
After the burn, if the burn is successful will be as shown below, otherwise it will flash back or appear red warning content, and other information report.
  
- 如果没人提供解决方案,您也可以自己使用修复(擦除)工具后重新烧写固件。
+
[[File:Flash_finish.jpg]]
  
- 修复(擦除)工具执行成功之后结果的如下图。
+
=go wrong?=
  
- ![repair_finish](how_to_flash/repair_finish.jpg)
+
*if you do not know how to solve the problem, please directly submit the problem to us for solving.
 +
*if no one offers a solution, you can use the fix (erase) tool and re-burn the firmware yourself.
 +
*the result of successful execution of the repair (erasure) tool is shown below.
  
# 疑难解答
+
[[File:Repair_finish.jpg]]
  
## 烧写固件失败,烧写程序闪退,或结果出现 红色警告 。
+
=trouble shooting=
  
- 大多数原因是因为您的串口驱动存在问题,解决这个问题后可以再次尝试,如果出现了烧写错误,有可能是您的电脑正在使用多个串口导致识别错误的问题,请确保板子是最新插入的,否则不能自动识别并烧写,如果确定有这个问题也出现了烧写失败的情况,请更换至其他烧写的连接线,此时依旧烧写失败的话,请将板子寄给我们,我们将为您维修或更换。
+
==Write firmware failed, write program flash back, or the result appears red warning==
  
## 烧写成功?但是没有工作?
+
Most reason is that there was a problem with the serial port driver you can try again after the solution to this problem, if the burn write error, it is possible that your computer is using multiple serial ports, the issues that led to the identification error please ensure that the board is the latest inserted, otherwise cannot be automatically identify and burning, if sure have this problem have appeared in the burning failure situation, please change to other burning cables, at this time still burning fails, please send us the board, we will repair or replacement for you.
  
- 先确认线材,如果面板灯没有亮,有两种可能,一种是连接线材的问题(线比较差,供电不足),更换好一点的线就可以了,另一种是存在先前固件的问题,分区数据受损,需要擦除一次才可以,一般发生在先前烧过其他固件的时候,如果排除了这两种情况,就只能是电脑的问题,可以先检查一下驱动是否正常,没有感叹号,或者是更换电脑再试。
+
==Burned successfully? But not work?==
  
![logo](./logo.jpg)
+
Make sure wire, if the panel light is not bright, there are two possible, one is the problem of connection wire (line is poorer, insufficient power supply), replace the better line is ok, the other is a previous firmware problem, partition data is damaged, need to erase a can, generally occurred in previous burned other firmware, if ruled out in both cases, only is a computer problem, can first check whether the driver is normal, not an exclamation point, or change the computer to try again.

Latest revision as of 02:35, 21 February 2019

Overview: BPI-Bit





Try burning the board

Why burn the board?

burn is a term that used to be used to download programs to hardware. Now it's just an idiom.As long as we burn the tools, we can put the program we want to run in the hardware.

Prepare related tools

for example with windows 10,you need choose a image verison fromBPI:bitrelease,and download AutoErase.exe、AutoFlash.exe、firmware.bin and put it in the same directory

On other systems, you need to use the py script for the burn, which is autoerers.py and autoflash.py.

All tools.png

Finally, please ensure that the driver has been successfully installed and the board has been connected to the computer, you can continue to read the following content

Win check ch340.png

One key to write firmware

Erase the board firmware

it is recommended to erase the board once in the following situations.

  • first use of the firmware
  • other firmware existed before
  • the board operation is abnormal
  • when at a loss

In Windows system, for example, double-click to run autoeraser.Exe , which recognizes the serial port where the computer inserted the latest board and automatically erases the board, so you only need to make sure the board is the latest device to insert.

Erase succeed.png

the above is the successful erasure, if failed, please try again, still failed, please check or the serial port of the device.

2. Update the board firmware

it is recommended to update the board once in the following situations.

  • after erasing the board
  • firmware needs to be upgraded

in Windows, for example, double-click to run autoflash.exe . It will recognize the most recently inserted serial port of the board and automatically write all firmware files in the same directory to the board.

Flash succeed.png

The above is a successful burn, if the failure, please try again, still failed, please check or device serial port

Now that the burn is complete, you can move on to the next chapter 3 Hello, World!,If you have any other questions or want to know more, please read on.

Burn tool details

Use windows System

Run ` AutoFlash. Exe ` program will automatically find the latest inserted into the serial port and will be the same directory ` fimware. Bin ` file burn write to the chip of a key.

Auto flash running.png

Using ` AutoErase. Exe ` program firmware can be erased, if there are other firmware, or have a unsolvable problems, are available through the repair (erase) tool to reset the board after burning firmware, note that it will be the board all the file is deleted.

Auto erase running.png

The above procedure through related Python scripts and ` Pyinstller X86 ` module packaging

more than two tools support command line ` AutoErase. Exe - port COM4 - baud 115200 - port ` usage, specific can see below the configuration parameters are introduced.

Use linux system

Shell 
sudo esptool.py --chip esp32 --port COM3 --baud 1152000 write_flash -z --flash_mode dio --flash_freq 40m 0x1000 firmware.bin

```

  • Before this need users to install python and installing the dependencies esptool, such as ` PIP install esptool `
  • esptool.py is ESP chip series of burn script tools
  • `--chip esp32` is esp32 chip
  • `--port COM3` COM3 is the name of a serial port in Windows and /dev/ttyusb0 in Linux.
  • `--baud 921600`,If a burn error occurs, it can be lowered to 460800, which will slow down the burn.
  • `firmware.bin`,Refers to the location of a file that is burned. If there is no path, the default is the same directory.
  • The others remain unchanged

Performs a burn in the Python interpreter environment

AutoFlash.py Consistent with the Linux Shell, you can see this in the Py code

AutoErase.py To erase the firmware of the current hardware. When you encounter a problem that cannot be solved, you can try to erase it.

After burning?

After the burn, if the burn is successful will be as shown below, otherwise it will flash back or appear red warning content, and other information report.

Flash finish.jpg

go wrong?

  • if you do not know how to solve the problem, please directly submit the problem to us for solving.
  • if no one offers a solution, you can use the fix (erase) tool and re-burn the firmware yourself.
  • the result of successful execution of the repair (erasure) tool is shown below.

Repair finish.jpg

trouble shooting

Write firmware failed, write program flash back, or the result appears red warning

Most reason is that there was a problem with the serial port driver you can try again after the solution to this problem, if the burn write error, it is possible that your computer is using multiple serial ports, the issues that led to the identification error please ensure that the board is the latest inserted, otherwise cannot be automatically identify and burning, if sure have this problem have appeared in the burning failure situation, please change to other burning cables, at this time still burning fails, please send us the board, we will repair or replacement for you.

Burned successfully? But not work?

Make sure wire, if the panel light is not bright, there are two possible, one is the problem of connection wire (line is poorer, insufficient power supply), replace the better line is ok, the other is a previous firmware problem, partition data is damaged, need to erase a can, generally occurred in previous burned other firmware, if ruled out in both cases, only is a computer problem, can first check whether the driver is normal, not an exclamation point, or change the computer to try again.