Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1 - "reboot" does not make the device boot once is re-starts #25

Open
mikegleasonjr opened this issue Sep 28, 2020 · 13 comments
Open

v1 - "reboot" does not make the device boot once is re-starts #25

mikegleasonjr opened this issue Sep 28, 2020 · 13 comments

Comments

@mikegleasonjr
Copy link

mikegleasonjr commented Sep 28, 2020

I have to unplug and re-plug the device for it to boot up again.

Same thing happens with Armbian.

@mikegleasonjr mikegleasonjr changed the title v1 - "reboot v1 - "reboot" does not make the device boot once is re-starts Sep 28, 2020
@avafinger
Copy link
Owner

@avafinger
Copy link
Owner

See these interesting findings
Yesterday i made an Image with 5.9.0-rc6 with a new SD CARD (high speed 32 GB) while I still have one SD CARD with 8GB with the fix for the reboot using the same kernel.

With the 8GB SD CARD, i have no problems rebooting many times.
With the 32 GB SD CARD, i can see a new issue with u-boot:

Rebooting with 32 GB SD CARD:

U-Boot TPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 23:09:21)               
Channel 0: DDR3, 933MHz                                                         
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB                         
Channel 1: DDR3, 933MHz                                                         
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=102456B stride                 
Trying to boot from BOOTROM                                                     
Returning to boot ROM...                                                        
                                                                                
U-Boot SPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 23:09:00)               
Trying to boot from MMC1                                                        
mmc_load_image_raw_sector: mmc block read error                                 
Trying to boot from MMC2                                                        
mmc_load_image_raw_sector: mmc block read error                                 
Trying to boot from MMC1                                                        
mmc_load_image_raw_sector: mmc block read error                                 
SPL: failed to boot from all boot devices                                       
### ERROR ### 

Rebooting with 8 GB:

U-Boot TPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 23:09:21)               
Channel 0: DDR3, 933MHz                                                         
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB                         
Channel 1: DDR3, 933MHz                                                         
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB                         
256B stride                                                                     
Trying to boot from BOOTROM                                                     
Returning to boot ROM...                                                        
                                                                                
U-Boot SPL 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 23:09:21 +0000)         
Trying to boot from MMC1                                                        
                                                                                
                                                                                
U-Boot 2020.10-rc3-00012-g9f04a634ef (Aug 29 2020 - 23:09:21                    
                                                            Model: FriendlyElec4
2 GiB                                                                           
PMIC:  RK808                                                                    
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0                      
Loading Environment from MMC... Card did not respond to voltage select!         
*** Warning - No block device, using default environment                        
                                                                                
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Model: FriendlyElec NanoPi M4           

I can vaguely remember some discussions about issues with SD CARD voltage for some SD CARDs models, the kernel I used is vanilla 5.9.0-rc6 and now 5.9.0-rc7. Maybe this is the issue above, don't know if the patch is applied, or this patch is upstream now and is the one to blame. I think Armbian had a thread about it.

@avafinger
Copy link
Owner

Ok, i think i found a workaround for this.
I will build a new Image and in case you still have problems with reboot you can use this Image.

@avafinger
Copy link
Owner

I had to rebuild the Image with old gcc, gcc-10 gives some weird results.
I have tested it in all my SD CARDS with success.
Try this and give some feedback: https://github.com/avafinger/nanopi-m4-ubuntu-base-minimal/releases/tag/v1.39

@mikegleasonjr
Copy link
Author

Thanks, I will try it... I have the 4GB version can I still use it?

@avafinger
Copy link
Owner

Humm,not with this Image, it is for 8GB minimum, I will provide a way to install it if you have a Linux box. But you can mount the 8GB in your Linux box e resize it to 4 GB, but the Image after installed occupies 3.5 GB due to gcc and dev tools.
You can always mount it, chroot to it, and remove the páckages to free additional space.

@mikegleasonjr
Copy link
Author

No I meant the 4GB RAM version :)

@avafinger
Copy link
Owner

No boot on 4 GB, just need the u-boot for 4GB version. I will build one.

@avafinger
Copy link
Owner

avafinger commented Sep 30, 2020

I don't know why it does not initialize DRAM on the 4GB. I have compiled the u-boot 4G version that loads lpddr 4G but get error on DRAm init.

Attached is a working bootloader for 2GB and 4GB DRAM (nanopi m4 v1) If you have a Linux box you can flash the 2G Image file and write the new bootloader. I thought the 4GB version of the u-boot was for DDR4 but it loads lpddr3 timings.

But anyway, the shutdown and reboot work for both, 2GB and 4GB NanoPi M4 v1.

