Hardware Setup
Prepare hardware as described below:
- Change the JP7/JP8 jumpers’ settings to the "2-3" position to access the board serial console via the USB composite device.
- Set the JP10 jumper to supply the STM32H753I-EVAL board through the jack (CN10) and connect the 5V DC power adapter to the jack.
- Connect the microUSB cable to the CN23 connector on the STM32H753I-EVAL board and the development host to provide access to the serial console and the embedded ST-LINK debugger/programmer that are required to run Linux (uClinux) on the STM32H753I-EVAL. The serial console operates in U-Boot and uCLinux with the following parameters:
- Baud rate - 115200
- Data bits - 8
- Stop bits - 1
- Parity - none
- Connect Ethernet cable to the CN1 connector on the STM32H753I-EVAL board.
- The MicroSD Card used to boot the system on the STM32H753I-EVAL board. Since U-Boot environment is located at the 0x80000..0x100000 range of the raw SD Card address-space, the SD Card must be partitioned properly, so that U-Boot does not overwrite the file system on the partition. The SD Card must contain at least one partition started at a at least 1MB raw offset. The partition must be FATFS-formatted. Usually, a new SD Card satisfies these requirements by default so most likely no special preparations are required unless the card has been reformatted in some other way in other projects.
Installing U-Boot to STM32H753I-EVAL Board
- Download the prebuilt U-Boot image from the Emcraft web site:
- Run the following command on the Linux development host:
$ st-flash write u-boot.bin 0x08000000
st-flash 1.7.0-246-gc721751
2023-08-09T10:52:47 INFO common.c: STM32H74x_H75x: 128 KiB SRAM, 2048 KiB flash in at least 128 KiB pages. file u-boot.bin md5 checksum: 9da4d3227766882d2d2f5d9f914117, stlink checksum: 0x01a79b48
2023-08-09T10:52:47 INFO common_flash.c: Attempting to write 320790 (0x4e516) bytes to stm32 address:
134217728 (0x8000000)
-> Flash page at 0x8000000 erased (size: 0x20000)
-> Flash page at 0x8020000 erased (size: 0x20000)
-> Flash page at 0x8040000 erased (size: 0x20000)
2023-08-09T10:52:50 INFO flashloader.c: Starting Flash write for H7
320790/320790 bytes written
2023-08-09T10:52:57 INFO common_flash.c: Starting verification of write complete
2023-08-09T10:53:00 INFO common_flash.c: Flash written and verified! jolly good!
$
- Connect to the STM32H753I-EVAL console using a serial terminal utility, for example:
$ picocom -b 115200 /dev/ttyACM0
- Verify that the U-Boot has been successfully installed. Reset the board and confirm that the following output appears on the serial UART console:
U-Boot 2019.04- (Aug 09 2023 - 10:31:06 +0000)
Model: STMicroelectronics STM32H753i-EVAL board
DRAM: 32 MiB
Flash: 2 MiB
MMC: STM32 SDMMC2: 0
*** Warning - bad CRC, using default environment
In: serial@40011000
Out: serial@40011000
Err: serial@40011000
Net: eth0: ethernet@40028000
Hit any key to stop autoboot: 0
STM32H7-EVAL U-Boot >
Installing Linux to STM32H753I-EVAL Board
- Download the prebuilt rootfs project image from the Emcraft web site:
- Plug in the MicroSD card to the cross-development host.
- Find out a /dev/sdX device the system has assigned to your SD Card:
$ dmesg | tail
[ 456.470775] usbcore: registered new interface driver usb-storage
[ 456.482079] usbcore: registered new interface driver uas
[ 457.501716] scsi 3:0:0:0: Direct-Access Generic STORAGE DEVICE 0821 PQ: 0 ANSI: 6
[ 457.508132] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 457.715113] sd 3:0:0:0: [sdb] 15446016 512-byte logical blocks: (7.91 GB/7.37 GiB)
[ 457.733992] sd 3:0:0:0: [sdb] Write Protect is off
[ 457.733999] sd 3:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 457.753808] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 457.840489] sdb: sdb1
[ 457.840845] sd 3:0:0:0: [sdb] Attached SCSI removable disk
- Install the rootfs project to the microSD card:
$ cd $INSTALL_ROOT/projects/rootfs
$ mount /dev/sdb1 /mnt/sdcard
$ cp roofts.uImage /mnt/sdcard
- Insert the micro SD card in the board and power the board. The system should boot up on the board:
U-Boot 2019.04- (Aug 09 2023 - 10:31:06 +0000)
Model: STMicroelectronics STM32H753i-EVAL board
DRAM: 32 MiB
Flash: 2 MiB
MMC: STM32 SDMMC2: 0
*** Warning - bad CRC, using default environment
In: serial@40011000
Out: serial@40011000
Err: serial@40011000
Net: eth0: ethernet@40028000
Hit any key to stop autoboot: 0
8192999 bytes read in 597 ms (13.1 MiB/s)
## Booting kernel from Legacy Image at d0c00000 ...
Image Name: Linux-6.1.28-gde22b499e426
Image Type: ARM Linux Multi-File Image (uncompressed)
Data Size: 8192935 Bytes = 7.8 MiB
Load Address: d0008000
Entry Point: d0008001
Contents:
Image 0: 8176896 Bytes = 7.8 MiB
Image 1: 16027 Bytes = 15.7 KiB
Verifying Checksum ... OK
## Loading init Ramdisk from multi component Legacy Image at d0c00000 ...
## Flattened Device Tree from multi component Image at D0C00000
Booting using the fdt at 0xd13cc54c
Loading Multi-File Image ... OK
Loading Ramdisk to d1a7f000, end d1a82e9b ... OK
ERROR: reserving fdt memory region failed (addr=d1c00000 size=300000)
ERROR: reserving fdt memory region failed (addr=d1f00000 size=100000)
Loading Device Tree to d1a78000, end d1a7ee9a ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 6.1.28-gde22b499e426 (sasha_d
@workbench.emcraft.com) (arm-none-eabi-gcc (GNU Arm
Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release), GNU ld
(GNU Arm Embedded Toolchain 10.3-2021.10) 2.36.1.20210621) #11
PREEMPT Fri Aug 11 13:48:10 UTC 2023
……
[ 2.350520] ARMv7-M VFP coprocessor found
[ 2.354085] VFP: Double precision floating points are supported
[ 2.359782] mmc0: host does not support reading read-only switch,
assuming write-enable
[ 2.370286] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[ 2.380873] mmc0: new high speed SD card at address 0002
[ 2.401454] Freeing unused kernel image (initmem) memory: 3108K
[ 2.406092] This architecture does not have kernel memory protection.
[ 2.414048] mmcblk0: mmc0:0002 00000 487 MiB
[ 2.420784] Run /init as init process
[ 2.423762] mmcblk0: p1
[ 2.427125] with arguments:
[ 2.428765] /init
[ 2.430965] with environment:
[ 2.434338] HOME=/
[ 2.436465] TERM=linux
[ 2.439183] consoleblank=0
[ 2.442305] ip=192.168.0.168:192.168.0.3::::eth0:off
init started: BusyBox v1.24.2 (2023-08-11 13:47:34 UTC)
[43] Jan 01 00:00:02 Running in background
/ # [ 2.833395] stm32-dwmac 40028000.ethernet eth0: Register
MEM_TYPE_PAGE_POOL RxQ-0
[ 2.922113] stm32-dwmac 40028000.ethernet eth0: PHY [stmmac-0:00]
driver [Microchip LAN8742] (irq=POLL)
[ 2.940329] stm32-dwmac 40028000.ethernet eth0: No Safety
Features support found
[ 2.946509] stm32-dwmac 40028000.ethernet eth0: IEEE 1588-2008
Advanced Timestamp supported
[ 2.955706] stm32-dwmac 40028000.ethernet eth0: registered PTP clock
[ 2.962801] stm32-dwmac 40028000.ethernet eth0: configuring for
phy/rmii link mode
[ 5.062949] stm32-dwmac 40028000.ethernet eth0: Link is Up -
100Mbps/Full - flow control rx/tx
[ 5.070320] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Ethernet Driver Support
- Power cycle the board. While U-Boot is coming up, press any key on the serial console to enter the U-Boot command line interface:
U-Boot 2019.04- (Aug 09 2023 - 10:31:06 +0000)
Model: STMicroelectronics STM32H753i-EVAL board
DRAM: 32 MiB
Flash: 2 MiB
MMC: STM32 SDMMC2: 0
Loading Environment from MMC... OK
In: serial@40011000
Out: serial@40011000
Err: serial@40011000
Net: eth0: ethernet@40028000
Hit any key to stop autoboot: 0
STM32H7-EVAL U-Boot >
- From the U-Boot command line interface, reset to the default environment:
=> env default -a
## Resetting to default environment
=>
- Set the ethaddr, ipaddr and serverip U-Boot environment variables:
STM32H7-EVAL U-Boot > setenv ethaddr 56:78:9a:bc:12:34
STM32H7-EVAL U-Boot > setenv ipaddr 192.168.0.168
STM32H7-EVAL U-Boot > setenv serverip 192.168.0.3
STM32H7-EVAL U-Boot > saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
STM32H7-EVAL U-Boot >
- ping the development host from the target board:
STM32H7-EVAL U-Boot > ping 192.168.0.3
ethernet@40028000 Waiting for PHY auto negotiation to complete. done
Using ethernet@40028000 device
host 192.168.0.3 is alive
STM32H7-EVAL U-Boot >
- Load rootfs.uImage using the U-Boot tftp command:
STM32H7-EVAL U-Boot > tftp stm32h753i-eval/rootfs.uImage
Using ethernet@40028000 device
TFTP from server 192.168.0.3; our IP address is 192.168.0.168
Filename 'stm32h753i-eval/rootfs.uImage'.
Load address: 0xd0c00000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#######################################
312.5 KiB/s
done
Bytes transferred = 8192999 (7d03e7 hex)
STM32H7-EVAL U-Boot >
- Reset the board and let it boot up to the Linux shell:
=> reset
resetting ...
U-Boot 2019.04- (Aug 09 2023 - 10:31:06 +0000)
.....
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 6.1.28-gde22b499e426 (sasha_d@workbench.
emcraft.com) (arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10)
10.3.1 20210824 (release), GNU ld (GNU Arm Embedded Toolchain 10.3-2021.10)
2.36.1.20210621) #11 PREEMPT Fri Aug 11 13:48:10 UTC 2023
.....
/ # [ 2.833242] stm32-dwmac 40028000.ethernet eth0: Register MEM_TYPE_
PAGE_POOL RxQ-0
[ 2.922249] stm32-dwmac 40028000.ethernet eth0: PHY [stmmac-0:00] driver
[Microchip
LAN8742] (irq=POLL)
[ 2.940459] stm32-dwmac 40028000.ethernet eth0: No Safety Features
support found
[ 2.946635] stm32-dwmac 40028000.ethernet eth0: IEEE 1588-2008 Advanced
Timestamp supported
[ 2.955814] stm32-dwmac 40028000.ethernet eth0: registered PTP clock
[ 2.962933] stm32-dwmac 40028000.ethernet eth0: configuring for phy/
rmii link mode
[ 5.063089] stm32-dwmac 40028000.ethernet eth0: Link is Up - 100Mbps/
Full - flow control rx/tx
[ 5.070469] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
- From the development host validate that the target board is visible using ping:
$ ping 192.168.0.168 -c 5
PING 192.168.0.168 (192.168.0.168) 56(84) bytes of data.
64 bytes from 192.168.0.168: icmp_seq=1 ttl=64 time=1.69 ms
64 bytes from 192.168.0.168: icmp_seq=2 ttl=64 time=0.821 ms
64 bytes from 192.168.0.168: icmp_seq=3 ttl=64 time=0.885 ms
64 bytes from 192.168.0.168: icmp_seq=4 ttl=64 time=0.850 ms
64 bytes from 192.168.0.168: icmp_seq=5 ttl=64 time=0.850 ms
--- 192.168.0.168 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 71ms
rtt min/avg/max/mdev = 0.821/1.019/1.692/0.338 ms
$
- From the target board, validate that the development host is visible using ping:
/ # ping 192.168.0.3 -c 5
PING 192.168.0.3 (192.168.0.3): 56 data bytes
64 bytes from 192.168.0.3: seq=0 ttl=128 time=3.759 ms
64 bytes from 192.168.0.3: seq=1 ttl=128 time=13.771 ms
64 bytes from 192.168.0.3: seq=2 ttl=128 time=1.391 ms
64 bytes from 192.168.0.3: seq=3 ttl=128 time=2.265 ms
64 bytes from 192.168.0.3: seq=4 ttl=128 time=1.708 ms
--- 192.168.0.3 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.391/4.578/13.771 ms
/ #
TCP/IP Stack Support
With uClinux running on the STM32H753I-EVAL, you get the full Linux TCP/IP stack (kernel version 6.1.28). User-space POSIX APIs are provided by the uClibc library. Key user-space networking tools and utilities are available from the multi-call busybox. Additional tools and packages, such as for instance the SSH dropbear server, can be built specifically for uClinux. All in all, you have the powerful Linux TCP/IP stack at your disposal.
- From the development host validate that the STM32H753I-EVAL is visible using ping:
$ ping 192.168.0.168 -c 5
PING 192.168.0.168 (192.168.0.168) 56(84) bytes of data.
64 bytes from 192.168.0.168: icmp_seq=1 ttl=64 time=1.69 ms
64 bytes from 192.168.0.168: icmp_seq=2 ttl=64 time=0.821 ms
64 bytes from 192.168.0.168: icmp_seq=3 ttl=64 time=0.885 ms
64 bytes from 192.168.0.168: icmp_seq=4 ttl=64 time=0.850 ms
64 bytes from 192.168.0.168: icmp_seq=5 ttl=64 time=0.850 ms
--- 192.168.0.168 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 71ms
rtt min/avg/max/mdev = 0.821/1.019/1.692/0.338 ms
$
- ping the development host from the STM32H753I-EVAL:
/ # ping 192.168.0.3 -c 5
PING 192.168.0.3 (192.168.0.3): 56 data bytes
64 bytes from 192.168.0.3: seq=0 ttl=128 time=3.759 ms
64 bytes from 192.168.0.3: seq=1 ttl=128 time=13.771 ms
64 bytes from 192.168.0.3: seq=2 ttl=128 time=1.391 ms
64 bytes from 192.168.0.3: seq=3 ttl=128 time=2.265 ms
64 bytes from 192.168.0.3: seq=4 ttl=128 time=1.708 ms
--- 192.168.0.3 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.391/4.578/13.771 ms
/ #
- On the target, start the telnetd daemon to allow connections to the STM32H753I-EVAL:
/ # telnetd
/ # ps | grep telnetd
72 root 724 S {busybox} telnetd
74 root 724 S grep telnetd
/ #
- Connect to the target from the development host using telnet. The target is configured to accept the 123 password for root:
[sasha_d@fedora ~]$ telnet 192.168.0.168
Trying 192.168.0.168...
Connected to 192.168.0.168.
Escape character is '^]'.
(none) login: root
Password:
/ # ls
bin etc httpd lib proc sbin tmp var
dev hello.ko init mnt root sys usr
/ # exit
Connection closed by foreign host.
$
- The dropbear SSH daemon starts automatically on the target. Verify that dropbear allows secure connections to the target:
/ # ps | grep dropbear
43 root 712 S dropbear -R
81 root 724 S grep dropbear
/ #
- Connect to the target from the development host using ssh. The first connection takes several seconds to establish as the STM32H753I-EVAL runs computation-extensive key calculations. Again, enter 123 on the password prompt:
$ ssh root@192.168.0.168
The authenticity of host '192.168.0.168 (192.168.0.168)' can't be
established.
ECDSA key fingerprint is SHA256:SY2N+sEZ38HwVhP06p/H63FERYlJ
ACTITDL7eYMFBFY.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.168' (ECDSA) to the list of
known hosts.
root@192.168.0.168's password:
/ # ls
bin etc httpd lib proc sbin tmp var
dev hello.ko init mnt root sys usr
/ # exit
Connection to 192.168.0.168 closed.
$
- On the target, enable access to the Internet by configuring a default gateway. Note also that the system makes use of the public name server provided by Google:
/ # route add default gw 192.168.0.1
/ # cat /etc/resolv.conf
# This configuration makes use of the Google public DNS server.
# If you would like to use something else, replace with the IP
# of your DNS server
nameserver 8.8.8.8
/ #
- Use ntpd to synchronize the time on the target with the time provided by a public server:
/ # date
Thu Jan 1 00:00:28 UTC 1970
/ # ntpd -p 0.fedora.pool.ntp.org
[ 40.891171] random: crng init done
/ # sleep 5
/ # date
Fri Aug 11 20:46:15 UTC 2023
/ #
- Use wget to download a file from a remote server:
/ # wget ftp://ftp.gnu.org/README
Connecting to ftp.gnu.org (209.51.188.20:21)
README 100% |*******************************| 2748 0:00:00 ETA
/ # cat README
This is ftp.gnu.org, the FTP server of the the GNU project.
...
- Start the HTTP daemon:
httpd -h /httpd/html/
/ #
- From a local host, open a Web browser to the STM32H753I-EVAL and watch the demo web page provided by the target. The STM32H753I-EVAL shows the current time and date as well as the list of the currently running processes:
Support USB Host Stack Interface
- Attach a USB Flash device to the CN14 USB OTG2 HS connector using an appropriate cable. Verify that it is automatically detected and can be mounted:
/ # [ 3903.030069] dwc2 40040000.usb: new device is full-speed
[ 3903.621224] usb 1-1: new high-speed USB device number 2 using dwc2
[ 3903.882727] usb 1-1: New USB device found, idVendor=0951, idProduct=160e,
bcdDevice= 1.10
[ 3903.889549] usb 1-1: New USB device strings: Mfr=1, Product=2,
SerialNumber =3
[ 3903.896811] usb 1-1: Product: DataTraveler 2.0
[ 3903.901177] usb 1-1: Manufacturer: Kingston
[ 3903.905257] usb 1-1: SerialNumber: 5B84160009F8
[ 3903.912384] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 3903.918944] scsi host0: usb-storage 1-1:1.0
[ 3904.983539] scsi 0:0:0:0: Direct-Access Kingston DataTraveler 2.0
PMAP PQ: 0 ANSI: 0 CCS
[ 3905.237389] sd 0:0:0:0: [sda] 1953792 512-byte logical blocks:
(1.00 GB/954 MiB) [ 3905.245051] sd 0:0:0:0: [sda] Write Protect is off
[ 3905.248473] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[ 3905.254490] sd 0:0:0:0: [sda] No Caching mode page found
[ 3905.258821] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 3905.272896] sda: sda1
[ 3905.275782] sd 0:0:0:0: [sda] Attached SCSI removable disk
/ # mount /dev/sda1 /mnt/usbflash/
/ # ls -la /mnt/usbflash/
drwxr-xr-x 3 root root 4096 Jan 1 00:00 .
drwxrwxrwx 8 root root 0 Aug 11 2023 ..
-rwxr-xr-x 1 root root 319 Jan 1 1980 data.log
/ #
- Unmount the USB Flash device:
/ # umount /mnt/usbflash/
/ #
Support Loading / Unloading Kernel Modules
- From the Linux shell, load the demo kernel module:
/ # insmod hello.ko
[ 4307.451610] Hello, world
/ #
- Show the status of the loaded kernel modules:
/ # lsmod
Module Size Used by Not tainted
hello 761 0
/ #
- Unload the module from the Linux kernel:
/ # rmmod hello
[ 4355.168819] Goodbye, world
/ #