Welcome, Guest

Author Topic: Clean shutdown of RT5350F?  (Read 1101 times)

shish

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Clean shutdown of RT5350F?
« on: February 24, 2018, 06:43:48 PM »
Hi!

I recently bought the RT5350F-OLinuXino-EVB and just started testing it. I came with OpenWrt Linux-3.18.19 pre-installed. (I have not altered it in any way.)

However, when I try to shut it off cleanly via the serial terminal using 'halt' or 'poweroff', it always reboots. No matter what arguments I use.

Anybody who knows how to do this? There is a little pause between the "System halted" message and the reboot, but to pull the power at that point seems a little "dangerous".

Log from using the 'halt' command:
Code: [Select]
root@OpenWrt:/# halt
root@OpenWrt:/# [  271.600000] br-lan: port 1(eth0.1) entered disabled state
[  271.620000] device eth0.1 left promiscuous mode
[  271.630000] br-lan: port 1(eth0.1) entered disabled state
[  271.650000] IPv6: ADDRCONF(NETDTV_UP): eth0.1: link is not ready
[  272.090000] device eth0 left promiscuous mode
[  275.990000] reboot: System halted

U-Boot 1.1.3 (Apr 20 2005 - 13:25:55)

Board: RT5350F-OLinuXino DRAM:  32 MB

relocate_code Pointer at: 81fb4000

******************************
Software System Reset Occurred
******************************

spi_wait_nsec: 42
spi device id: 1c 30 17 1c 30 (30171c30)
find flash: EN25Q64
raspi_read: from:30000 len:1000

.*** Warning - bad CRC, using default environment

=============================================================
RT5350F-OLinuXino UBoot Version: 4.0.0.0
--------------------------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Apr 20 2015  Time:13:25:55
============================================

icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384

 ##### The CPU freq = 360 MHZ ####
 estimate memory size =32 Mbytes

Please choose the operation:

   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.

3: System Boot system code via Flash.

## Booting image at bc050000 ...

raspi_read: from:50000 len:40

   Image Name:   MIPS OpenWrt Linux-3.18.19
   Created:      2015-08-24   6:49:42 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1084701 Bytes =  1 MB
   Load Address: 80000000
   Entry Point:  80000000

raspi_read: from:50040 len:108d1d

.................   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsizz in MB, 32

Starting kernel ...

[    0.000000] Linux version 3.18.19 (stefan@debian) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r45456) ) #7 Mon Aug 24 09:48:45 EEST 2015
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is RT5350F-OLINUXINO
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
.....

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: Clean shutdown of RT5350F?
« Reply #1 on: February 24, 2018, 07:21:07 PM »
At the least you can maybe interrupt U-Boot (hit a char such as space) and then power off.

John

shish

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Clean shutdown of RT5350F?
« Reply #2 on: February 24, 2018, 10:23:48 PM »
Thanks John! Unfortunately, it seems that pressing space (or any other character) does nothing to stop the (re)boot?

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: Clean shutdown of RT5350F?
« Reply #3 on: February 25, 2018, 06:57:59 PM »
That's very odd - I've never been unable to interrupt uboot (it's why it has the menu).

Problem with your lead/etc?

As to why it doesn't halt... read (*) the code?  It's why source is useful :)

(*) and I suppose fix

John

shish

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Clean shutdown of RT5350F?
« Reply #4 on: March 03, 2018, 09:05:15 PM »
It seems like this is a "feature" of OpenWRT:

https://forum.lede-project.org/t/poweroff-and-halt-commands-do-reboot-the-device-instead-of-halting/8971

https://bugs.openwrt.org/index.php?do=details&task_id=1400

And I believe it is the Watchdog that causes the reboot.

I'll solve this for the moment by hitting '4' during boot and enter "Boot Command Line Interface" and then power off:

Quote
=============================================================
RT5350F-OLinuXino UBoot Version: 4.0.0.0
--------------------------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Apr 20 2015  Time:13:25:55
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384

 ##### The CPU freq = 360 MHZ ####
 estimate memory size =32 Mbytes

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
 1
You choosed 4

 0
raspi_read: from:40028 len:6
.

4: System Enter Boot Command Line Interface.

U-Boot 1.1.3 (Apr 20 2015 - 13:25:55)
RT5350 #

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: Clean shutdown of RT5350F?
« Reply #5 on: March 04, 2018, 10:14:19 PM »
Horrors - they ought to fix it (and it's a bug that can be fixed despite their pathetic response).

Oh well, 4 it is :)

You can power it off then.

John