Archive for May, 2026

[物联网] esp-idf 环境安装

2026.5 25

在复刻ESP32C3_4.2寸鱼鹰全反射类墨水屏的时候,需要用到esp-idf。

很多地方都是推荐离线安装,下载了2个离线文件。

esp-idf-tools-setup-offline-5.5.4.exe

eim-gui-windows-x64.exe 和archive_v5.5.4_windows-x64.zst

eim-gui-windows-x64.exe 是 esp-idf-tools-setup-offline-5.5.4.exe 的升级替代方案,前者是新一代统一安装管理器,后者是旧版离线安装包。

安装过程中遇到了很多错误。
错误1:

错误2:

最后发现是在C:\Espressif\tools下的 Microsoft.v6.0.1.PowerShell_profile.ps1 有语法错误。

文件:C:\Espressif\tools\Microsoft.v6.0.1.PowerShell_profile.ps1

把:$previous = $env:’_IDF.PY_COMPLETE’
改成:$previous = ${env:_IDF.PY_COMPLETE}

把:$env:’_IDF.PY_COMPLETE’ = ‘powershell_source’
改成:${env:_IDF.PY_COMPLETE} = ‘powershell_source’

把:$env:’_IDF.PY_COMPLETE’ = $previous
改成:${env:_IDF.PY_COMPLETE} = $previous

驱动签名问题:


重启系统禁用驱动签名

安装好esp-idf后,代码提示不兼容

[我的日志] 重新焊接nand flash

2026.5 9

重新焊接nand flash后,出现如下提示:

System bootstrap …
Nor Flash ID: 0x0102164D, SIZE: 8388608Bytes
Using 300.000 MHz high precision timer.
Press Ctrl+B to enter Boot Menu …..
Load Ctrl Program …

Load CTRL with ECC……
Executing program, launch at: 0x01800000

Ctrl Version: RGOS 10.4(2b12)p1 Release(160818)
MTD_DRIVER-5-MTD_NAND_FOUND: 1 NAND chips(chip size : 134217728) detected
Wait serveral minutes for setting up file system marker to OOB after last time format.
FILESYS-3-FLASH: Cannot mount filesystem [jffs2] on root device [/dev/mtdblock/1], errno[-22].
Press Ctrl+C to enter Ctrl ……

!!!NOTICE!!!
Main program (rgos.bin) is lost!
Press F1 key to recover this problem step by step, or wait 2 seconds to get in factory tftp download.
Now begin to download all files through the FileList.

Host IP[192.168.64.1] Target IP[192.168.64.200] File name[FileList.txt]
%Now Begin Download File FileList.txt From 192.168.64.1 to 192.168.64.200

send download request.

[电子技术] RG-S2928G-E更换nand

2026.5 8

更换nand flash后,提示错误:

dconf: [system.cpld_address_bits] = not found
dconf: [system.cpld_test_addr0] = not found
dconf: [system.cpld_test_addr1] = not found

System bootstrap …
Nor Flash ID: 0x0102164D, SIZE: 8388608Bytes

Before reserved Memory , avamem = 0x10da000

After reserved Memory , avamem = 0x10da000
On node 0 totalpages: 28147
Begin init free area zone 0, start = 0x0120D000
After reserved Zone 0 bitmap, start = 0x0120F000
zone(0): 28145 pages, 28145 realpages.
Begin init free area zone 1, start = 0x08000000
Zone 1 with no pages
Begin init free area zone 2, start = 0x08000000
Zone 2 with no pages
dconf: [config.ProductName] = S2928G-E
dconf: [system.description] = Ruijie Full Gigabit Security & Intelligence Access Switch (S2928G-E) By Ruijie Networks
Using 300.000 MHz high precision timer.

================Begin Subsystem Search===================
Start Address : 010267c0, End Address : 01026874
Find a subsystem <debug_init>!
Find a subsystem <root_device>!
Find a subsystem <BootLoader>!
==================End Subsystem Search=================

===========Check Subsystem Sequence
WARNING in subsystem <root_device>: sequence “mtd_block” no exist!
WARNING in subsystem <BootLoader>: sequence “root_fs_mount” no exist!
===========Check Subsystem Sequence end

==================Begin initialize subsystem=================
======Initialization Basic Subsystem
Initialize Subsystem <debug_init>……
Warnning in subsystem <root_device>: the dependency “mtd_block” not satisfy!
Initialize Subsystem <BootLoader>……
Suspend thread BootLoader
======Initialization Basic Subsystem End
======Initialization Linklayer Subsystem
======Initialization Linklayer Subsystem End
======Initialization Networklayer Subsystem
======Initialization Networklayer Subsystem End
======Initialization Application Subsystem
======Initialization Application Subsystem End
======Initialization Driver Subsystem
======Initialization Driver Subsystem End
======Initialization Last Subsystem
======Initialization Last Subsystem End
==================End initialize subsystem===================
==== Phase 0 init threads BEGIN====
==== Phase 0 threads initial END====
==== Phase 1 init threads BEGIN====
==== Phase 1 threads initial END====
==== Phase 2 init threads BEGIN====
Resume thread BootLoader
==== Phase 2 threads initial END====
==== All threads is running !====
Press Ctrl+B to enter Boot Menu …..

The before_leave_bootloader is not registered ….
Load Ctrl Program …

Use NO.1 ECC code!
Load CTRL with ECC……

The before_run_main is not registered ….
===============================================================================================================
Executing program, launch at: 0x01800000

dconf: [system.cpld_address_bits] = not found
dconf: [system.cpld_test_addr0] = not found
dconf: [system.cpld_test_addr1] = not found
Ctrl Version: RGOS 10.4(2b12)p1 Release(160818)

Before reserved Memory , avamem = 0x1f9c000

After reserved Memory , avamem = 0x1f9c000
__start___param 01da9500, __stop___param 01da9540
Kernel parameter: Total read 4 parameters!
On node 0 totalpages: 24409
Begin init free area zone 0, start = 0x020A7000
After reserved Zone 0 bitmap, start = 0x020A9000
zone(0): 24407 pages, 24407 realpages.
Begin init free area zone 1, start = 0x08000000
Zone 1 with no pages
Begin init free area zone 2, start = 0x08000000
Zone 2 with no pages
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 32768(order: 5, 131072 bytes)
devfs: v1.12c (20020818)
devfs: boot_options: 0x1
dconf: [config.ProductName] = S2928G-E
dconf: [system.description] = Ruijie Full Gigabit Security & Intelligence Access Switch (S2928G-E) By Ruijie Networks

================Begin Subsystem Search===================
Start Address : 01da8ec0, End Address : 01da93ac
Find a subsystem <hrtimer>!
Find a subsystem <debug_init>!
Find a subsystem <mm_proc>!
Find a subsystem <workqueue>!
Find a subsystem <device_managment_sub>!
Find a subsystem <device_managment>!
Find a subsystem <support>!
Find a subsystem <root_fs_mount>!
Find a subsystem <i2c_fs>!
Find a subsystem <pcf8563_fs>!
Find a subsystem <lm75_fs>!
Find a subsystem <mtd_core>!
Find a subsystem <mtd_block>!
Find a subsystem <pci_base>!
Find a subsystem <drv_pci_probe>!
Find a subsystem <ssp_product>!
Find a subsystem <ssp_subsystem>!
Find a subsystem <root_device>!
Find a subsystem <bcm5300x_i2c_fs>!
Find a subsystem <BootLoader>!
Find a subsystem <upgrade>!
==================End Subsystem Search=================

===========Check Subsystem Sequence
WARNING in subsystem <device_managment>: sequence “snmp” no exist!
WARNING in subsystem <support>: sequence “snmp” no exist!
WARNING in subsystem <upgrade>: sequence “socket” no exist!
WARNING in subsystem <device_managment_sub>: sequence “device_management_su” no exist!
WARNING in subsystem <device_managment_sub>: sequence “” no exist!
===========Check Subsystem Sequence end

==================Begin initialize subsystem=================
======Initialization Basic Subsystem
Initialize Subsystem <hrtimer>……
Initialize Subsystem <debug_init>……
Initialize Subsystem <mm_proc>……
Initialize Subsystem <workqueue>……
Suspend thread kevents
Initialize Subsystem <i2c_fs>……

MODULE: I2C Bus Test
RESULT: FAIL
DESCRIPTION: The info of the I2C Devices exam:
Module <main0> is not exist in <0X48>

Initialize Subsystem <mtd_core>……
Initialize Subsystem <ssp_product>……
dconf: [driver.Dev_id] = 0x20140071
Initialize Subsystem <mtd_block>……
Suspend thread mtdblock
# Set task mtdblock to phase 0
Initialize Subsystem <root_device>……

MODULE: NAND Flash Init
RESULT: FAIL
DESCRIPTION: Chip 0: 0XE8 0XF1 (Nonsupport)

 

TRACE_SF_PRINT: kernel BUG at nflash.c:147:[init]!trace_currentfunction -> bcm5300x_nand_select_chip -> nand_scan -> nand_rootdev_init -> subsys_class_init -> subsys_init -> init_task_proc -> TCC_Task_Shell -> <end>

Attention: the exception caused by macro BUG() or BUG_ON(), not your code …
Dump The Exception Stack
Address | 0 1 2 3 4 5 6 7 8 9 A B C D E F | 0123456789ABCDEF
———+————————————————-+—————–
07F28B10 | 6F 70 71 72 73 74 75 76 77 78 79 7A 00 AD BE EF | opqrstuvwxyz….
07F28B20 | 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 | ghijklmnopqrstuv
07F28B30 | 77 78 79 7A 00 4C 4D 4E 30 31 32 33 34 35 36 37 | wxyz.LMN01234567
07F28B40 | 38 39 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E | 89ABCDEFGHIJKLMN
07F28B50 | 4F 50 51 52 53 54 55 56 57 58 59 5A 00 00 00 0E | OPQRSTUVWXYZ….
07F28B60 | FF FF FF FF 00 00 00 08 01 EF C5 6C 00 00 00 68 | ………..l…h
07F28B70 | 01 EF C9 33 07 F2 8C 18 00 00 00 41 00 00 00 02 | …3…….A….
07F28B80 | FF FF FF FF 01 EF C5 34 00 00 00 2E 81 85 8B 58 | …….4…….X
07F28B90 | 01 B3 B6 8E 01 EF 06 EC 00 00 04 00 00 00 02 ED | …………….
07F28BA0 | 01 EF C5 34 00 00 00 16 00 00 00 02 00 00 00 01 | …4…………
07F28BB0 | 01 EF C5 83 00 00 00 15 81 86 8D 0C 00 00 00 00 | …………….
07F28BC0 | 01 EF C5 34 81 85 9B 68 FF FF FF FF A0 00 00 00 | …4…h……..
07F28BD0 | FF FF FF FF 01 88 5C 20 07 F2 8B D0 00 00 00 13 | ……\ ……..
07F28BE0 | 00 00 00 00 00 00 00 D0 81 88 0E E0 00 00 00 88 | …………….
07F28BF0 | 00 00 00 00 00 00 00 D0 00 00 00 00 00 00 00 00 | …………….
07F28C00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | …………….
07F28C10 | 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 2E | …………….
07F28C20 | 00 00 00 2E 00 00 00 2E 00 00 00 2E 00 00 00 2E | …………….
07F28C30 | 00 00 00 2E 00 00 00 2E 00 00 00 2E 00 00 00 2E | …………….
07F28C40 | 00 00 00 2E 00 00 00 2E 00 00 00 2E 00 00 00 2E | …………….
07F28C50 | 00 00 00 2E 00 00 00 2E 10 00 FC 02 40 80 80 34 | …………@..4
07F28C60 | 01 81 D8 08 FF FF FF FF 00 00 0F 20 81 87 EA E0 | ……….. ….
07F28C70 | 00 00 00 00 10 00 FC 00 00 00 00 00 A0 00 00 00 | …………….
07F28C80 | 00 00 00 00 00 00 00 2E FF FF FF FF 00 20 C4 9D | …………. ..
07F28C90 | 00 16 E0 00 00 00 00 05 00 06 8D B9 00 06 00 00 | …………….
07F28CA0 | 01 C9 83 A0 00 00 00 01 00 00 00 01 00 00 00 01 | …………….
07F28CB0 | 01 C8 E2 C8 07 EA 61 70 07 EA 60 00 01 88 30 B4 | ……ap..`…0.
07F28CC0 | 01 C8 E2 C8 10 00 FC 01 00 00 00 00 00 00 01 80 | …………….
07F28CD0 | 18 00 00 64 18 00 00 00 00 00 00 00 00 00 00 00 | …d…………
07F28CE0 | 01 DE 93 F0 07 F2 8D 18 00 00 00 01 01 81 D8 08 | …………….
07F28CF0 | 00 00 02 ED 91 87 60 00 10 00 FC 02 40 80 80 34 | ……`…..@..4
07F28D00 | 01 81 D8 08 FF FF FF FF 00 00 0F 20 00 00 00 05 | ……….. ….
———+————————————————-+—————–

 

System Exception Occured:
ExType: Trap exception
Current Thread: init
SP : 07F28D18
SP Start : 07EA91E0 SP End : 07F28DF0
CP0 Error Report Registers:
Cause : 40808034 EPC : 0181D808
Status : 1000FC02 ErrEPC : 00000005
ErrCtrl : 00000F20 BadVAddr : FFFFFFFF
CacheErr : 00000000 RA(r31) : 0181D808
General Purpose Registers (GPRs):
0 (r00) : 00000000 s0(r16) : 01C8E2C8
AT(r01) : 1000FC00 s1(r17) : 07EA6170
v0(r02) : 00000000 s2(r18) : 07EA6000
v1(r03) : A0000000 s3(r19) : 018830B4
a0(r04) : 00000000 s4(r20) : 01C8E2C8
a1(r05) : 0000002E s5(r21) : 1000FC01
a2(r06) : FFFFFFFF s6(r22) : 00000000
a3(r07) : 0020C49D s7(r23) : 00000180
a4(r08) : 0016E000 t8(r24) : 18000064
a5(r09) : 00000005 t9(r25) : 18000000
a6(r10) : 00068DB9 k0(r26) : 00000000
a7(r11) : 00060000 k1(r27) : 00000000
t0(r12) : 01C983A0 gp(r28) : 01DE93F0
t1(r13) : 00000001 sp(r29) : 07F28D18
t2(r14) : 00000001 fp(r30) : 00000001
t3(r15) : 00000001 ra(r31) : 0181D808

MIPS Stack Trace:
__touch_exception -> nand_scan -> nand_rootdev_init -> subsys_classßdconf: [system.cpld_address_bits] = not found
dconf: [system.cpld_test_addr0] = not found
dconf: [system.cpld_test_addr1] = not found

System bootstrap …
Nor Flash ID: 0x0102164D, SIZE: 8388608Bytes

Before reserved Memory , avamem = 0x10da000

After reserved Memory , avamem = 0x10da000
On node 0 totalpages: 28147
Begin init free area zone 0, start = 0x0120D000
After reserved Zone 0 bitmap, start = 0x0120F000
zone(0): 28145 pages, 28145 realpages.
Begin init free area zone 1, start = 0x08000000
Zone 1 with no pages
Begin init free area zone 2, start = 0x08000000
Zone 2 with no pages
dconf: [config.ProductName] = S2928G-E
dconf: [system.description] = Ruijie Full Gigabit Security & Intelligence Access Switch (S2928G-E) By Ruijie Networks
Using 300.000 MHz high precision timer.

================Begin Subsystem Search===================
Start Address : 010267c0, End Address : 01026874
Find a subsystem <debug_init>!
Find a subsystem <root_device>!
Find a subsystem <BootLoader>!
==================End Subsystem Search=================

===========Check Subsystem Sequence
WARNING in subsystem <root_device>: sequence “mtd_block” no exist!
WARNING in subsystem <BootLoader>: sequence “root_fs_mount” no exist!
===========Check Subsystem Sequence end

==================Begin initialize subsystem=================
======Initialization Basic Subsystem
Initialize Subsystem <debug_init>……
Warnning in subsystem <root_device>: the dependency “mtd_block” not satisfy!
Initialize Subsystem <BootLoader>……
Suspend thread BootLoader
======Initialization Basic Subsystem End
======Initialization Linklayer Subsystem
======Initialization Linklayer Subsystem End
======Initialization Networklayer Subsystem
======Initialization Networklayer Subsystem End
======Initialization Application Subsystem
======Initialization Application Subsystem End
======Initialization Driver Subsystem
======Initialization Driver Subsystem End
======Initialization Last Subsystem
======Initialization Last Subsystem End
==================End initialize subsystem===================
==== Phase 0 init threads BEGIN====
==== Phase 0 threads initial END====
==== Phase 1 init threads BEGIN====
==== Phase 1 threads initial END====
==== Phase 2 init threads BEGIN====
Resume thread BootLoader
==== Phase 2 threads initial END====
==== All threads is running !====
Press Ctrl+B to enter Boot Menu ….

====== BOOT Menu(“Ctrl+Z” to upper level) ======
TOP menu items.
************************************************
0. XModem utilities.
1. Run CTRL.
2. SetMac utilities.
3. Scattered utilities.
************************************************
Press a key to run the command:

 

核心错误定位

日志中关键错误出现在 CTRL(主控程序) 初始化阶段:

text
MODULE:      NAND Flash Init
RESULT:      FAIL
DESCRIPTION: Chip 0: 0XE8 0XF1 (Nonsupport)

TRACE_SF_PRINT: kernel BUG at nflash.c:147:[init]!
  • 芯片ID:0xE8 0xF1 表明NAND Flash返回了不支持的制造商ID和设备ID。

  • 内核BUG:驱动代码在 nflash.c:147 处调用 BUG() 宏,触发异常,系统崩溃。

[电子技术] 使用binwalk提取固件中的Uboot

2026.5 4

方法一:使用 dd 命令手动分割

root@3865u:/home/sunliguo# binwalk RG-S2928G.bin

DECIMAL HEXADECIMAL DESCRIPTION
——————————————————————————–
11141120 0xAA0000 JFFS2 filesystem, big endian

方法二:使用 binwalk 自动化分析提取

binwalk -Me firmware_dump.bin

root@3865u:/home/sunliguo# binwalk -Me RG-S2928G.bin

Scan Time: 2026-05-04 12:31:53
Target File: /home/sunliguo/RG-S2928G.bin
MD5 Checksum: 98ea4c34d0750081efa4f95a9fbb4ba7
Signatures: 411

DECIMAL HEXADECIMAL DESCRIPTION
——————————————————————————–

WARNING: Extractor.execute failed to run external extractor ‘jefferson -d ‘jffs2-root’ ‘%e”: [Errno 2] No such file or directory: ‘jefferson’, ‘jefferson -d ‘jffs2-root’ ‘%e” might not be installed correctly
11141120 0xAA0000 JFFS2 filesystem, big endian

# bs: 块大小,skip: 跳过字节数,if: 原始固件,of: 输出文件
dd if=RG-S2928G.bin of=RG-S2928G.jffs2 bs=1 skip=11141120
# 推荐使用 --user 参数,为当前用户安装
pip install --user jefferson
# -d 参数指定了输出文件夹,这里命名为 jffs2_root
jefferson RG-S2928G.jffs2 -d jffs2_root

			

[我与嘉立创] 点焊笔

2026.5 4

复刻自电模之家的点焊笔

点焊笔

[我与嘉立创] nand_programmer编程器

2026.5 3

nand_programmer编程器复刻自嘉立创开元广场:nand_programmer编程器 – 立创开源硬件平台 – 深圳创电优选科技有限公司

简介:NANDO是基于STM32的NAND开源编辑器,来自https://github.com/bbogush/nand_programmer。

核心芯片:STM32F103

刷机软件:STM32CubeProgrammer 

nand_programmer编程器
使用串口工具接好线
nand_programmer编程器

遇到的问题:

1、串口不识别

nand_programmer编程器

[日常维修] 锐捷RG-S2928G-E维修

2026.5 3

故障现象:

能正常开机启动,启动后,不接网线。后台显示1-8口up,8-16口接网线后不亮灯。17-24口正常。

交换机启动日志:

System bootstrap …
Nor Flash ID: 0x0102164D, SIZE: 8388608Bytes
Using 300.000 MHz high precision timer.
Press Ctrl+B to enter Boot Menu …..
Load Ctrl Program …

Load CTRL with ECC……
Executing program, launch at: 0x01800000

Ctrl Version: RGOS 10.4(2b12)p1 Release(160818)
MTD_DRIVER-5-MTD_NAND_FOUND: 1 NAND chips(chip size : 134217728) detected
Press Ctrl+C to enter Ctrl ……
Verify the image …[ok]
Loading main program …
Loading main program ‘rgos.bin’.
Load main program successfully.
Executing program, launch at: 0x04000000

MTD_DRIVER-5-MTD_NAND_FOUND: 1 NAND chips(chip size : 134217728) detected

Self decompressing the image:
#################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################### [OK]
Self decompressing the image succeed and will jump to 0x00010000…

Ruijie General Operating System Software
Release Software ™, RGOS 10.4(2b12)p1 Release(160818), Compiled Wed Jun 5 16:34:01 CST 2013 by ngcf67

Copyright (c) 1998-2013s by Ruijie Networks.
All Rights Reserved.
Neither Decompiling Nor Reverse Engineering Shall Be Allowed.

*May 3 11:39:17: %MTD_DRIVER-5-MTD_NAND_FOUND: 1 NAND chips(chip size : 134217728) detected
*May 3 11:39:59: %UPGRADE-5-EXTITEM_INSTALLED: File /web/ucs_gb.db has been installed in flash.
*May 3 11:40:02: %UPGRADE-5-EXTITEM_INSTALLED: File /web/ucs_big5.db has been installed in flash.
*May 3 11:40:07: %UPGRADE-5-EXTITEM_INSTALLED: File /web/update_list.txt has been installed in flash.
*May 3 11:40:07: %STACK-5-FINISH: (Device 1): All software images installed.
*May 3 11:40:07: %DEVICE-5-CHANGED: Device S2928G-E (1) changed state to up.