搜索
bottom↓
回复: 19

GD32F450替换STM32F429运行uClinux初步成功

[复制链接]

出0入0汤圆

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

除了主芯片换成GD32F450,内存也升级到镁光的64MB SDRAM。
然后连接板子到电脑(使用USB转串口,提供供电+通信)


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

上电,u-boot,linux启动成功(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寄存器兼容但是还是有不一样的地方,要是有了解这些区别的朋友指点就好了。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2017-4-26 19:39:41 | 显示全部楼层
楼主纯粹是闲的,用这么操蛋的芯片去折腾

出0入0汤圆

发表于 2017-4-26 19:39:56 | 显示全部楼层
楼主纯粹是闲的,用这么操蛋的芯片去折腾

出0入0汤圆

发表于 2017-4-27 09:43:03 | 显示全部楼层
这个芯片就是山寨STM32吧,以前记得编的STM32代码啥也不用改直接往里面烧。

出0入0汤圆

发表于 2017-4-27 13:17:05 | 显示全部楼层
楼主这个芯片多少钱一片?

出0入0汤圆

 楼主| 发表于 2017-4-27 15:20:36 | 显示全部楼层
liyang121316 发表于 2017-4-27 09:43
这个芯片就是山寨STM32吧,以前记得编的STM32代码啥也不用改直接往里面烧。

是的。因为兼容所有想试试。测试后发现还是有不一样的地方(比如以太网,USB,SDIO。。。)

出0入0汤圆

 楼主| 发表于 2017-4-27 15:22:08 | 显示全部楼层
wangzheyu 发表于 2017-4-27 13:17
楼主这个芯片多少钱一片?

基本上就是F429的七、八折吧。

出10入18汤圆

发表于 2017-4-27 15:40:45 来自手机 | 显示全部楼层
F4这么多外设,搞linux驱动还不得吐血啊

出0入0汤圆

发表于 2017-4-27 15:44:10 | 显示全部楼层
那这个GD32F4山寨的芯片真恶心,买它的芯片样品搞得神神密密的。这么做有什么意义呢。

出0入0汤圆

 楼主| 发表于 2017-4-27 15:48:21 | 显示全部楼层
TIANYJ 发表于 2017-4-27 15:44
那这个GD32F4山寨的芯片真恶心,买它的芯片样品搞得神神密密的。这么做有什么意义呢。 ...

搞神秘也许有不能说的秘密:)

出0入0汤圆

发表于 2017-4-29 00:53:08 | 显示全部楼层
7802848 发表于 2017-4-26 19:39
楼主纯粹是闲的,用这么操蛋的芯片去折腾

说的对,闲的蛋疼

出0入0汤圆

发表于 2017-4-29 07:48:47 来自手机 | 显示全部楼层
uboot是楼主自己写的还是那么可以下载??

出0入50汤圆

发表于 2017-4-29 09:03:20 来自手机 | 显示全部楼层
老实讲,为省这百分之二三十的芯片成本,却要去冒整个产品方案可能的隐含BUG,非常划不来,也就十几二十软妹币的事儿,用到这个尺寸MCU的产品,不至于差这点成本吧?很有点刀口上舔血的感觉。

出0入0汤圆

 楼主| 发表于 2017-5-2 15:08:02 | 显示全部楼层
soos 发表于 2017-4-29 07:48
uboot是楼主自己写的还是那么可以下载??

STM32F429的u-boot有现成的,但是根据我的板子做了修改。直接烧到GD32F450板子上就能工作:)

出0入0汤圆

发表于 2017-5-2 15:40:06 | 显示全部楼层
看到新的芯片,两眼放光,有空折腾一下,挺好的。

出5入4汤圆

发表于 2020-2-3 22:04:28 | 显示全部楼层
楼说有人评论说楼主闲的蛋疼,现在毛衣战打起来了,我们的主营产品也要开始用这个片子咯

出0入0汤圆

 楼主| 发表于 2020-2-7 13:25:39 | 显示全部楼层
tim4146 发表于 2020-2-3 22:04
楼说有人评论说楼主闲的蛋疼,现在毛衣战打起来了,我们的主营产品也要开始用这个片子咯 ...

现在没心思搞这些了,先安全的渡过新冠疫情再说吧。

出5入4汤圆

发表于 2020-2-8 11:07:58 | 显示全部楼层
htjgdw 发表于 2020-2-7 13:25
现在没心思搞这些了,先安全的渡过新冠疫情再说吧。

我们10号就要上班了,到时候估计写代码,吃饭都要戴口罩了

出0入0汤圆

 楼主| 发表于 2020-2-22 17:08:59 | 显示全部楼层
tim4146 发表于 2020-2-8 11:07
我们10号就要上班了,到时候估计写代码,吃饭都要戴口罩了

安全第一。其他都是次要的。

出0入0汤圆

发表于 2021-9-15 18:55:46 | 显示全部楼层
楼主有教程嘛?
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子论坛 -- 东莞阿莫电子网站 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2022-10-2 04:56

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表