打印

GD32F450替换STM32F429运行uClinux初步成功

[复制链接]
16659|45
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 不爱说话 于 2017-4-24 20:49 编辑

用STM32F429成功跑uClinux有一段时间了我的STM32F429开发板成功运行Linux4.2(uClinux)
然后就一直琢磨能不能用GD32F4替换,于是开始寻找这个芯片。很难找淘宝上没有卖的,代理也不能随便给,需要向原厂提交项目信息填表。最后在论坛里一位好心的朋友那里买到了这个芯片。
芯片寄到后马上焊了一片板子出来。
  

除了主芯片换成GD32F450,内存也升级到镁光的64MB SDRAM。

然后连接板子到电脑(使用USB转串口,提供供电+通信)


电脑上没有GD的串口下载软件,之前听说过GD32和STM32兼容,所以尝试着用ST FlashLoader,没想到奇迹出现了,居然可以下载程序,真是没想到!

上电,u-boot启动成功(log里的STM32还没有修改,其实已经是GD32了:))!

U-Boot 2010.03 (Apr 13 2017 - 20:10:13)
CPU  : STM32F4 (Cortex-M4)
Freqs: SYSCLK=168MHz,HCLK=168MHz,PCLK1=42MHz,PCLK2=84MHz
Board: STM32F429-DISCOVERY Rev 1.A
spi_init
DRAM:  64 MB
In:    serial
Out:   serial
Err:   serial
Net:   miiphy_register done.
stm_phy_init: found PHY id = 0x7c0f1 at addr 0x0
eth hw init done.
STM32_MAC
Hit any key to stop autoboot:  0
STM32F429-DISCO> run spiboot
16384 KiB W25Q128 at 0:0 is now current device
## Booting kernel from Legacy Image at c0007fb4 ...
   Image Name:   Linux-4.2.0
   Image Type:   ARM Linux Multi-File Image (uncompressed)
   Data Size:    5914306 Bytes =  5.6 MB
   Load Address: c0008000
   Entry Point:  c0008001
   Contents:
      Image 0: 5898800 Bytes =  5.6 MB
      Image 1: 15494 Bytes = 15.1 kB
   Verifying Checksum ... OK
## Flattened Device Tree from multi component Image at C0007FB4
   Booting using the fdt at 0xc05a8230
   Loading Multi-File Image ... OK
