Samsung Galaxy J7 Prime (samsung-on7xelte)

From postmarketOS Wiki
Samsung Galaxy J7 Prime
J7 Prime running GNOME Mobile
J7 Prime running GNOME Mobile
Manufacturer Samsung
Name Galaxy J7 Prime
Codename samsung-on7xelte
Released 2016
Type handset
Hardware
Chipset Samsung Exynos 7870 Octa
CPU Octa-core 1.6 GHz Cortex-A53
GPU Mali-T830 MP1
Display 1080 x 1920 PLS IPS
Storage 32 GB
Memory 3 GB
Architecture aarch64
Software
Original software Android
Original version 6.0.1
Extended version 8.1
postmarketOS
Category testing
Pre-built images no
Mainline yes
Features
Flashing
Works
USB Networking
Works
Internal storage
Works
SD card
Works
Battery
Partial
Screen
Partial
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Broken
Camera
Broken
Camera Flash
Broken
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Broken
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
Miscellaneous
FDE
USB OTG
Sensors
Accelerometer
Works
Ambient Light
Works
Proximity
Works
Haptics
Works


Samsung Galaxy J7 Prime, also known Samsung Galaxy On Nxt and Samsung Galaxy On7 Prime, is an Exynos 7870 device released by Samsung in 2016.

Contributors

  • naproxen

Users owning this device


How to enter flash mode

When the phone is powered off, hold the Power, Home and Volume Down buttons to boot into download mode. A turquoise colored screen will appear, asking for confirmation. Press Volume Up to confirm. Your device is ready for flashing via a front-end such as Odin or Heimdall.

To boot into recovery, hold the Power, Home and Volume Down buttons.

Installation

Prerequisites

Make sure your phone:

  • Has its bootloader unlocked.

Preparation

Choose the following in the pmbootstrap init wizard:

Vendor: samsung
Device codename: on7xelte

To proceed with the installation run:

$ pmbootstrap install

This will begin preparing your installation in your host computer.

Flashing

After the installation process is completed, get your phone booted into download mode, Then run:

$ pmbootstrap flasher flash_kernel

The kernel gets flashed to your device. Now, the device will reboot automatically. Hold the key combination to reboot into download mode. Then run:

$ pmbootstrap flasher flash_rootfs

The rootfs is flashed and the device gets rebooted. It should reboot to postmarketOS now.

Notice If there are any problems with flashing the rootfs via Heimdall, you may attempt an installation via recovery.

Partial features

Battery

The fuelgauge driver (reports the charge percentage) works fine, but there's no charger driver which is responsible for reporting charge status and control.

Screen

Display works with simple-framebuffer, so brightness control is non-functional. Samsung DECON/DSIM driver for Exynos 7870 is a work-in-progress, which will properly initialize and use the display.

Problems

USB Networking

At least on some operating systems, the host doesn't receive network packets from the device, unless the host sends packets to the device. Due to this behavior, SSH (among other things) doesn't work well. A workaround is to have ping -Aq <IP> run in the background while you interact with the device (replace <IP> with the device IP address).

Wi-Fi

Wi-Fi behaves very erratically (practically unusable) when the SDIO is probed in DMA mode. The driver fails to communicate with the SDIO, reporting timeout errors. As a workaround, the SDIO is forced to be probed in PIO mode.

Debugging (retrieving kernel logs)

Serial UART

As with most Samsung devices, UART is exposed in the micro-USB connector of the device, a resistance is applied between the ID and GND pins, which makes it switch to UART mode. More information is provided at this article about serial debugging.

The VCC voltage level is 3.3V, and the multiplexing resistance for UART is 150kΩ (±1% is acceptable).

You also need to change the cmdline arguments provided to the kernel. This is managed by S-BOOT, Samsung's proprietary primary bootloader. Sadly, S-BOOT forces its arguments over ones which could be possibly set by postmarketOS. There's a way to refuse bootloader arguments from the kernel, but it does more harm than good.

Connect the host and the device using the USB-TTL adapter, and open up a modem terminal emulator (for instance, minicom). Boot the phone by holding Power. When the bootloader starts printing logs, start spamming the enter key. This will abort autoboot and S-BOOT's console will open.

Notice It may happen that the bootloader output is cut off, but booting has paused and input keystrokes are reflected in the terminal. In that case, it's safe to consider that S-BOOT's console has been opened.
S-BOOT # printenv

This command will print all environment variables in S-BOOT. You should find such a variable called CMDLINE, which defaults to console=ram loglevel=4. We're supposed to edit this to redirect the console path to the UART device. To set the variable:

S-BOOT # setenv CMDLINE console=ttySAC2,115200

The variable can also be saved, so that the change remains persistent.

S-BOOT # saveenv

Now, you may resume booting by:

S-BOOT # load_kernel
S-BOOT # boot

Note that this will display a warning about CMDLINE being changed in the bootloader logs and the screen. It will stay until it's reverted.

Persistent store

Kernel logs are also exposed via ramoops. The downstream kernel uses ramoops only during panics. The mainline kernel uses the same memory region to store generic logs.

From recovery, the kernel logs can be found in /sys/fs/pstore/dmesg-ramoops-0. S-BOOT passes loglevel=4 in the kernel's cmdline (see here), so only warnings and errors (and worse) are logged.

Downstream kernel

A port based on the downstream kernel exists which has been archived in favor of the mainline kernel. More information is available in older revisions of this page.

See also

pmaports!4220 Initial merge request

pmaports!4980 (Downstream → Mainline)

Device package

Kernel package