SPI ROM Update issue

I have BPI-M4 1 GB board and i have to update spiloader as it shows 2GB board. I went through the process mentioned here [https://download.banana-pi.dev/d/ca025d76afd448aabc63/files/?p=%2FImages%2FBPI-M4%2Flinux-spiloader%2FLinux%20-%20How%20to%20build%20and%20flash%20spirom.pdf]

But USB START command resets the board repeatedly. I have usb disk drive formatted with FAT32 with spiloader-1GB.bin file

Does your board spirom must be updated? upload the full uart debug log from power on.

I tried with multiple OS images on sd card, but I was unable to display HDMI output, also to load new version of OS it is mentioned that i must update the spirom. Here is the log.

C1:80000000
C2
?_?
C3h
hwsetting size: 00000950
C4
f
5-5
Goto FSBL: 0x80008000
Welcome to FSBL ....

REG32(VO_SW_SEC_1)=01C00000
[FSBL] Secure: 0x0000BEEE
[FSBL] DCache Enable: 0x00000000
[FSBL] SVP = N
********** FW_TYPE_BOOTCODE **********
    FW Image to 0x00100000, size=0x000841E0 (0x001841E0)
    FW Image fr 0x881313E8
kmcp_bypass copy audio bin
FSBL: plat_gic_setup
FSBL: plat_gic_setup_percpu
FSBL Jumps to LK


U-Boot 2015.07 (May 27 2019 - 09:38:38 +0800)

CPU  : Cortex-A53 Quad Core - AARCH64
Board: Realtek QA Board
DRAM:  2 GiB
Watchdog: Disabled
mapping memory 0x20000000-0x40000000 non-cached
flushing dcache successfully.
nor flash id [0x00ef4018]
sector 256k en: 0
sector  64k en: 1
sector  32k en: 1
sector   4k en: 1
page_program  : 1
max capacity  : 0x01000000
spi type name : WINBOND_W325Q128BV_128Mbit
MMC:   Initialize eMMC in traditional mmc flow.
RTD1395 eMMC: 0
rsp[0]=0x15010038,
                       rsp[1]=0x47544634,
                       rsp[2]=0x5206598c,
                       rsp[3]=0x437c5627
The cid_val is 15.
rsp[0]=0xd0270132,
                       rsp[1]=0x0f5903ff,
                       rsp[2]=0xf6dbffef,
                       rsp[3]=0x8e40400d
mmc->version=0x40000000
version=0x00000004
[LY] cardtype=57, mmc->card_caps=0f
[LY] freq = 00464388, clk diver = 00000080
[LY] speed up emmc at HS-200
[LY] HS-200 bus width=2
[LY] mmc->boot_caps = 20b
TEMP TX_WINDOW=0xfffffffb, TX_best=0x12
RX_WINDOW=0xfffff03f, RX_best=0x18
TX1_WINDOW=0xfffffff8, TX_best=0x11
[LY] hs200 : 0
[HC] ERASE Unit Size = 524288 bytes
[HC] WPG_SIZE = 8388608 bytes
Device: RTD1395 eMMC
Manufacturer ID: 15
OEM: 100
Name: 8GTF4
Tran Speed: 200000000
Rd Block Len: 512
MMC version 4.0
High Capacity: No
Capacity: 7.3 GiB
User Capacity: 7.3 GiB
Boot Capacity: 4 MiB
RPMB Capacity: 512 KiB
Bus Width: 8-bit
Speed: HS200
SD:
SD device index# 0
Factory: SD
------------can't find tmp/factory/000BootParam.h
[ENV] read_env from factory failed
Using default environment

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
get_partition_info_efi: *** ERROR: Invalid GPT ***
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
get_partition_info_efi: *** ERROR: Invalid Backup GPT ***
------------can't find tmp/factory/hdmitx_format.bin
------------can't find tmp/factory/video_rpc.bin
tv_system=25 mode=1
Net:   Realtek PCIe GBE Family Controller mcfg = 0024
dev->name=r8168#0
Checking default environment
Hit Esc or Tab key to enter console mode or rescue linux:  0
------------can't find tmp/factory/recovery
------------finished reboot_action
======== Checking into android recovery ====

==== start load bootcode from SD =====
SD: try to boot from eMMC
CMD[fatload mmc 0:1 0x00030000 /bananapi/bpi-m4/linux/u-boot-bpi-m4.bin]
** No partition table - mmc 0 **
*No partition table, try part 0 again!
*** Unrecognized filesystem type **
CMD[fatload mmc 0:1 0x00030000 u-boot-bpi-m4.bin]
** No partition table - mmc 0 **
*No partition table, try part 0 again!
*** Unrecognized filesystem type **
CMD[rtkemmc read 0x00030000 0x50 0x430]
[WARNING] bootcode seem is not valid, first 4 bytes:
          00 00 00 00
Enter console mode, disable watchdog ...
BPI-M4(SPI)> usb start
starting USB...
rtk_usb_power_on:209: Realtek-usb: UFP cc1 detect type_c have power (status=0x3)
USB0:   Register 1000140 NbrPorts 1
Starting the controller
USB XHCI 1.10
scanning bus 0 for devices... Unknown request , typeReq = 0x200c
1 USB Device(s) found
USB1:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus 1 for devices... Unknown request , typeReq = 0x200c
unknown Description Type : b
BUG: failure at drivers/usb/host/xhci-mem.c:230/xhci_malloc()!
BUG!
resetting ...

Please flash the latest Linux images 2020-05-18 version to your sdcard, and upload the full debug log if still bootup fail.

http://wiki.banana-pi.org/Banana_Pi_BPI-M4#Linux_Images

Here is the boot log for Raspbian stretch 2020-05-18 image. The boot hanged. boot_log_raspbian_stretch_2020-05-18_m4.log (67.1 KB)

Try to flash the spirom with 2020-05-18 image again,

by the way, please take a photo of the board top.

Screenshot%20from%202021-05-26%2017-32-29

I had the same issue. You can update SPI by SD card, thus avoiding USB error.

Simplified solution:

0.) Check if your device really need an update (https://download.banana-pi.dev/d/ca025d76afd448aabc63/files/?p=%2FImages%2FBPI-M4%2Flinux-spiloader%2FLinux%20-%20How%20to%20build%20and%20flash%20spirom.pdf)

1.) Write image to your sd card (I used 2020-05-18-ubuntu-16.04-server-bpi-m4-aarch64-sd-emmc.img.zip image)

2.) Write spiloader-1GB.bin to first partition of SD card in the main directory.

3.) Run bananapi, press multiple times CTRL+C to interrupt booting (minicom on linux)

4.) run commands:

fatload sd 0:1 0x01500000 spiloader-1GB.bin

go 0x01500000

5.) After a minute of programming, reboot will perform and new images should boot up.

image