FAQ_MA35_Family_SWriter Guide USBH to NAND with NonOS

Post Reply
ytliu6
Posts: 97
Joined: 08 Nov 2022, 10:28

08 May 2024, 18:47

Nuvoton provides another method to program firmware into MA35 device.
This guide will lead you how to use SWriter to program MA35 device from SD1 to NAND.

Download SWriter from Nuvoton official website
https://www.nuvoton.com/resource-downlo ... ot-series/

Step 1.
Check the MA35D1 device layout if it can power USBH controller by IBR
The partial layout diagram is shown below
FAQ_MA35_Family_SWriter Guide USBH to NAND with NonOS.png
FAQ_MA35_Family_SWriter Guide USBH to NAND with NonOS.png (38.98 KiB) Viewed 321 times
Step 2.
Copy NuWriter_MA35.exe into “make-usbh-msc” folder

Step 3.
Choose the appropriate DDR image and alter the pack.json file. Take NuMaker-HMI-MA35D1 with 512MB for instance.

Code: Select all

{
    "image": [
        {
            "offset": "0x0",
            "file": "writer_MBR.bin",
            "type": 0
        },
        {
            "offset": "0x400",
            "file": "conv/header.bin",
            "type": 0
        },
        {
	    "offset": "0x1000",
	    "file": "ddrimg/enc_ddr3_winbond_512mb.bin",
	    "type": 0
        },
        {
            "offset": "0x3000",
            "file": "otp_writer.bin",
            "type": 0
        },
        {
            "offset": "0x5000",
            "file": "usbh_writer.bin",
            "type": 0
        }
    ]
}
Step 4.
Choose the appropriate DDR image and alter the pack.json file. Take NuMaker-IoT-MA35D1 with 512MB for instance.

Code: Select all

{
    "header": {
        "version": "0x20221124",
        "spiinfo": {
            "pagesize": "0",
            "sparearea": "0",
            "pageperblk": "0",
            "quadread": "0x00",
            "readsts": "0x00",
            "writests": "0x00",
            "stsvalue": "0x00",
            "dummy1": "0",
            "dummy2": "0",
            "suspintvl": "0"
        },
        "secureboot": "no",
        "entrypoint": "0x81000000",
        "image": [
        	  {
              "offset": "0x1000",
              "loadaddr": "0x28030000",
              "type": "2",
              "file": "ddrimg/enc_ddr3_winbond_512mb.bin"
            },
            {
                "offset": "0x3000",
                "loadaddr": "0x28000000",
                "type": "3",
                "file": "otp_writer.bin"
            },
            {
                "offset": "0x5000",
                "loadaddr": "0x81000000",
                "type": "4",
                "file": "usbh_writer.bin"
            }
        ]
    }
}
Step 5.
Use NuWriter_MA35 convert mode and pack mode to generate a new package for MA35 device.
You can also use a bat file and the content is shown below

Code: Select all

NuWriter_MA35.exe -c header.json
NuWriter_MA35.exe -o stuff -p pack.json
pause
Step 6.
NonOS image needs to pack header.bin, so we need to use NuWriter_MA35 to generate header.bin.
You can use NuWriter_MA35_UI or command to generate header.bin and the JSON file is shown below.

Code: Select all

{
    "header":
    {
        "version": "0x20210120",
        "spiinfo":
        {
            "pagesize": "2048",
            "sparearea": "64",
            "pageperblk": "64",
            "quadread": "0x6B",
            "readsts": "0x05",
            "writests": "0x01",
            "stsvalue": "0x02",
            "dummy1": "0",
            "dummy2": "1",
            "suspintvl": "1"
        },
        "secureboot": "no",
        "entrypoint": "0x80400000",
        "aeskey" : "5E76953BF598581F925B7995157844747FABE669ABF000345E0EE21B63624D59",
        "ecdsakey": "5E76953BF598581F925B7995157844747FABE669ABF000345E0EE21B63624D59",
        "image":
        [
            {
              "offset": "0xC0000",
              "loadaddr": "0x28030000",
              "type": "2",
              "file": "enc_ddr3_winbond_512mb.bin"
            },
            {
		"offset": "0xE0000",
		"loadaddr": "0x80400000",
		"type": "4",
		"file": "GPIO_PowerDown.bin"
 
            }
        ]
    }
}
NuWriter_MA35 command is shown below

Code: Select all

NuWriter_MA35.exe -c header-nand.json
Step 7.
Prepare a USB pen drive and format it
Use Linux dd command or Windows programming tools to write the pack.bin into MA35D1 device

Step 8.
Make sure the image you prepare to programming is for the specific Flash
For example, the image which booting from SD0 can not be programed into SD1. You must clean whole image and rebuild a new one for SD1.


Step 9.
Duplicate all MA35D1 image files, along with the "config" file found in the MA35D1_SWriter_V1.01\Release\disk-content path. Verify that the file names match the one specified in the "config" file.
Below “config” shows that program files into SD/eMMC
Please input suitable parameters into the row TYPE, FLASH, and NAND_FLASH if you plan on programming an image into NAND. If the NAND Flash have been already in the table read by CPU, no need to input it.
The file programming addresses can be refer to pack.json in your image output/nuwriter folder.
config.7z
(509 Bytes) Downloaded 9 times
Step 10.
Switch power on setting PG0, PG2, PG3, PG4 and PG5 to High, insert USB pen drive, and reset MA35 device. The result will be shown as below

Code: Select all

MA35D1 IBR 20211029
RTC power on
USBH Boot
USB Mass Storage device found.
header0 CRC OK!
Do DDR setting
TSI Connected
finish
TSI Reset... done
TSI Sync, connected!
Load TSI image... done
 
 
===============================================
         NuMaker Board Flash Writer
===============================================

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest