Categories
linux

树莓派 电源固件升级问题

树莓派论坛提到

https://forums.raspberrypi.com/viewtopic.php?t=361383

升级方法

Tue Dec 12, 2023 5:44 pm

3B+ v1.4 has a new PMIC and needs Sept 2021 or newer firmware.

Follow https://pip.raspberrypi.com/categories/ ... 6-WP-1.pdf to update the firmware in your image.

树莓派更换了新的PMIC(电源管理芯片)

https://pip.raspberrypi.com/categories/685/documents/RP-003476-WP/RP-003476-WP-1.pdf

该PDF有说明最新固件情况

Updating only the firmware

Sometimes, going through the standard upgrade procedure may not be possible. For example, you may have acustomised distribution with no update facilities, or that cannot be upgraded without causing further issues. In thesecircumstances, and possibly others, you will need to update the firmware files in the distribution manually.You can download the firmware files from the following location:

https://github.com/raspberrypi/firmware/archive/refs/heads/stable.zip

This zip file contains a number of items, but the ones we are interested in at this stage are in the boot folder.

The firmwarefiles have names of the form

start*.elf, and their associated support files are fixup*.dat.

The basic principle is to copy the required start and fixup files from this zip file to replace the same named files in thedestination OS image.

The exact process will depend on how the OS has been set up, but this is an example of how itwould be done for a Raspberry Pi OS image:

1. Extract or open the zip file so you can access the required files.

2. Open up the boot folder in the destination OS image (this could be on an SD card, or a disk-based copy).

3. Determine which start.elf and fixup.dat files are present in the destination OS image.

4. Copy those files from the zip archive to the destination image.The image should now be ready for use on the latest Raspberry Pi Ltd hardware.

其实就是下载最新固件包 在压缩包里打开boot目录

替换start*.elf 和 fixup*.dat.

当然命令行系统 用的是start.elf fixup.dat

桌面系统用的是 start_x.elf fixup_x.dat

Categories
linux

Raspbian OS

全量搜索地址 清华开源镜像网站

https://mirrors.tuna.tsinghua.edu.cn/raspberry-pi-os-images/

Categories
android

orangepi PWM

打开pwm15

echo 0 > /sys/class/pwm/pwmchip2/export

设置频率1khz

echo 1000000 > /sys/class/pwm/pwmchip2/pwm0/period                                                                         

设置占空比 10%

echo 100000 > /sys/class/pwm/pwmchip2/pwm0/duty_cycle                                                                      

开始pwm

echo 1 > /sys/class/pwm/pwmchip2/pwm0/enable                                                  

关闭pwm

echo 0 > /sys/class/pwm/pwmchip2/pwm0/enable    
echo 0 > /sys/class/pwm/pwmchip2/unexport                                              
Categories
android

aosp 设置系统自启动脚本

安卓系统启动后会执行

/vendor/etc/init/hw/init.rk3588.rc

这个文件来源于

device/rockchip/rk3588/init.rk3588.rc

在on boot后添加执行脚本

on boot
    chmod 0666 /dev/mem
    chown root system /dev/mem

    chmod 0666 /dev/i2c-5
    chown root system /dev/i2c-5

以上是启动后 增加几个文件的读写权限

这几个文件跟GPIO控制有关系

Categories
android

ro.build.fingerprint 过长

ro.build.fingerprint 是在编译时决定的

frameworks/base/core/java/android/os/Build.java

publicstatic final String FINGERPRINT = deviceFingerprint()

private stattic String deviceFingerprint(){
 String finger = SystemProperties.get("ro.vuild.fingerprint");
 if(TextUtils.isEmpty(finger)){
  finger = getString("ro.product.brand")+'/'+
    getString("ro.product.name")+'/'+
    getString("ro.product.device")+'/'+
    getString("ro.build.version.release")+'/'+
    getString("ro.build.id")+'/'+
    getString("ro.build.version.incremental")+'/'+
    getString("ro.build.type")+'/'+
    getString("ro.build.tags")+'/'+
 }
 return finger;

}

fingerprint 格式

make file定义在

build/make/core/sysprop.mk

$(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)

要缩短该fingerprint

新更新

安卓系统会读取 system/build.prop

可以在这个文件设置 build.prop

在源码目录out/target/product/rk3588s_s/system/build.prop

设置

ro.build.fingerprint=rk3588s_s/12/SQ3A.220705.003.A1/eng.robin.20240217:userdebug/release-keys

若没有这个out文件夹(删除了out目录)

则需要在build/make/tools/buildinfo.sh

添加

echo "ro.build.fingerprint=$PRODUCT_BRAND/:$PLATFORM_VERSION/$BUILD_ID"

Categories
android

AOSP 源码修改 前置摄像头 镜像

在AOSP中 前置摄像头 (index=0)默认是镜像显示预览

frameworks/av/services/camera/libcameraservice/api1/client2/Parameters.cpp


previewTransform = degToTransform(0,
            cameraFacing == CAMERA_FACING_FRONT);

int Parameters::degToTransform(int degrees, bool mirror) {

degToTransform 第二个参数 是是否镜像显示

修改所有 degToTransform 第二个参数为false

Categories
android

orange pi 系统应用

第一

签名要用系统platform级别的签名

第二

adb remount 挂在system目录为可读写

mv /data/app/* /system/app*

adb 触发事件

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED

am broadcast -a android.intent.action.BOOT_COMPLETED –receiver-include-background

Categories
android

android so 编译(笨方法)

定义java native文件

package com.robin.spot.jni;

public class WiringOP {

    static {
        System.loadLibrary("WiringOP");
    }

    public final static native int wiringPiSetup();
    
}

生成java native 头文件

 javac -h ./ .\com\robin\spot\jni\WiringOP.java

头文件内容

/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_robin_spot_jni_WiringOP */

#ifndef _Included_com_robin_spot_jni_WiringOP
#define _Included_com_robin_spot_jni_WiringOP
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     com_robin_spot_jni_WiringOP
 * Method:    wiringPiSetup
 * Signature: ()I
 */
JNIEXPORT jint JNICALL Java_com_robin_spot_jni_WiringOP_wiringPiSetup
  (JNIEnv *, jclass);

#ifdef __cplusplus
}
#endif
#endif

复制文件到jni目录并且实现该头文件

执行c文件编译

 ndk-build
Categories
android

orangepi AOSP 修改预装应用

out/.module_paths/Android.mk.list

该文件会保存用到的模块

修改该全局变量 PRODUCT_PACKAGES
通常在device.mk
example : device/rockchip/common/device.mk
device/rockchip/rk3588/rk3588s_s/rk3588s_s.mk
device/rockchip/common/modules/rockchip_apps.mk

//查看device/rockchip/common/device.mk
可以看到调用路径

Categories
android

orangepi aosp 分区 增加系统存储空间

device/rockchip/common/build/rockchip/Partitions.mk

修改
      #BOARD_SUPER_PARTITION_SIZE ?=  3263168512

默认为3G?
可合理增大  添加默认应用