| Welcome, Guest |
You have to register before you can post on our site.
|
| Latest Threads |
Booting Issues
Forum: PineNote Software
Last Post: d2minik
Yesterday, 12:44 PM
» Replies: 22
» Views: 16,101
|
Window Maker Live for Pin...
Forum: Linux on Pinebook Pro
Last Post: vajak
12-24-2025, 06:00 AM
» Replies: 2
» Views: 385
|
Rrkisp issue with CSI cam...
Forum: Linux on Quartz64
Last Post: lystar
12-24-2025, 02:34 AM
» Replies: 1
» Views: 3,765
|
bookworm vs trixie discus...
Forum: Mobian on PinePhone
Last Post: Kevin Kofler
12-24-2025, 12:11 AM
» Replies: 80
» Views: 45,631
|
Fedora + Phosh for PinePh...
Forum: PinePhone Software
Last Post: shanehill@mail.com
12-23-2025, 09:12 PM
» Replies: 75
» Views: 201,009
|
Trixie - bring up the On ...
Forum: Mobian on PinePhone
Last Post: grump_fiddle_reinstall
12-23-2025, 04:34 AM
» Replies: 0
» Views: 82
|
On-Screen Keyboard Arrow ...
Forum: Mobian on PinePhone
Last Post: grump_fiddle_reinstall
12-23-2025, 04:25 AM
» Replies: 11
» Views: 6,082
|
Armbian has been released...
Forum: News
Last Post: ArmbianForSBCs
12-23-2025, 01:36 AM
» Replies: 21
» Views: 32,326
|
Alarm clock doesn’t work
Forum: Mobian on PinePhone
Last Post: biketool
12-23-2025, 12:12 AM
» Replies: 14
» Views: 24,448
|
Diagnosing and fixing fai...
Forum: PinePhone Pro Software
Last Post: biketool
12-22-2025, 11:59 PM
» Replies: 7
» Views: 626
|
|
|
| Zephyr Backlight Examples for PineTime |
|
Posted by: lcj - 05-06-2023, 02:54 PM - Forum: Development Discussion on PineTime
- No Replies
|
 |
This is a very junior question but I am just trying to get the backlight going using Zephyr, VS Code (with nRF Connect for VS Code Add-In), the PineTime DevKit0 board in Zephyr, and a PineTime DK.
I am trying to figure out how to do the backlight from the button example (which replaced the board specific example). I have not been able to get it working. It uses code like this:
Code: static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios,
{0});
static struct gpio_callback button_cb_data;
/*
* The led0 devicetree alias is optional. If present, we'll use it
* to turn on the LED whenever the button is pressed.
*/
static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios,
{0});
void button_pressed(const struct device *dev, struct gpio_callback *cb,
uint32_t pins)
{
printk("Button pressed at %" PRIu32 "\n", k_cycle_get_32());
}
void main(void)
{
int ret;
if (!device_is_ready(button.port)) {
printk("Error: button device %s is not ready\n",
button.port->name);
return;
}
ret = gpio_pin_configure_dt(&button, GPIO_INPUT);
if (ret != 0) {
printk("Error %d: failed to configure %s pin %d\n",
ret, button.port->name, button.pin);
return;
}
ret = gpio_pin_interrupt_configure_dt(&button,
GPIO_INT_EDGE_TO_ACTIVE);
if (ret != 0) {
printk("Error %d: failed to configure interrupt on %s pin %d\n",
ret, button.port->name, button.pin);
return;
}
...
}
These other examples:
pinetime-zephyr/main.c at master · najnesnaj/pinetime-zephyr · GitHub
[/url][url=https://github.com/albsod/pinetime-hypnos/blob/master/app/hypnos/src/backlight.c]pinetime-hypnos/backlight.c at master · albsod/pinetime-hypnos · GitHub
pinetime/backlight.c at develop · ck-telecom/pinetime · GitHub
Use code which looks like this:
Code: #if DT_NODE_HAS_STATUS(LED0_NODE, okay)
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
#define PIN DT_GPIO_PIN(LED0_NODE, gpios)
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
#endif
static void backlight_init(void)
{
const struct device *dev;
dev = device_get_binding(LED0);
/* If you have a backlight, set it up and turn it on here */
gpio_pin_configure(dev, PIN, GPIO_OUTPUT_ACTIVE | FLAGS);
gpio_pin_set(dev, PIN, 1);
}
or this:
Code: /* ********** ********** DEFINES ********** ********** ********** */
#define BACKLIGHT_PORT DT_GPIO_LABEL(DT_ALIAS(led1), gpios)
#define BACKLIGHT_1 DT_GPIO_PIN(DT_ALIAS(led0), gpios)
#define BACKLIGHT_2 DT_GPIO_PIN(DT_ALIAS(led1), gpios)
#define BACKLIGHT_3 DT_GPIO_PIN(DT_ALIAS(led2), gpios)
/* ********** ********** ********** ********** ********** */
/* ********** ********** VARIABLES AND STRUCTS ********** ********** */
static const struct device* backlight_dev;
static bool backlight_enabled = false;
/* ********** ********** ********** ********** ********** ********** */
/* ********** ********** FUNCTIONS ********** ********** */
void backlight_init()
{
backlight_dev = device_get_binding(BACKLIGHT_PORT);
gpio_pin_configure(backlight_dev, BACKLIGHT_1, GPIO_OUTPUT);
gpio_pin_configure(backlight_dev, BACKLIGHT_2, GPIO_OUTPUT);
gpio_pin_configure(backlight_dev, BACKLIGHT_3, GPIO_OUTPUT);
backlight_enable(true);
LOG_DBG("Backlight init: Done");
}
I guess my questions is should I try to use the GPIO_DT_SPEC_GET_OR syntax or DT_GPIO_PIN, DT_GPIO_LABEL, and DT_GPIO_FLAGS.
I'm really new at this, as you can probably tell. I might be mixing things up. Trying to figure out the GPIO to turn on/off the backlight and it seems like this commonly/historically used device* structure and the gpio_dt_spec from the examples.
|
|
|
|
Star64 |
|
Posted by: cpnetserver - 05-05-2023, 01:04 AM - Forum: General
- No Replies
|
 |
Hi guys!
Does anyone know when new BXE-4-32 GPU drivers will be available for Linux Kernel 6.x?
Thanks for reply.
|
|
|
|
| SMS not delivered if receiver offline at sending time |
|
Posted by: alpineduck - 05-03-2023, 05:48 PM - Forum: General Discussion on PinePhone
- Replies (14)
|
 |
Hello,
I've been using the PinePhone regularly for about half a year. Calls and SMS have been reliable, with the notable exception of the following problem that I would like to understand, and hopefully solve:
If I send a SMS to a phone that's offline, the expected behaviour of any SMS service is that the message is temporarily stored by the carrier, and when the receiver phone is later brought online, it gets the message delivered. For some reason, this isn't the case for the messages I send from the PinePhone. Messages are delivered properly when the receiver is online, but they never reach their destination if it was offline at the time of sending.
I tried with two different carriers and both 3G and 4G networks for each: the problem is systematic with the PinePhone, while messages are delivered properly when the same SIM card is used in another phone. The problem also persisted across various upgrades of the modem firmware, including ADSP.
When logged in to my user account on my carrier's website, I can see that the messages were successfully sent.
To me, this looks like the PinePhone sends its messages together with some kind of metadata meaning "do not attempt later delivery, instead discard the message if the receiver is unreachable". Could anyone confirm this? Can it be changed and how? I couldn't find any information on that matter and to be honest I'm quite surprised to be the first one to bring this up.
|
|
|
|
QEMU with Alpinelinux |
|
Posted by: Surehand53 - 05-03-2023, 01:41 PM - Forum: General Discussion on Pinebook Pro
- Replies (6)
|
 |
Alpinelinux in QEMU
I have used the introduction from astr0baby and a few other internet sources and came up with a working solution to boot Alpinelinux in QEMU on the Pinebook Pro. The settings are relatively simple and should work with other target ISOs in a similar way. There is no graphics support, yet. The host distro used here is Manjaro. There might be some differences with other distros. Mind you, this describes how to run an arch64 ISO on an arch64 system.
Install Qemu and create a folder to keep all files together:
Code: pacman -S qemu-base
pacman -S qemu-img
mkdir qemu
Copy the ISO of Alpinelinux to your qemu folder. I have used the Standard ISO for the aarch64 architecture.
Then you need to download a BIOS
Code: wget https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/QEMU_EFI.fd
Last thing to prepare is a virtual harddrive to install Alpinelinux
Code: qemu-img create -f qcow2 alpine.qcow2 8G
This makes a 8G virtual hard disk in a file named alpine.qcow2, the qcow2 format being a format which appears to be 8G to the guest (VM), but only actually writes to the host any sectors which were written to by the guest in practice.
Install Alpinelinux
With all in place you can now start qemu from the .iso file and then install Alpinelinux to your virtual harddrive
Code: qemu-system-aarch64 \
-machine virt -cpu cortex-a57 \
-m 1024M -nographic \
-bios QEMU_EFI.fd \
-drive format=raw,readonly=on,file=alpine-standard-3.17.3-aarch64.iso \
-drive file=alpine.qcow2,media=disk,if=virtio
A small explanation. The first line is qemu for the aarch64 architecture. The second line describes the cpu. Then memory of 1024M is assigned. 512M is also fine. No graphics is supported. Next is the bios and then the two drives. The ISO file and the virtual harddrive.
Later I show how to use kvm and smp. They could also be used here, but this keeps is simple.
Once Alpinelinux has booted login like this:
user: root
passwd: <leave empty>
Once logged in you can straight away start the install process.
Please see the Alpine Docu and Alpine Wiki for details of the installation process.
You will be asked a bunch of questions, most of them will be default. Things to notice:
- maybe set your timezone
- you will be asked which drive you want to use: vda
- what kind of installation you want: sys
Run Alpinelinux
After the system is installed successfully, you can poweroff. To restart the system you don't need the ISO file anymore. The command after installation is:
Code: qemu-system-aarch64 \
-machine virt -cpu cortex-a57 \
-m 1024M -nographic \
-bios QEMU_EFI.fd \
-drive file=alpine.qcow2,media=disk,if=virtio
SMP
If you want qemu to use more than one cpu add the [backcolor=#f6f8fa]-smp 2[/backcolor] switch. This gives two cpus, more is possible.
KVM
For Kvm to work you either have to add your user in Manjaro to the kvm group, or run qemu with sudo.
Also:
- add -accel kvm
- you can switch [backcolor=#f6f8fa]-cpu[/backcolor] to host
If you use KVM there appears to be a bug that sometimes creates this error message:
Quote:qemu-system-aarch64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument
Just repeat the start command until it works.
Code: qemu-system-aarch64 \
-accel kvm -machine virt -cpu host -smp 2 \
-m 1024M -nographic \
-bios QEMU_EFI.fd \
-drive file=alpine.qcow2,media=disk,if=virtio
Edit See comment from jpalus below for a better way to call qemu with kvm.
That's it. I am sure there is still much to improve, but it works.
References
https://drewdevault.com/2018/09/10/Getti...-qemu.html
|
|
|
|
| PinePhone app development |
|
Posted by: WhiteHexagon - 05-03-2023, 08:48 AM - Forum: PinePhone Software
- Replies (14)
|
 |
okay, so my new PinePhone arrived, yay! and after a tricky challenge to get past the user registration screen, I am now ready to do some app development. I have previous experience with iOS and Android, and currently playing around with Zig. However I am new to Linux development, and from my brief bit of research I can see GUI options using SDL or GTK... Do we currently have a 'getting started' as an App developer type resource? maybe a template very basic GUI App? responding to orientation events, life cycle events etc, or is someone able to give me some pointers please? Something low level like single header C libs linking into my Zig would be ideal. i.e. I have no interest in giant frameworks with dependency hell. Alternative approach would be something like a unikernal template with a framebuffer starting point? I am open to suggestions
|
|
|
|
| Jabber with chatty |
|
Posted by: user641 - 05-03-2023, 07:54 AM - Forum: Mobian on PinePhone
- Replies (2)
|
 |
Hello, I've been using jabber with chatty, I like it's simple interface. But I have the problem that omemo encryption works not with all contacts and when the phone goes into ibernation encrypted messages are not unencrypted after unlocking the phone. Is there a way around?
|
|
|
|
| Getting all keys working on pine phone keyboard-case |
|
Posted by: undata - 05-03-2023, 07:21 AM - Forum: PinePhone Accessories
- Replies (5)
|
 |
Does anyone have a definite, exact, way to get the keyboard working for characters such as '|' which are on the front bevel of the function keys? Please.
There were various posts and threads I followed, which loaded the so-called "userland" driver, which I built, and which I know installed, since it disabled any functioning from the pine phone keyboard.
Some (or maybe all) of these posts come from people who may be smarter than myself. But can we have an exact , EXACT, set of steps? It's just surreal that we have instructions making crucial changes to the boot sequence etc., which also include steps such as "To save changes and close Nano, type CTRL-X, Y, and Enter."
I mean really, they are giving somewhat vague instructions about how to create daemons and drivers, and assuming that a person performing those would need exact keystrokes for how to save a file using nano???? Wow.
|
|
|
|
UART connection when booting? |
|
Posted by: saper - 05-02-2023, 08:21 AM - Forum: PinePhone Pro Hardware
- No Replies
|
 |
I have connected the headphone-to-UART adapter to the PinePhone Pro, flipped the privacy switch #6 down and started the phone.
To my surprise, the only nessages I see are some sellected messages from the Linux kernel:
Code: [ 1.065868] OF: graph: no port node found in /i2c@ff3d0000/typec-portc@22
[ 4.575898] pinephone-keyboard 5-0015: error -ENXIO: Failed to read device ID
[ 4.592797] gpio gpiochip4: (gpio4): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ
[ 4.593652] gpio gpiochip4: (gpio4): unable to lock HW IRQ 27 for IRQ
[ 4.594346] genirq: Failed to request resources for stk3310_event (irq 100) on irqchip rockchip_gpio_irq
[ 4.595374] stk3310 3-0048: request irq 100 failed
[ 4.685972] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.839273] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 4.847959] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan 4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e
Manjaro Linux 5.18.0-2-MANJARO-ARM (ttyS2)
manjaro-arm login:
It seem that the "UART" facility is connected to
GPIO4_C3/UART2C_RX_u
GPIO4_C4/UART2C_TX_u
I'd expect to get the primary UART getting Boot ROM and bootloader messages. Any (hope fully easy) way to get those signals out?
Edit: How to get bootloader messages: Use 115200 bps speed on the UART port to see bootloader messages. 1500000 bps are needed later for the kernel.
Code: connected
U-Boot TPL 2021.10 (Oct 04 2021 - 15:09:26)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2021.10 (Oct 04 2021 - 15:09:26 +0000)
Trying to boot from SPI
NOTICE: BL31: v2.6(release):
NOTICE: BL31: Built : 00:00:00, Jan 1 1980
Tow-Boot 2021.10 (Oct 04 2021 - 15:09:26 +0000)004 [variant: spi]
SoC: Rockchip rk3399
Reset cause: POR
Model: Pine64 PinePhonePro
DRAM: 3.9 GiB
PMIC: RK8180 (on=0x80, off=0x00)
MMC: mmc@fe310000: 3, mmc@fe320000: 1, mmc@fe330000: 0
Loading Environment from SPIFlash... SF: Detected gd25lq128e with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Model: Pine64 PinePhonePro
Net: No ethernet found.
starting USB...
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3a0000: USB OHCI 1.0
Bus usb@fe3c0000: USB EHCI 1.00
Bus usb@fe3e0000: USB OHCI 1.0
scanning bus usb@fe380000 for devices... 1 USB Device(s) found
scanning bus usb@fe3a0000 for devices... 1 USB Device(s) found
scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found
scanning bus usb@fe3e0000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Please press [ESCAPE] or [CTRL+C] to enter the boot menu.
off
off
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
1513 bytes read in 14 ms (105.5 KiB/s)
## Executing script at 00500000
gpio: pin 105 (gpio 105) value is 1
gpio: pin 154 (gpio 154) value is 1
20785160 bytes read in 913 ms (21.7 MiB/s)
gpio: pin 105 (gpio 105) value is 0
89899 bytes read in 36 ms (2.4 MiB/s)
7656782 bytes read in 347 ms (21 MiB/s)
gpio: pin 157 (gpio 157) value is 1
Moving Image from 0x2080000 to 0x2200000, end=3640000
## Flattened Device Tree blob at 01f00000
Booting using the fdt blob at 0x1f00000
Loading Ramdisk to f47a4000, end f4ef154e ... OK
Loading Device Tree to 00000000f478b000, end 00000000f47a3f2a ... OK
Starting kernel ...
¯ÎÜV.ÿYQøéðå³uÎAqO³uÎS¸þ»·¹¹xeª%²é»q»Íλގ<Uz´Ȋõ٦åíÙñj½íùý
Manjaro Linux 5.18.0-2-MANJARO-ARM (ttyS2)
manjaro-arm login:
i wonder if BOOTROM prints anything to that serial port?
|
|
|
|
|