OK
   Loading Device Tree to c3ff9000, end c3fffc85 ... OK
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.2.0 (hw@localhost.localdomain) (gcc version 4.4.1 (Sourcery G++ Li
te 2010q1-189) ) #99 Thu Mar 2 19:28:39 CST 2017
CPU: ARMv7-M [410fc241] revision 1 (ARMv7M), cr=00000000
CPU: unknown data cache, unknown instruction cache
Machine model: EmCraft Systems STM32F4x9-SOM board
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: stm32_platform=stm-disco console=ttyS0,115200 panic=10 ip=169
.254.1.10:169.254.1.2:::stm-disco:eth0:on
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 59004K/65536K available (2291K kernel code, 165K rwdata, 648K rodata, 2652
K init, 96K bss, 6532K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
    modules : 0xc0000000 - 0xc1000000   (  16 MB)
      .text : 0xc0008000 - 0xc02e7000   (2940 kB)
      .init : 0xc02e7000 - 0xc057e000   (2652 kB)
      .data : 0xc057e000 - 0xc05a74e0   ( 166 kB)
       .bss : 0xc05a8230 - 0xc05c04e4   (  97 kB)
NR_IRQS:16 nr_irqs:16 16
clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 3
55517175 ns
ARM System timer initialized as clocksource
[url=]/soc/timer@40000000[/url]: STM32 clockevent driver initialized (32 bits)
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 214748364750000
00ns
Calibrating delay loop... 28.67 BogoMIPS (lpj=143360)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126
04462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
stm32-pinctrl pin-controller: nbanks = 11
stm32-pinctrl pin-controller: nfunctions = 13
stm32-pinctrl pin-controller: ngroups = 15
stm32-pinctrl pin-controller: GPIOA bank added.
stm32-pinctrl pin-controller: GPIOB bank added.
stm32-pinctrl pin-controller: GPIOC bank added.
stm32-pinctrl pin-controller: GPIOD bank added.
stm32-pinctrl pin-controller: GPIOE bank added.
stm32-pinctrl pin-controller: GPIOF bank added.
stm32-pinctrl pin-controller: GPIOG bank added.
stm32-pinctrl pin-controller: GPIOH bank added.
stm32-pinctrl pin-controller: GPIOI bank added.
stm32-pinctrl pin-controller: GPIOJ bank added.
stm32-pinctrl pin-controller: GPIOK bank added.
stm32-pinctrl pin-controller: Function[0         name:i2c_1,    groups:1]
stm32-pinctrl pin-controller: Function[1         name:i2c_2,    groups:1]
stm32-pinctrl pin-controller: Function[2         name:i2c_3,    groups:1]
stm32-pinctrl pin-controller: Function[3         name:mac,      groups:2]
stm32-pinctrl pin-controller: Function[4         name:sdio,     groups:1]
stm32-pinctrl pin-controller: Function[5         name:spi_1,    groups:1]
stm32-pinctrl pin-controller: Function[6         name:spi_4,    groups:1]
stm32-pinctrl pin-controller: Function[7         name:spi_5,    groups:1]
stm32-pinctrl pin-controller: Function[8         name:usart1,   groups:1]
stm32-pinctrl pin-controller: Function[9         name:usart7,   groups:1]
stm32-pinctrl pin-controller: Function[10        name:usb_fs,   groups:1]
stm32-pinctrl pin-controller: Function[11        name:usb_hs,   groups:1]
stm32-pinctrl pin-controller: Function[12        name:gpio,     groups:2]
stm32_dma 40026000.dma: STM32 DMA Controller ( slave ), 8 channels
stm32_dma 40026400.dma: STM32 DMA Controller ( slave ), 8 channels
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
soc:phy_fs supply vcc not found, using dummy regulator
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@lin
ux.it>
PTP clock support registered
Bluetooth: Core ver 2.20
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
clocksource: Switched to clocksource arm_system_timer
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
futex hash table entries: 16 (order: -5, 192 bytes)
jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
fuse init (API version 7.23)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
io scheduler noop registered
io scheduler cfq registered (default)
STM32 USART driver initialized
stm32-pinctrl pin-controller: maps: function usart1 group usart1-0 num 3
40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 19, base_baud = 5250000) is a stm
32-usart
console [ttyS0] enabled
stm32-pinctrl pin-controller: maps: function spi_1 group spi_1-0 num 4
m25p80 spi0.0: found w25q128, expected m25p32
m25p80 spi0.0: w25q128 (16384 Kbytes)
2 ofpart partitions found on MTD device spi0.0
Creating 2 MTD partitions on "spi0.0":
0x000000000000-0x000000600000 : "spi_flash_part0"
0x000000600000-0x000001000000 : "spi_flash_part1"
stm32-spi 40013000.spi: SPI Controller 0 at 40013000,irq=21,hz=84000000
stm32-pinctrl pin-controller: maps: function mac group mac_rmii num 10
Ring mode enabled
No HW DMA feature register supported
Normal descriptors
Wake-Up On Lan supported
libphy: stmmac: probed
eth0: PHY ID 0007c0f1 at 0 IRQ POLL (stmmac-0:00) active
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
usbcore: registered new interface driver rt2800usb
stm32-pinctrl pin-controller: maps: function usb_hs group usb_hs-0 num 3
dwc2 40040000.usb: Bad value for GSNPSID: 0x00000000
stm32-pinctrl pin-controller: maps: function usb_fs group usb_fs-0 num 3
dwc2 50000000.usb: Bad value for GSNPSID: 0x00000000
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
stm32-rtc 40002800.rtc: rtc core: registered 40002800.rtc as rtc0
i2c /dev entries driver
usbcore: registered new interface driver btusb
stm32-pinctrl pin-controller: maps: function sdio group sdio-0 num 7
mmci-pl18x 40012c00.sdi: Got CD GPIO
mmci-pl18x 40012c00.sdi: No vqmmc regulator found
mmci-pl18x 40012c00.sdi: mmc0: PL180 manf 80 rev4 at 0x40012c00 irq 20,0 (pio)
mmci-pl18x 40012c00.sdi: DMA channels RX dma1chan3, TX dma1chan3
stm32-pinctrl pin-controller: maps: function gpio group outs num 2
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 17
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
stm32-rtc 40002800.rtc: setting system clock to 2000-01-01 00:00:01 UTC (946684801
)
RX IPC Checksum Offload disabled
No MAC Management Counters available
IP-Config: Guessing netmask 255.255.0.0
IP-Config: Complete:
     device=eth0, hwaddr=c0:b1:3c:88:88:85, ipaddr=169.254.1.10, mask=255.255.0.0,
gw=255.255.255.255
     host=stm-disco, domain=, nis-domain=(none)
     bootserver=169.254.1.2, rootserver=169.254.1.2, rootpath=
