README.md
1# **nuwriter_scripts**
2
3Some scripts can help you program firmware into storages in this folder.
4
5## **Requirement**
6
7### [Python3 for Window](https://www.python.org/downloads/windows/)
8
9After installing Python3, some plug-in as below must be installed.
10
11```bash
12pip3 install pyusb usb crypto ecdsa crcmod tqdm pycryptodome
13```
14
15Notice:
16
17- Tested python3 version is 3.10.1.
18- Please remember to add Python to PATH environment variable.
19
20### [Libusb for Window](http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.20/libusb-1.0.20.7z/download)
21
22On Windows platform, it is required to install libusb manually.
23
24```bash
25Step 1: Download the library extract the download file.
26Step 2: Copy MS64\dll\libusb-1.0.dll to C:\Windows\System32.
27Step 3: Copy MS64\dll\libusb-1.0.lib to C:\Users\<user name>\AppData\Local\Programs\Python\<python ver>\Lib.
28```
29
30### [USB Driver for Window](https://github.com/OpenNuvoton/MA35D1_NuWriter/blob/master/driver/WinUSB4NuVCOM.exe?raw=true)
31
32NuWriter must install **WinUSB4NuVCOM.exe** on the computer.
33
34## **Double-click Scripts for Windows**
35
36If your NuWriter_MA35 python running is ready, you can do following batch script files for Window directly.
37
38### **nuwriter_ddr2_128mb_download_and_run.bat** or **nuwriter_ddr3_512mb_download_and_run.bat**
39
40Download rtthread.bin binary file into DDR. The address is 0x80400000.
41
42### **nuwriter_sd_programming.bat**
43
44Program header, DDR timing setting and rtthread.bin binary file into SD card or EMMC.
45
46### **nuwriter_spinand_programming.bat**
47
48Program header, DDR timing setting and rtthread.bin binary file into SPI NAND flash.
49
50### **nuwriter_nand_programming.bat**
51
52Program header, DDR timing setting and rtthread.bin binary file into NAND flash.
53
54## **Troubleshoot**
55
56### **Fail to create symbolic folder**
57
58```bash
59Create symbolic folder conv failed
60```
61
62- To switch **Developer Mode** in Window. To enter [Settings], [Update & Security], [For developers], [Developer Mode] page, then set it **On**
63- Use **Administrator** permission to install python3, libusb and utilities.
64
65### **Use NuWriter_MA35.exe**
66
67Due to the python execution file size and saving network bandwidth, we just only release the python code in this repository. We also provide [NuWriter_MA35.exe](https://github.com/OpenNuvoton/MA35D1_NuWriter/blob/master/EXE/NuWriter_MA35.exe?raw=true) python execution. You can run the packaged app without installing a Python interpreter or any modules. You can use **NuWriter_MA35.exe** and do some modification.
68
69```bash
70To modify "py -3 nuwriter.py" to "NuWriter_MA35.exe"
71```
72
73For example, the **nuwriter_ddr_download_and_run.bat** modification is as following:
74
75```bash
76:forever_develop
77NuWriter_MA35.exe -a ddrimg\enc_ddr3_winbond_256mb.bin
78IF %ERRORLEVEL% EQU 0 (
79 NuWriter_MA35.exe -o execute -w ddr 0x80400000 ..\rtthread.bin
80)
81pause
82goto :forever_develop
83```
84
85## **See also**
86
87[NuWriter Repository](https://github.com/OpenNuvoton/MA35D1_NuWriter)
88