This repository contains several examples to demonstrate how to work with Ethernet interface of GL Embedded Starter Kit using STM32CubeMX code generator and built-in TCP/IP stack LwIP
To build the examples you need to install STM32CubeIDE. If you want to use command line you should first install all required utilities(see 1.2).
This repository is provided under Apache license version 2.0. LICENSE file contains license terms. All third-party libraries are distributed under their own licenses.
Launch STM32CubeIDE then select the tcp_socket_client project and click the menu item 'Project->Build All'
Launch system terminal by pressing 'Ctrl+T' and change current directory to ~/GL-ESK-ETHERNET. Copy Makefile to the project directory:
$ cp scripts/Makefile tcp_socket_client/
Change current directory:
$ cd tcp_socket_client
Run the command:
$ make
Make sure you have installed all required utilies such as:
- GNU Make
- arm-none-eabi-gcc
- binutils
- openocd
- gdb-multiarch
If not than type the following commands:
$ sudo apt update
$ sudo apt install make gcc-arm-none-eabi openocd gdb-multiarch -y
Launch STM32CubeIDE then select the tcp_socket_client project and click the picture with a bug(Debug tcp_socket_client)
Open the terminal by pressing 'Ctrl+T', type the command:
$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg
Open a new tab of the terminal and launch gdb-multiarch:
$ gdb-multiarch build/tcp_socket_client.elf
(gdb) target remote localhost:3333
(gdb) load
Loading section .isr_vector, size 0x188 lma 0x8000000
Loading section .text, size 0x1689c lma 0x80001c0
Loading section .rodata, size 0x5804 lma 0x8016a5c
Loading section .ARM, size 0x8 lma 0x801c260
Loading section .init_array, size 0x4 lma 0x801c268
Loading section .fini_array, size 0x4 lma 0x801c26c
Loading section .data, size 0xa4 lma 0x801c270
Start address 0x080169f0, load size 115420
Transfer rate: 20 KB/sec, 7694 bytes/write.
(gdb)
Read GDB documentation to know more about debugging