Content originally posted in LPCWare by bomellberg on Fri Nov 28 02:15:34 MST 2014
Hi,
I'm working on a custom board with LPC4337 and uClinux. I am hoping on using this thread as a diary on how to get uClinux up and running with a Wifi device.
I have already gotten a lot of help from Wolfgang at Denx (to get U-boot up) and Vlad at Emcraft (to get uCLinux up). I bought the BSD package for the LPC4550 as a starting point.
If I can assist in any way, feel free to ask questions in this thread. I have attached the board.c-file and the ea-lpc4357.h (for U-boot) that are tuned to my custom board.
Now, my current issue is getting the USB drivers for uClinux to work, but first, does anyone know why I get dual console messages at boot of uClinux?:
U-Boot 2010.03 (nov 25 2014 - 08:13:54) CPU : LPC43xx series (Cortex-M4/M0) Freqs: SYSTICK=204MHz,CCLK=204MHz Board: Physio-Control 200130-00 1 DRAM: 32 MB Using default environment In: serial Out: serial Err: serial SPIFI lib found at address 0x1A01C000 Hit any key to stop autoboot: 0 EA-LPC4357-EVAL> setenv bootargs lpc18xx_platform=ea-lpc4357 console=ttyS1,115200 panic=10 EA-LPC4357-EVAL> bootm 0x80001000 ## Booting kernel from Legacy Image at 80001000 ... Image Name: Linux-2.6.33-arm1 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3706368 Bytes = 3.5 MB Load Address: 30008000 Entry Point: 30008001 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... <5>Linux version 2.6.33-arm1 (bosse@bolinux) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #39 Thu Nov 27 15:52:29 CET 2014 CPU: ARMv7-M Processor [410fc241] revision 1 (ARMv7M) CPU: NO data cache, NO instruction cache Machine: NXP LPC18xx <7>On node 0 totalpages: 8192 <7>free_area_init_node: node 0, pgdat 30390764, node_mem_map 303a1000 <7> Normal zone: 64 pages used for memmap <7> Normal zone: 0 pages reserved <7> Normal zone: 8128 pages, LIFO batch:0 Built 1 zonelists in Zone order, mobility grouping off. Total pages: 8128 <5>Kernel command line: lpc18xx_platform=ea-lpc4357 console=ttyS1,115200 panic=10 <6>PID hash table entries: 128 (order: -3, 512 bytes) <6>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) <6>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) <6>Memory: 32MB = 32MB total <5>Memory: 28804k/28804k available, 3964k reserved, 0K highmem <5>Virtual kernel memory layout: vector : 0x00000000 - 0x00001000 ( 4 kB) fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) vmalloc : 0x00000000 - 0xffffffff (4095 MB) lowmem : 0x30000000 - 0x32000000 ( 32 MB) modules : 0x30000000 - 0x50000000 ( 512 MB) .init : 0x30008000 - 0x30237000 (2236 kB) .text : 0x30237000 - 0x3037a000 (1292 kB) .data : 0x3037a000 - 0x30390e00 ( 92 kB) <6>Hierarchical RCU implementation. <6>NR_IRQS:53 <4>lpc18xx_clock_init: unsupported platform 2 <6>Calibrating delay loop... <c>53.04 BogoMIPS (lpj=265216) Mount-cache hash table entries: 512 <6>NET: Registered protocol family 16 bio: create slab <bio-0> at 0 <6>usbcore: registered new interface driver usbfs <6>usbcore: registered new interface driver hub <6>usbcore: registered new device driver usb <6>Switching to clocksource cm3-systick <6>NET: Registered protocol family 2 <6>IP route cache hash table entries: 1024 (order: 0, 4096 bytes) <6>TCP established hash table entries: 1024 (order: 1, 8192 bytes) <6>TCP bind hash table entries: 1024 (order: 0, 4096 bytes) <6>TCP: Hash tables configured (established 1024 bind 1024) <6>TCP reno registered <6>RPC: Registered udp transport module. <6>RPC: Registered tcp transport module. <6>RPC: Registered tcp NFSv4.1 backchannel transport module. <6>JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. <6>alg: No test for stdrng (krng) <6>Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) <6>io scheduler noop registered <6>io scheduler deadline registered <6>io scheduler cfq registered (default) <6>Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled <6>serial8250.2: ttyS0 at MMIO 0x400c1000 (irq = 26) is a 16550A ÿ<6>serial8250.3: ttyS1 at MMIO 0x400c2000 (irq = 27) is a 16550A Linux version 2.6.33-arm1 (bosse@bolinux) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #39 Thu Nov 27 15:52:29 CET 2014 CPU: ARMv7-M Processor [410fc241] revision 1 (ARMv7M) CPU: NO data cache, NO instruction cache Machine: NXP LPC18xx Built 1 zonelists in Zone order, mobility grouping off. Total pages: 8128 Kernel command line: lpc18xx_platform=ea-lpc4357 console=ttyS1,115200 panic=10 PID hash table entries: 128 (order: -3, 512 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 32MB = 32MB total Memory: 28804k/28804k available, 3964k reserved, 0K highmem Virtual kernel memory layout: vector : 0x00000000 - 0x00001000 ( 4 kB) fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) vmalloc : 0x00000000 - 0xffffffff (4095 MB) lowmem : 0x30000000 - 0x32000000 ( 32 MB) modules : 0x30000000 - 0x50000000 ( 512 MB) .init : 0x30008000 - 0x30237000 (2236 kB) .text : 0x30237000 - 0x3037a000 (1292 kB) .data : 0x3037a000 - 0x30390e00 ( 92 kB) Hierarchical RCU implementation. NR_IRQS:53 lpc18xx_clock_init: unsupported platform 2 Calibrating delay loop... 53.04 BogoMIPS (lpj=265216) Mount-cache hash table entries: 512 NET: Registered protocol family 16 bio: create slab <bio-0> at 0 usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb Switching to clocksource cm3-systick NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) TCP reno registered RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. alg: No test for stdrng (krng) Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled serial8250.2: ttyS0 at MMIO 0x400c1000 (irq = 26) is a 16550A serial8250.3: ttyS1 at MMIO 0x400c2000 (irq = 27) is a 16550A <6>console [ttyS1] enabled console [ttyS1] enabled <6>usbcore: registered new interface driver ub usbcore: registered new interface driver ub <6>TCP cubic registered TCP cubic registered <6>NET: Registered protocol family 17 NET: Registered protocol family 17 <6>lib80211: common routines for IEEE802.11 drivers lib80211: common routines for IEEE802.11 drivers <7>lib80211_crypt: registered algorithm 'NULL' <6>ARMv7-M VFP Extension supported ARMv7-M VFP Extension supported <6>Freeing init memory: 2236K Freeing init memory: 2236K init started: BusyBox v1.17.0 (2014-11-27 15:52:02 CET) ~ # |
As you can see, "Linux version ..." comes twice, and a lot of the console messages are doubled??
Thanks,
/Bo
Original Attachment has been moved to: board_0.c.zip
Original Attachment has been moved to: ea-lpc4357_0.h.zip
CONFIG_ARM_V7M_NO_UNALIGN_TRP=y |
usb 1-1: new high speed USB device using lpc43xx-ehci and address 2 ~ # lsusb Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 002: ID 0bda:0724 ~ # |
/root # insmod 8723au.ko RTL871X: rtl8723as-vau driver version=v4.1.6_7336.20130426 RTL871X: build time: Dec 9 2014 09:56:52 RTL871X: usb_endpoint_descriptor(0): RTL871X: bLength=7 RTL871X: bDescriptorType=5 RTL871X: bEndpointAddress=84 RTL871X: wMaxPacketSize=512 RTL871X: bInterval=0 RTL871X: RT_usb_endpoint_is_bulk_in = 4 RTL871X: usb_endpoint_descriptor(1): RTL871X: bLength=7 RTL871X: bDescriptorType=5 RTL871X: bEndpointAddress=5 RTL871X: wMaxPacketSize=512 RTL871X: bInterval=0 RTL871X: RT_usb_endpoint_is_bulk_out = 5 RTL871X: usb_endpoint_descriptor(2): RTL871X: bLength=7 RTL871X: bDescriptorType=5 RTL871X: bEndpointAddress=6 RTL871X: wMaxPacketSize=512 RTL871X: bInterval=0 RTL871X: RT_usb_endpoint_is_bulk_out = 6 RTL871X: usb_endpoint_descriptor(3): RTL871X: bLength=7 RTL871X: bDescriptorType=5 RTL871X: bEndpointAddress=87 RTL871X: wMaxPacketSize=64 RTL871X: bInterval=3 RTL871X: RT_usb_endpoint_is_int_in = 7, Interval = 3 RTL871X: nr_endpoint=4, in_num=2, out_num=2 RTL871X: USB_SPEED_HIGH RTL871X: CHIP TYPE: RTL8723A RTL871X: rtw_handle_dualmac(): pbuddy_padapter == NULL, Set pbuddy_padapter RTL871X: register rtw_netdev_ops to netdev_ops RTL871X: Chip Version Info: CHIP_8723A_Normal_Chip_UMC_B_CUT_1T1R_RomVer(0) RTL871X: RF_Type is 3!! RTL871X: EEPROM type is E-FUSE RTL871X: ====> _ReadAdapterInfo8723AU RTL871X: Boot from EFUSE, Autoload OK ! RTL871X: hal_EfuseSwitchToBank: Efuse switch bank to 0 RTL871X: hal_ReadEFuse_WiFi: data end at address=0x9a KERNEL: fault at 0x30b2de8c [pc=0x30b2de8c, sp=0x3001dcf8] Illegal unaligned access Pid: 164, comm: insmod CPU: 0 Not tainted (2.6.33-arm1 #56) pc : [<30b2de8c>] lr : [<30b2e13f>] psr: 6100000b sp : 3001dcf8 ip : 00000000 fp : 30033ec0 Code dump at pc [30b2de8c]: 30b7f8b1 f8b18763 87a110b9 8f614803 r10: 30419709 r9 : 3000fc00 r8 : 30307da0 r7 : 30033ec0 r6 : 3003b0a8 r5 : 3001dd10 r4 : 3003c000 r3 : 00000000 r2 : 00000000 r1 : 3001dd10 r0 : 3003bda8 Flags: nZCv IRQs on FIQs on Mode UK11_26 ISA unknown Segment kernel Kernel panic - not syncing: Rebooting in 10 seconds... |
#ifndef _MACH_SCU_H_ #define _MACH_SCU_H_ /* * SCU (System Control Unit) register map */ struct lpc18xx_scu_regs { u32 sfs[802];/* Pin configuration registers */ u32 enaio0;/* ADC0 function select register */ u32 enaio1;/* ADC1 function select register */ u32 enaio2;/* Analog function select register */ u32 rsv0[27]; u32 emcdelayclk;/* EMC clock delay register */ u32 rsv1[63]; u32 pintsel0;/* Pin interrupt select for interrupts 0 to 3 */ u32 pintsel1;/* Pin interrupt select for interrupts 4 to 7 */ }; /* * SCU registers base */ #define LPC18XX_SCU_BASE0x40086000 #define LPC18XX_SCU((volatile struct lpc18xx_scu_regs *) \ LPC18XX_SCU_BASE) #endif /* _MACH_SCU_H_ */ |
~ # lsusb Bus 001 Device 001: ID 1d6b:0002 ~ # |
1d6b Linux Foundation 0001 1.1 root hub 0002 2.0 root hub 0003 3.0 root hub 0100 PTP Gadget 0101 Audio Gadget 0102 EEM Gadget 0103 NCM (Ethernet) Gadget 0104 Multifunction Composite Gadget 0105 FunctionFS Gadget 0200 Qemu Audio Device |
~ # insmod /root/8723au.ko RTL871X: rtl8723as-vau driver version=v4.1.6_7336.20130426 RTL871X: build time: Dec 9 2014 09:56:52 usbcore: registered new interface driver rtl8723au ~ # |
~ # lsusb Bus 001 Device 001: ID 1d6b:0002 ~ # |
Starting kernel ... ÿLinux version 2.6.33-arm1 (bosse@bolinux) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-189) ) #25 Thu Dec 4 11:27:44 CET 2014 CPU: ARMv7-M Processor [410fc241] revision 1 (ARMv7M) CPU: NO data cache, NO instruction cache Machine: NXP LPC18xx Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064 Kernel command line: lpc18xx_platform=ea-lpc4357 console=ttyS1,115200 panic=10 mem=16M PID hash table entries: 64 (order: -4, 256 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 16MB = 16MB total Memory: 11764k/11764k available, 4620k reserved, 0K highmem Virtual kernel memory layout: vector : 0x00000000 - 0x00001000 ( 4 kB) fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) vmalloc : 0x00000000 - 0xffffffff (4095 MB) lowmem : 0x30000000 - 0x31000000 ( 16 MB) modules : 0x30000000 - 0x01000000 (3344 MB) .init : 0x30008000 - 0x302f8000 (3008 kB) .text : 0x302f8000 - 0x30440000 (1312 kB) .data : 0x30440000 - 0x30457c60 ( 96 kB) Hierarchical RCU implementation. NR_IRQS:53 lpc18xx_clock_init: unsupported platform 2 Calibrating delay loop... 53.45 BogoMIPS (lpj=267264) Mount-cache hash table entries: 512 NET: Registered protocol family 16 bio: create slab <bio-0> at 0 usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb Switching to clocksource cm3-systick NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes) TCP: Hash tables configured (established 512 bind 512) TCP reno registered RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. alg: No test for stdrng (krng) Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254) io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled serial8250.2: ttyS0 at MMIO 0x400c1000 (irq = 26) is a 16550A serial8250.3: ttyS1 at MMIO 0x400c2000 (irq = 27) is a 16550A console [ttyS1] enabled usbcore: registered new interface driver ub m25p80_spifi m25p80_spifi: found s25fl256s1, expected (null) m25p80_spifi m25p80_spifi: s25fl256s1 (32768 Kbytes) Creating 3 MTD partitions on "m25p80_spifi": 0x000000000000-0x000000010000 : "flash_uboot" 0x000000010000-0x000001000000 : "flash_linux_image" 0x000001000000-0x000002000000 : "flash_jffs2" ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver lpc43xx-ehci lpc43xx-ehci: LPC43XX EHCI lpc43xx-ehci lpc43xx-ehci: new USB bus registered, assigned bus number 1 lpc43xx-ehci lpc43xx-ehci: irq 9, io mem 0x40007000 lpc43xx-ehci lpc43xx-ehci: USB 0.0 started, EHCI 1.00 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected TCP cubic registered NET: Registered protocol family 17 lib80211: common routines for IEEE802.11 drivers ARMv7-M VFP Extension supported Freeing init memory: 3008K init started: BusyBox v1.17.0 (2014-12-04 10:08:23 CET) usb 1-1: new full speed USB device using lpc43xx-ehci and address 2 ~ # usb 1-1: device descriptor read/64, error -71 usb 1-1: device descriptor read/64, error -71 usb 1-1: new full speed USB device using lpc43xx-ehci and address 3 usb 1-1: device descriptor read/64, error -71 usb 1-1: device descriptor read/64, error -71 usb 1-1: new full speed USB device using lpc43xx-ehci and address 4 usb 1-1: device not accepting address 4, error -71 usb 1-1: new full speed USB device using lpc43xx-ehci and address 5 usb 1-1: device not accepting address 5, error -71 hub 1-0:1.0: unable to enumerate USB device on port 1 |
~ # insmod /root/compat.ko Compat-wireless backport release: compat-wireless-v3.4-rc3-1 Backport based on linux-stable.git v3.4-rc3 ~ # insmod /root/cfg80211.ko cfg80211: Calling CRDA to update world regulatory domain ~ # insmod /root/mac80211.ko ~ # insmod /root/8723au.ko usbcore: registered new interface driver rtl8723au |
~ # ifconfig wlan0 up ifconfig: SIOCGIFFLAGS: No such device |
usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb |
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver |
usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb . . . usbcore: registered new interface driver ub |
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver |