CSI demo app with SC3336

  • Hello
    1 Let the image start CSI by default Add it to the dts file

    Code: Select all

     
    &i2c4 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&i2c4m2_xfer>;
    }
    
    2 Refer to network calibration https://wiki.luckfox.com/Luckfox-Pico/L ... 1%E6%97%B6, ensure that the luckfox pico ultra can ping the Internet
    3 MD is a printed result of the mobile test
  • Thank You @Crocodile for your help so far.

    Related to the incorrect time, I made a workaround and solved the issue.

    original S99rtcinit script always returns "RTC does not require time calibration" due to if condition comparing the date with 1996, event the condition could met it set 2024...

    Code: Select all

    	if [ "$(hwclock | grep "1969")" ]; then
    		echo "RTC time calibration"
    		date -s 2024-01-01
    		hwclock -w
    	else
    		echo "RTC does not require time calibration"
    	fi
    


    I modified the script to the following and hwclock is set accordingly.

    Code: Select all

    #!/bin/sh
    
    case $1 in
    start)
        myIPaddress=$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
        echo $myIPaddress
        # Wait for network
        sleep 5
        # Get RTC time, reformat for BusyBox
        RTC_TIME=$(hwclock --show | sed 's/  *[0-9]\.[0-9]* seconds//' | awk '{print $3 " " $2 " " $6 " " $4}')
        RTC_EPOCH=$(date -d "$RTC_TIME" +%s 2>/dev/null || echo "0")
        BASELINE_EPOCH=$(date -d "2025-01-01" +%s)
    
        if [ "$RTC_EPOCH" -lt "$BASELINE_EPOCH" ] || [ "$RTC_EPOCH" = "0" ]; then
            echo "RTC time calibration needed"
            # Stop ntpd to free port 123
            killall ntpd 2>/dev/null
            sleep 1
            if command -v ntpdate >/dev/null 2>&1; then
                ntpdate -b 192.168.1.1 || date -s "2025-01-01"
            else
                echo "ntpdate not found, setting fallback time"
                date -s "2025-01-01"
            fi
            # Write to RTC
            hwclock -w
            # Restart ntpd
            ntpd -g -c /etc/ntp.conf &
        else
            echo "RTC does not require time calibration"
        fi
        # Sync RTC to system time (redundant but safe)
        hwclock --systohc
        ;;
    *)
        exit 1
        ;;
    esac
    

    However I noticed that even I set ntpdate in buildrootconfig, the firmware does not include the executable. I had to copy it to the overlay directory to get it included in the firmware. Perhaps it is due to ntp.mk file?

    Code: Select all

    
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_WAIT) += scripts/ntp-wait/ntp-wait
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDATE) += ntpdate/ntpdate
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDC) += ntpdc/ntpdc
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPQ) += ntpq/ntpq
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPSNMPD) += ntpsnmpd/ntpsnmpd
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTIME) += util/ntptime
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTRACE) += scripts/ntptrace/ntptrace
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
    NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
    
    define NTP_INSTALL_TARGET_CMDS
            $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DI>
            test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(>
            $(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
    endef
    
    
    
  • Hello, it may be the problem of ntp.mk. If the rules for installing ntpdate are missing in ntp.mk, or the rules are incorrect, ntpdate may not be correctly installed in the target file system.
    Solution:
    Check the ntp.mk file to make sure it contains an installation rule similar to the following:
    Makefile:

    Code: Select all

    $(INSTALL) -D -m 0755 $(@D)/ntpdate $(TARGET_DIR)/usr/sbin/ntpdate
    2. Check buildrootconfig and make sure the following options are enabled:

    Code: Select all

    BR2_PACKAGE_NTP=y
    BR2_PACKAGE_NTP_NTPDATE=y
    Make sure all dependencies (such as toolchains, libraries, etc.) are configured correctly.