instructions

  • Download the attached file and unzip in your PC (Linux) or if you have a board (any board) where you can mount the SD CARD (the 2GB Image file) or just insert into the free sd card slot and you can write the bootloader to the SD CARD using the command:

  • find the mmcblk or sd block where the SD CARD is,

  • write the boot loader as the instructions

      sudo dd if=./idbloader.img of=/dev/sdX seek=64 conv=notrunc
      sync
      sudo dd if=./u-boot/trust.img of=/dev/sdX seek=24576 conv=notrunc
      sync
      sudo dd if=./uboot.img of=/dev/sdX seek=16384 conv=notrunc
      sync
      
      where X is the block letter from a to d
      
      
      sudo dd if=./idbloader.img of=/dev/mmcblkY seek=64 conv=notrunc
      sync
      sudo dd if=./u-boot/trust.img of=/dev/mmcblkY seek=24576 conv=notrunc
      sync
      sudo dd if=./uboot.img of=/dev/mmcblkY seek=16384 conv=notrunc
      sync
      
      where Y is the block number from 1 to 3
    

use df -lh to find out where the SD CARD is.
u-boot.tar.gz

@avafinger
Copy link
Owner

Boot log from a 4GB NanoPi M4 v1:
MR11=0x1F
MR12=0x1F
MR13=0x1F
MR14=0x1F
MR15=0x1F
MR16=0x1
MR3=0x58
MR4=0x2
MR5=0x1
MR6=0x5
MR7=0x0
MR8=0x1F
MR9=0x13=0x1F
MR14=0x1F
MR15=0x1F
MR16=0x1F
Bus Width=32 Col=10 Bas-Width=32 Size=2048MB
Channel 1: LPDDR3, 800MHz
CS = 0
MR0=0
MR5=0x1
MR6=0x5
MR7=0x0
MR8=0x1F
MR9=0x1F
MR10=0x1F
MR11
MR15=0x1F
MR16=0x1F
CS = 1
MR0=0x58
MR1=0x58
MR2=0x58
MRx0
MR8=0x1F
MR9=0x1F
MR10=0x1F
MR11=0x1F
MR12=0x1F
MR13=0xBus Width=32 Col=10 Bank=8 Row=15/15 CS=2 Die Bus-Width=32 Size=ch 0 ddr0
ch 1 ddrconfig = 0x101, ddrsize = 0x2020
Boot1 Release Time: Dec 24 2019 18:00:26, version: 1.24
CPUId = 0x0
ChipType = 0x10, 333
mmc: ERROR: SDHCI ERR:cmd:0x102,stat:0x18000
mmc: ERROR: Card did not respond to voltage select!
emmc reinit
mmc: ERROR: SDHCI ERR:cmd:0x102,stat:0x18000
mmc: ERROR: Card did not respond tmmc: ERROR: SDHCI ERR:cmd:0x102,stat:0x18000
mmc: ERROR: Card d
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=7704MB
FwPartOffset=2000 , 0
StorageInit ok = 45301
SecureMode = 0
SecureInit read PBA: 0x4
SecureInit read PBA: 0x404
SecureInit read PBA: 0x804
SecureInit read PBA: 0xc04
SecureInit read PBA: 0x1004
SecureInit read PBA: 0x1404
SecureInit read PBA: 0x1804
SecureInit read PBA: 0x1c04
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT 0x3380ea0 signature is wrong
recovery gpt...
GPT 0x3380ea0 signature is wrong
recovery gpt fail!
LoadTrust Addr:0x4000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 2000
Load OK, addr=0x200000, size=0xb0348
RunBL31 0x40000 @ 148628 us
NOTICE: BL31: v1.3(release):57824cc
NOTICE: BL31: Built : 10:59:12, Jan 6 2020
NOTICE: BL31: Rockchip release version: v1.1
INFO: GICv3 with legacy support detected. ARM GICV3 driverINFO: Using opt!
INFO: boot cpu mask: INFO: plat_rockchip_pmu_init(1190): pd status 3e
INFO: BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE iniK
ERROR: Error initializing runtime service opteed_fast
INFO Entry point address = 0x200000
INFO: SPSR = 0x3c9

U-Boot 2020.07-00703-g3b33eff3f2 (Jul 16 2020 - 11:44:44 -0300)                 
                                                                                
SoC: Rockchip rk3399                                                            
ResModel: FriendlyElec NanoPi M4                                                
DRAM:  3.9 GiB                                                                  
PMIC:  RK808                                                                    
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0                      
Loading Environment from MMC... Card did not respond to voltage select!         

@avafinger
Copy link
Owner

@avafinger
Copy link
Owner

Did it work for you?

@mikegleasonjr
Copy link
Author

Hi, thank you very much for all the work, this is really appreciated! Will try tonight as I haven't had the time yet to try.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants