Firefly开源社区

标题: 更新resource.img和kernel.img没变化 [打印本页]

作者: mianhuacar    时间: 2015-11-15 23:54
标题: 更新resource.img和kernel.img没变化
按着这哩弄hello-led,http://developer.t-firefly.com/f ... &extra=page%3D1
1、在drivers文件夹下建文件夹sai
2、在sai下放好hello.c,makefile,kconfig
3、在dirvers下的makefile,kconfig添加好东西
4、在kernel下make menuconfig设置hello编译到内核
5、make
6、烧录resource.img和kernel.img
重启板子,发现led并没有闪
dts我是这样改的:
firefly-led{
             compatible = "firefly,led";
             led-work = <&gpio1 GPIO_C7 GPIO_ACTIVE_LOW>;
             led-power = <&gpio1 GPIO_C6 GPIO_ACTIVE_LOW>;
             status = "disabled";
        };

        hello-led{
                compatible = "firefly,hello_led";
                led= <&gpio1 GPIO_C6 GPIO_ACTIVE_LOW>;//这里我改成黄色的灯
                status = "okay";
        };

        leds {
       compatible = "gpio-leds";
       power {
           label = "firefly:blue:power";
           linux,default-trigger = "ir-power-click";
           default-state = "on";
           gpios = <&gpio1 GPIO_C7 GPIO_ACTIVE_LOW>;
       };
        user {
           label = "firefly:yellow:user";
           linux,default-trigger = "ir-user-click";
           default-state = "off";
           gpios = <&gpio1 GPIO_C6 GPIO_ACTIVE_LOW>;
           };
        };
hello.c里关键是这样的:
#ifdef CONFIG_OF
static const struct of_device_id of_firefly_hello_match[] = {
        { .compatible = "firefly,hello_led" },
        { /* Sentinel */ }
};
#endif

static struct platform_driver firefly_hello_driver = {
        .probe          = firefly_hello_probe,
        .remove         = firefly_hello_remove,
        .driver         = {
                .name   = "firefly_hello",
                .owner  = THIS_MODULE,
#ifdef CONFIG_OF
                .of_match_table = of_firefly_hello_match,
#endif
        },

};



查看板子的dmesg也没看到hello模块加载的printk,请问我哪里弄错了呢?
作者: mianhuacar    时间: 2015-11-15 23:56
补充一下,在源码目录里可以看到hello.c文件有被编译
作者: madman    时间: 2015-11-16 09:17
有可能是boot。img里面包含了kernel,会默认先使用里面的kernel,不包含kernel的boot一般1点多m
作者: linjc    时间: 2015-11-16 09:28
接串口看一下log信息,看打印出来的内核编译时间是不是你编译的时间,可以确定板子是否运行你编译的内核
作者: mianhuacar    时间: 2015-11-16 23:02
linjc 发表于 2015-11-16 09:28
接串口看一下log信息,看打印出来的内核编译时间是不是你编译的时间,可以确定板子是否运行你编译的内核

请问怎么看内核编译的时间?

Terminal ready
reboot

[   89.642991] SysRq : Emergency Remount R/O
[   89.648292] EXT4-fs (rknand_cache): re-mounted. Opts: (null)
[   89.650026] EXT4-fs (rknand_metadata): re-mounted. Opts: (null)
[   89.658454] EXT4-fs (rknand_userdata): re-mounted. Opts: (null)
[   89.673848] Emergency Remount complete
[   89.766100] cpufreq: cpufreq: reboot set core rate=1008000000, volt=1175000
[   89.786169] rk-hdmi 20034000.hdmi: rk hdmi shut down.
[   89.792260] dwc_otg_driver_shutdown: disconnect USB device mode
[   89.798119] rknand_shutdown...
[   89.801165] nand th quited
[   89.803832] wait for rk nand bg quit
[   89.806076] nand_blktrans_bg_thread quit
[   89.856758] rknand_shutdown:OK
[   89.859802] rk818_shutdown
[   89.962006] Restarting system with command ''.
DDR Version 2.04 20150121
In
1A1A2A2B   0
1A1A2A2A   3
LPDDR2
2A2A2A2A   F
Bus Width=32 Col=10 Bank=8 Row=14 CS=2 Die Bus-Width=32 Size=1024MB
mach:14
OUT
Boot1 Release Time: 2015-05-25, version: 2.25
ChipType = a 1374
No.1 FLASH ID:ad de 14 a7 42 4a
ECC:60
*V«k%¹¥Ñõ0 20
StorageInit ok = 703407
theL¿HšHšÕœœÑ2014.10-RK3128-10 (Jun 12 2015 - 09:11:25)

CPU: rk3128
CPU's clock information:
    arm pll = 300000000HZ
    periph pll = 594000000HZ
    ddr pll = 600000000HZ
    codec pll = 400000000HZ
Board:        Rockchip platform Board
Uboot as second level loader
DRAM:  Found dram banks:1
Adding bank:0000000060000000(0000000040000000)
128 MiB
rk dmaü.×K…•init OK!
Using default environment

GetParam
check parameter success
Unknow param: MACHINE_MODEL:rk312x!
Unknow param: MACHINE_ID:007!
Unknow param: MANUFACTURER:RK30SDK!
power key: bank-3 pin-23
can't find dts node for ricoh619
can't find dts node for act8846
can't find dts node for rk808
++++ LDO3 write 0x03 to regular
cpu_det GPIO pull up
pmic:rk818
Can't find dts node for fuel guage cw201x
can't find dts node for ADC
SecureBootEn = 0, SecureBootLock = 0

#Boot ver: 2015-06-12#2.25
empty serial no.
checkKey
vbus = 1
read logo_on switch from dts [1]
can't find power_ctr node for lcdc0
failed to find part:logo
Hit any key to stop autoboot:  1  0
ERROR: [get_entry_ram]: Cannot find logo_kernel.bmp!
Secure Boot state: 0
kernel   @ 0x62000000 (0x00690a08)
ramdisk  @ 0x65bf0000 (0x00159884)
bootrk: do_bootm_linux...
   Loading Device Tree to 65600000, end 65616309 ... OK
Add bank:0000000060000000, 0000000040000000

Starting kernel ...

<hit enter to activate fiq debugger>
[    0.000000] Booting Linux on physical CPU 0xf00
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.0 (firefly@tchip-server) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #55 SMP PREEMPT Thu Aug 6 12:04:20 CST 2015
作者: linjc    时间: 2015-11-17 17:17
mianhuacar 发表于 2015-11-16 23:02
请问怎么看内核编译的时间?

Terminal ready

Linux version 3.10.0 (firefly@tchip-server) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #55 SMP PREEMPT Thu Aug 6 12:04:20 CST 2015
这里编译时间:Aug 6 12:04:20 CST 2015
作者: mianhuacar    时间: 2015-11-17 23:34
linjc 发表于 2015-11-17 17:17
Linux version 3.10.0 (firefly@tchip-server) (gcc version 4.6.x-google 20120106 (prerelease) (GCC)  ...

谢谢linjc,之前是出厂的双系统,现在更新到官方的案桌单系统就可以了,终于看到黄色的LED闪10下。
作者: ycbs    时间: 2020-4-17 14:49
学习了




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1