20190111_jeffrey - silenceuncrio/diary GitHub Wiki

0920

幫這禮拜的工作紀錄做個摘要

  • M300
    • wizard
      • apply 有時出錯, 不是 icos 回應的 apply fail 而是 CGI 本身的執行沒有回應
    • WiFi
      • 在 uboot 把 E4 這個 GPIO (CSI_DATA00) 先拉成 low 再拉成 high
      • mfgtool 燒完第一次開機 sysled 燈在 01:40.2 console 開始顯示在 01:42.7
      • hotfix/v1.76 branch - 使用 rc.local 加 uboot_env.sh 的方式 - 兩台 sample
      • develop branch - 直接改在 uboot
    • hotfix/v1.76
      • WiFi config web page
  • M360
    • 從 mitrastar 拿回 ping 不通有 bad block 的板子
      • 拔插電進 uboot 清空除了 uboot 之外的 partition - nand erase 80000 7000000
      • 燒目前的 M360 的 sysupgrade.bin
      • 一切正常
      • 措辭很客氣的回復給 mitrastar
    • web ui for upgrade uboot (uboot need version information: 1.0)
      • uboot
        • rename 'uboot_ver' to 'bootloader_ver'
        • generate our bootloader.img for upgrading via web ui
      • linux
        • rename 'U-Boot Version' field to 'Bootloader Version' at 'Management > Identification' page
        • prepare the scripts for bootloader upgrading
        • prepare the CGI for bootloader upgrading
        • prepare bootloader.js and bootloader.html for bootloader upgrade
        • offer a hidden web page for bootloader upgrade

這摘要剛好可以寫工作周報

不過稍微調一下順序

句子也再潤一下

  • M300
    • release hotfix/v1.76
      • WiFi config web page
    • [issue]power on issue at M300 model with WiFi module
      • 在 uboot 把 E4 這個 GPIO (CSI_DATA00) 先拉成 low 再拉成 high
      • mfgtool 燒完第一次開機 sysled 燈在 01:40.2 console 開始顯示在 01:42.7
      • hotfix/v1.76 branch - 使用 rc.local 加 uboot_env.sh 的方式 - 兩台 sample
      • develop branch - 直接改在 uboot
    • wizard
      • apply 有時出錯, 不是 icos 回應的 apply fail 而是 CGI 本身的執行沒有回應
  • M360
    • 從 mitrastar 拿回 ping 不通有 bad block 的板子
      • 拔插電進 uboot 清空除了 uboot 之外的 partition - nand erase 80000 7000000
      • 燒目前的 M360 的 sysupgrade.bin
      • 一切正常
      • 措辭很客氣的回復給 mitrastar
    • web ui for upgrade uboot (uboot need version information: 1.0)
      • uboot
        • rename 'uboot_ver' to 'bootloader_ver'
        • generate our bootloader.img for upgrading via web ui
      • linux
        • rename 'U-Boot Version' field to 'Bootloader Version' at 'Management > Identification' page
        • prepare the scripts for bootloader upgrading
        • prepare the CGI for bootloader upgrading
        • prepare bootloader.js and bootloader.html for bootloader upgrade
        • offer a hidden web page for bootloader upgrade

1135

軟體週會結束

M300 - [issue]power on issue at M300 model with WiFi module 有相關的 mantis 以及 task

  • mantis - 0000390: Load default / change WiFi configuration would not able to reboot. It needs to take two times reboot.
  • task - WiFi warm reboot cause hang

會準備一個專門的 branch 來解 WiFi warm reboot cause hang

M300 我多了一條 amntis - 0000398: when restore config/upgrade firmware from remote, DUT should reboot automatically

先解在 develop branch

1325

再來整理一次這禮拜的工作摘要

  • M300
    • release hotfix/v1.76
      • WiFi config web page
    • WiFi warm reboot cause hang
      • 在 uboot 把 E4 這個 GPIO (CSI_DATA00) 先拉成 low 再拉成 high
      • mfgtool 燒完第一次開機 sysled 燈在 01:40.2 console 開始顯示在 01:42.7
      • hotfix/v1.76-wifi-eva branch 專供實驗
    • wizard
      • apply 有時出錯, 不是 icos 回應的 apply fail 而是 CGI 本身的執行沒有回應
  • M360
    • 從 mitrastar 拿回 ping 不通有 bad block 的板子
      • 拔插電進 uboot 清空除了 uboot 之外的 partition - nand erase 80000 7000000
      • 燒目前的 M360 的 sysupgrade.bin
      • 一切正常
      • 已回復給 mitrastar
    • web ui for upgrade uboot (uboot need version information: 1.0)
      • uboot
        • rename 'uboot_ver' to 'bootloader_ver'
        • generate our bootloader.img for upgrading via web ui
      • linux
        • rename 'U-Boot Version' field to 'Bootloader Version' at 'Management > Identification' page
        • prepare the scripts for bootloader upgrading
        • prepare the CGI for bootloader upgrading
        • prepare bootloader.js and bootloader.html for bootloader upgrade
        • offer a hidden web page for bootloader upgrade

1345

寫週報

1415

繼續解決 WiFi warm reboot cause hang

既然已經有 hotfix/v1.76-wifi-eva branch 專供實驗

那就 checkout 吧

➜  M300 git:(develop) ✗ git checkout hotfix/v1.76-wifi-eva
Checking out files: 100% (297/297), done.
Branch hotfix/v1.76-wifi-eva set up to track remote branch hotfix/v1.76-wifi-eva from origin.
Switched to a new branch 'hotfix/v1.76-wifi-eva'
➜  M300 git:(hotfix/v1.76-wifi-eva) ✗ git pull
Current branch hotfix/v1.76-wifi-eva is up to date.

Products/Vendor = M300/16_MTK_WIFI

build image - source bimage.sh

1445

mfgtool 燒錄

從 morris 那邊借了了一片有從 CPU 拉 GPIO(CSI_DATA00) 去控制周邊電源的 PCBA

這裡所謂的周邊指的是除了 CPU 之外的 device

所以像 LTE, ethernet, console, led 燈都需要這根 GPIO 來啟動電源才行

uboot 完全不介入的話

從上電給 CPU 到 這根 CPIO 啟動周邊的電源約需 8.6 秒

這時面板上的 LED 燈才會亮

console 也才開始有 output

參考一下 output

籫糖ow臼穔臇?at MMIO 0x21f4000 (irq = 228, base_baud = 5000000) is a IMX
imx sema4 driver is registered.
brd: module loaded
loop: module loaded
nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xda
nand: Macronix MX30LF2G18AC
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
gpmi-nand 1806000.gpmi-nand: mode:5 ,failed in set feature.
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: bad block at 0x000002fc0000
nand_read_bbt: bad block at 0x000004aa0000
nand_read_bbt: bad block at 0x000006420000
nand_read_bbt: bad block at 0x000006ca0000
nand_read_bbt: bad block at 0x0000083e0000
nand_read_bbt: bad block at 0x00000d1c0000
11 cmdlinepart partitions found on MTD device gpmi-nand
Creating 11 MTD partitions on "gpmi-nand":
0x000000000000-0x000000300000 : "boot"
0x000000300000-0x000000400000 : "boot_env"
0x000000400000-0x000000e00000 : "kernel_a"
0x000000e00000-0x000001000000 : "dtb_a"
0x000001000000-0x000007000000 : "rootfs_a"
0x000007000000-0x000008000000 : "config_a"
0x000008000000-0x000008400000 : "misc"
0x000008400000-0x000008e00000 : "kernel_b"
0x000008e00000-0x000009000000 : "dtb_b"
0x000009000000-0x00000f000000 : "rootfs_b"
0x00000f000000-0x000010000000 : "config_b"
gpmi-nand 1806000.gpmi-nand: driver registered.
...

雖然不確定這根 GPIO 是誰把它拉成 high 來啟動周邊的

但可以肯定的是靠 linux 來啟動周邊實在是太慢了

從使用者的角度而言

從插上電源後要快 9 秒才看到 LED 燈亮

光這件事就不合理

我要想辦法在 uboot 做到這件事才行

1610

hytec 希望 M300 一起來的時候就只讀 SIM1

目前 LTE modem 讀 SIM1 或 SIM2 是由某根 GPIO 決定的

只不過 LTE modem 起來的時間比 icos 早

所以 areil 會在 icos 裡去看 modem 到底讀的是 SIM 1 還是 SIM 2

奇怪的是答案是不一定

所以如果 ariel 在 icos 裡看到 modem 讀的是 SIM 2 的話

要切換到 SIM 1 還需要做 modem restart 的動作

從 SIM 1 切換到 SIM 2 要去設定某根 GPIO

這只是瞬間的事情

但 modem restart 就慢了 大概會需要 1 分鐘

所以才會希望由 uboot 趕在 modem 起來之前先透過該 GPIO 指定成 SIM 1

至於是哪一根 GPIO 呢

proscend/prosrc/icos/icoslib/gpio_ctrl/lte_ctrl.c

int GetCurrentSIM(int *SIMno)
{
    if (GPIOGetValue(LTE_SIM_SEL_PORT, LTE_SIM_SEL_PIN, SIMno) < 0)
    {
        JDBG_ERROR("failed get value of GPIO");
        return RETCODE_FAIL_GET_VALUE;
    }
    return RETCODE_SUCCESS;
}

目前是由下述的定義推得

#define LTE_RST_N_PORT		5
#define LTE_RST_N_PIN		7
#define LTE_SIM_SEL_PORT	2
#define LTE_SIM_SEL_PIN		17

該 GPIO 為 (Instance, Signal) = (GPIO2, IO17) 這根