Skip to content

Commit

Permalink
Updating to newer versions of U-Boot and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
François Dugast committed Feb 16, 2018
1 parent eb0d30b commit c2de99c
Show file tree
Hide file tree
Showing 10 changed files with 3,802 additions and 1,390 deletions.
12 changes: 5 additions & 7 deletions Makefile
Expand Up @@ -4,29 +4,27 @@ system_image = stm32f746g-disco_system.uImage
dir_download = downloads
dir_configs = configs
dir_buildroot = buildroot
dir_publish = /srv/tftp/stm32f7/
dir_publish = /srv/tftp/stm32f746/

bootstrap:
mkdir -p $(dir_download)
mkdir -p $(dir_buildroot)
wget -O $(dir_download)/$(archive_buildroot) $(url_buildroot)
tar zxvf $(dir_download)/$(archive_buildroot) -C $(dir_buildroot) --strip-components=1
cd $(dir_buildroot) && patch -p0 < ../patches/buildroot.001_quickfix_elf2flt_passed_to_linker
cd $(dir_buildroot) && patch -p0 < ../patches/buildroot.002_openocd_version_0_10_0
cd $(dir_buildroot) && patch -p0 < ../patches/buildroot.003_openocd_hash
cp $(dir_configs)/buildroot $(dir_buildroot)/.config

build:
make -j10 -C $(dir_buildroot)
./$(dir_buildroot)/output/host/usr/bin/mkimage -A arm -O linux -T multi -a 0xC0008000 -e 0xC0008001 -C none -d \
$(dir_buildroot)/output/images/Image $(dir_buildroot)/output/images/$(system_image)
cp $(dir_buildroot)/output/images/$(system_image) /srv/tftp/stm32f7/$(system_image)
cp $(dir_buildroot)/output/images/stm32f746-disco.dtb ${dir_publish}/
cp $(dir_buildroot)/output/images/zImage ${dir_publish}/

flash_bootloader:
cd $(dir_buildroot)/output/build/host-openocd-0.10.0/tcl && ../../../host/usr/bin/openocd \
-f board/stm32f7discovery.cfg \
-c "program ../../../images/u-boot.bin 0x08000000" \
-c "program ../../../images/uboot-env.bin 0x08020000" \
-c "program ../../../images/u-boot-spl.bin 0x08000000" \
-c "program ../../../images/u-boot.bin 0x08008000" \
-c "reset run" -c shutdown

clean:
Expand Down
104 changes: 23 additions & 81 deletions README.md
Expand Up @@ -3,13 +3,6 @@ Linux on the STM32F746G Discovery board with Buildroot

The project is a set of patches and configuration files to build a bootloader and a Linux based system image with a minimal root file system for the great [STM32F746G Discovery board](http://www.st.com/en/evaluation-tools/32f746gdiscovery.html).

- Buildroot 2017.02.9
- GCC 4.4.1 (external)
- U-Boot from Emcraft
- Linux 2.6.33 from Emcraft with LCD driver
- Busybox
- OpenOCD 0.10.0

Build
-----

Expand All @@ -24,87 +17,36 @@ Then build:


After the build, the directory `buildroot/output/images/` contains
- U-Boot `u-boot.bin` and its environment configuration `uboot-env.bin`
- a U-Boot image `stm32f746g-disco_system.uImage` containing the Linux kernel, a RAM disk linked to it, and the device tree for this board
- U-Boot images `u-boot-spl.bin` and `u-boot.bin`
- compressed Linux kernel with linked RAM filesystem `zImage`
- device tree blob `stm32f746-disco.dtb`

Run
---

Flash U-Boot:
Write U-Boot in the internal flash:

`$ make flash_bootloader`


U-Boot is pre-configured to load a system image called `stm32f7/stm32f746g-disco_system.uImage` from over TFTP from a host with `IP 192.168.201.6` (change the configuration in `configs/uboot-env`). This image can be written to the embedded SPI flash with the command `update_spi` in U-Boot. After this, U-Boot can be configured to boot from the SPI with `boot_spi`. A framebuffer console is enabled by adding `console=tty0` to the boot arguments:
U-Boot is configured to write the Linux kernel in the SPI flash is the user button (the blue one) is pressed during reset. It loads and flash the device tree blob image called `stm32f746/stm32f746-disco.dtb` and the kernel image called `stm32f746/zImage` over TFTP from a host with IP `192.168.201.6`.

![alt text](https://github.com/fdu/STM32F746G_Buildroot/blob/master/doc/stm32f746g-disco_linux.png)

Boot log
--------

Output coming through USART6:
```
U-Boot 2010.03 (***)
CPU : STM32F7 (Cortex-M7)
Freqs: SYSCLK=200MHz,HCLK=200MHz,PCLK1=50MHz,PCLK2=100MHz
Board: STM32F746 Discovery Rev 1.A, www.emcraft.com
DRAM: 8 MB
In: serial
Out: serial
Err: serial
QSPI: 16 MB mapped at 0x90000000
Net: STM32_MAC
Hit any key to stop autoboot: 0
Booting from network...
Auto-negotiation...completed.
STM32_MAC: link UP (100/Full)
Using STM32_MAC device
TFTP from server 192.168.201.6; our IP address is 192.168.201.123
Filename 'stm32f7/stm32f746g-disco_system.uImage'.
Load address: 0xc0007fc0
Loading: T #################################################################
###############################
done
Bytes transferred = 1402248 (156588 hex)
## Booting kernel from Legacy Image at c0007fc0 ...
Image Name:
Image Type: ARM Linux Multi-File Image (uncompressed)
Data Size: 1402184 Bytes = 1.3 MB
Load Address: c0008000
Entry Point: c0008001
Contents:
Image 0: 1402176 Bytes = 1.3 MB
Verifying Checksum ... OK
## Loading init Ramdisk from multi component Legacy Image at c0007fc0 ...
Loading Multi-File Image ... OK
OK
WARNING: legacy format multi component image overwritten
Starting kernel ...
Linux version 2.6.33-arm1-linuxito-lcdfork (***) (collect2: ld returned 1 exit status) #45 Tue Jan 23 22:23:34 CET 2018
CPU: ARMv7-M Processor [410fc271] revision 1 (ARMv7M)
CPU: WBA data cache, WBA instruction cache
Machine: STMicro STM32
...
[load image and boot Linux kernel]
...
Freeing init memory: 340K
devpts: called with bogus options
Initializing random number generator... urandom start: failed.
done.
Starting network: run-parts: applet not found
FAIL
Starting telnetd: OK
Welcome to Buildroot
buildroot login: root
Jan 1 00:00:18 login[34]: root login on 'console'
BusyBox v1.26.2 (2018-01-23 22:07:12 CET) hush - the humble shell
Enter 'help' for a list of built-in commands.
~ #
```
Changelog
---------

* 0.1
* Buildroot 2017.02.9
* GCC 4.4.1 (external)
* U-Boot from Emcraft
* Linux 2.6.33 from Emcraft with LCD driver
* Busybox
* OpenOCD 0.10.0

* 0.2
* Buildroot 2017.02.9
* GCC 6.3.0
* U-Boot 2018.03-rc2
* Linux 4.15.3
* Busybox 1.26.2
* OpenOCD 0.10.0

0 comments on commit c2de99c

Please sign in to comment.