vmmc: disabling
Freeing unused kernel memory: 2652K (c02e7000 - c057e000)
init started: BusyBox v1.17.0 (2016-12-07 22:30:10 CST)
/ # random: nonblocking pool is initialized
/ #


后来测试了GPIO正常,RTC正常,很遗憾网络,USB,SDIO功能都不工作,看来GD32和STM32还是有不同的地方,要是有了解这些区别的朋友指点就好了。可以今天先写到这里。
沙发
21ic大掌柜| | 2017-4-25 11:33 | 只看该作者
感谢分享

使用特权

评论回复
板凳
不爱说话|  楼主 | 2017-4-25 20:41 | 只看该作者
谢谢大掌柜关注!

使用特权

评论回复
地板
whirt_noob| | 2017-4-26 08:59 | 只看该作者
GD的芯片对比ST芯片在价格上有优势吗?

使用特权

评论回复
5
不爱说话|  楼主 | 2017-4-26 11:10 | 只看该作者
whirt_noob 发表于 2017-4-26 08:59
GD的芯片对比ST芯片在价格上有优势吗?

我感觉GD32就是STM32八折的样子。

使用特权

评论回复
6
xyz549040622| | 2017-4-27 08:01 | 只看该作者
不爱说话 发表于 2017-4-26 11:10
我感觉GD32就是STM32八折的样子。

同意,也就是这个价格了。

使用特权

评论回复
7
cruelfox| | 2017-4-28 09:39 | 只看该作者
厉害了。
有时间的时候我也折腾下uCLinux.

使用特权

评论回复
8
不爱说话|  楼主 | 2017-4-28 22:56 | 只看该作者
cruelfox 发表于 2017-4-28 09:39
厉害了。
有时间的时候我也折腾下uCLinux.

玩的人越多越好!

使用特权

评论回复
9
woshizhengjie89| | 2017-5-1 09:24 | 只看该作者
GD和ST在低端的芯片中是完全替代的,但高性能的MCU就有区别了

使用特权

评论回复
10
huaiqiao| | 2017-5-2 20:08 | 只看该作者
http://www.emcraft.com/products/224
这个网站有的文档可以参考么?

硬件方面需要怎么样的配置啊。

我看是要32M的sram和16m的 norflash。

我用正点原子的F407的板子可以实现吗?带的IS62WV51216BLL我记得是8M的ram

使用特权

评论回复
11
不爱说话|  楼主 | 2017-5-3 14:14 | 只看该作者
huaiqiao 发表于 2017-5-2 20:08
http://www.emcraft.com/products/224
这个网站有的文档可以参考么?

可以参考。407 + 8M ram 有点少,编译linux时把网络,usb等功能都去掉,也许可以跑。
还有,你确定你板子上是8MB ram而不是8Mb?

使用特权

评论回复
12
zxmxx| | 2017-5-3 17:54 | 只看该作者

使用特权

评论回复
13
huaiqiao| | 2017-5-3 20:24 | 只看该作者
不爱说话 发表于 2017-5-3 14:14
可以参考。407 + 8M ram 有点少,编译linux时把网络,usb等功能都去掉,也许可以跑。
还有,你确定你板子 ...

不好意思,记错了。。。。我的错。。。。
是8Mb。。。。

使用特权

评论回复
14
triggeror| | 2017-5-7 18:41 | 只看该作者
喔,听着不得了

使用特权

评论回复
15
flyglory| | 2017-5-8 10:51 | 只看该作者
楼主的GD32片子在哪买的

使用特权

评论回复
16
vivilzb1985| | 2017-5-9 21:41 | 只看该作者
这个开发板的资源还是蛮不错

使用特权

评论回复
17
QQ807611163| | 2017-5-10 12:55 | 只看该作者
IS62WV51216BLL   IS61WV51216BLL 我这都有哦

使用特权

评论回复
18
不爱说话|  楼主 | 2017-5-10 16:48 | 只看该作者
vivilzb1985 发表于 2017-5-9 21:41
这个开发板的资源还是蛮不错

谢谢。当初设计的时候想了好久如何布局,外扩哪些外设,引出未用IO方便用户扩展等等。
得到了赞赏,看来没有白费功夫:)

使用特权

评论回复
19
dami| | 2017-5-16 15:10 | 只看该作者
继续继续!!!

使用特权

评论回复
20
angerbird| | 2017-5-16 22:04 | 只看该作者
这个是非常好的消息的

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:飞翼电子工作室 http://shop68798667.taobao.com/

115

主题

886

帖子

34

粉丝