embeddedRTPS-STM32

所属分类:处理器开发
开发工具:C
文件大小:2062KB
下载次数:0
上传日期:2022-11-02 09:12:50
上 传 者sh-1993
说明:  嵌入式RTPS-STM32,,
(embeddedRTPS-STM32,,)

文件列表:
linux (0, 2022-11-02)
linux\CMakeLists.txt (259, 2022-11-02)
linux\Fast-RTPS (0, 2022-11-02)
linux\main.cpp (4188, 2022-11-02)
stm32 (0, 2022-11-02)
stm32\.cproject (41614, 2022-11-02)
stm32\.mxproject (50164, 2022-11-02)
stm32\.project (1242, 2022-11-02)
stm32\.settings (0, 2022-11-02)
stm32\.settings\language.settings.xml (2343, 2022-11-02)
stm32\.settings\stm32cubeide.project.prefs (263, 2022-11-02)
stm32\Core (0, 2022-11-02)
stm32\Core\Inc (0, 2022-11-02)
stm32\Core\Inc\FreeRTOSConfig.h (7362, 2022-11-02)
stm32\Core\Inc\main.h (3668, 2022-11-02)
stm32\Core\Inc\rtps (0, 2022-11-02)
stm32\Core\Inc\rtps\config.h (3866, 2022-11-02)
stm32\Core\Inc\rtps_test.h (278, 2022-11-02)
stm32\Core\Inc\stm32f7xx_hal_conf.h (19941, 2022-11-02)
stm32\Core\Inc\stm32f7xx_it.h (1910, 2022-11-02)
stm32\Core\Src (0, 2022-11-02)
stm32\Core\Src\freertos.c (3204, 2022-11-02)
stm32\Core\Src\main.c (12982, 2022-11-02)
stm32\Core\Src\rtps.cpp (1643, 2022-11-02)
stm32\Core\Src\stm32f7xx_hal_msp.c (8374, 2022-11-02)
stm32\Core\Src\stm32f7xx_hal_timebase_tim.c (3877, 2022-11-02)
stm32\Core\Src\stm32f7xx_it.c (5284, 2022-11-02)
stm32\Core\Src\syscalls.c (2511, 2022-11-02)
stm32\Core\Src\sysmem.c (2726, 2022-11-02)
stm32\Core\Src\system_stm32f7xx.c (9125, 2022-11-02)
stm32\Core\Startup (0, 2022-11-02)
stm32\Core\Startup\startup_stm32f767zitx.s (26622, 2022-11-02)
stm32\Drivers (0, 2022-11-02)
stm32\Drivers\CMSIS (0, 2022-11-02)
stm32\Drivers\CMSIS\Device (0, 2022-11-02)
... ...

# embeddedRTPS on STM32Nucleo-F767ZI This repository contains all components necessary to create a minimal working example of communication between an STM32F767ZI using embeddedRTPS and a Linux system using FastRTPS. This repository contains two projects: 1. The first project in the `stm32/` directory is a STM32CubeIDE project which uses EmbeddedRTPS and is deployed to the STM32Nucleo-F767ZI. 2. The second project in the `linux/` directory is a C++ project that uses eProsima FastRTPS for the Linux system. It can also be compiled and executed on macOS. When both of these projects are executed, the Linux system will send RTPS messages with test data to the STM32F767ZI, to which the STM32F767ZI will then respond. This simple communication test is executed 10 times. **[The main embeddedRTPS repository is located here.](https://github.com/embedded-software-laboratory/embeddedRTPS)** ## Dependencies ### STM32F767ZI Project To compile the project for the STM32, install the following Software: - [STM32CubeIDE](https://www.st.com/en/development-tools/stm32cubeide.html) (version 1.9.0 or later) - st-stlink-server.1.2.0-5.1 (Provided with the [IDE](https://www.st.com/en/development-tools/stm32cubeide.html)) --- ### Linux/macOS Project To compile the project for Linux, install the following Software: #### Ubuntu 18.04 Packages to install using apt-get: ```bash sudo apt-get -y update && sudo apt-get -y upgrade sudo apt-get install -y \ software-properties-common \ libboost-all-dev \ libssl-dev \ build-essential \ cmake ``` ### Fast DDS For `linux/` side application, eProsima Fast DDS v2.3.2 or later is required. The simplest way to prepare is to install from sources according to the follow guide. Note that preparing the environment (e.g. `source ~/Fast-DDS/install/setup.bash`) is also needed before building or executing. https://fast-dds.docs.eprosima.com/en/latest/installation/sources/sources_linux.html#linux-sources ## Compilation After installing the required dependencies, both projects can first cloned and compiled using the following instructions: ```bash git clone --recursive https://github.com/embedded-software-laboratory/embeddedRTPS-STM32 ``` ### STM32F767ZI Project To compile and deploy the STM32 project, first open the STM32CubeIDE. ``` File -> Open projects from File System -> Directory -> Select the stm32/ directory ``` Then press finish to import the project into your local workspace. Now select the project in the project explorer: ``` Project Explorer -> embedded_rtps_stm32 ``` Then, right click the hammer button in the navigation bar. This opens the menu to select the build configuration: - debug: The debug configuration compiles the code with debug symbols and lowers optimization for debugging. - release: This configuration disables debug symbols and increases optimizations to maximum. The selected configuration is then compiled by STM32CubeIDE. #### Code generation using CubeMX You also can use the CubeMX code generating feature in CubeIDE to configure the project. After code generation, you have to do the following steps: * delete auto-generated `Src/main.c` (**not** `main.cpp`) * edit `Middlewares/Third_Party/LwIP/system/arc/cc.h l41` as follows ``` //#define LWIP_PROVIDE_ERRNO #define LWIP_ERRNO_INCLUDE ``` * edit `Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_eth.c l1877` as follows ``` macinit.PromiscuousMode = ETH_PROMISCUOUS_MODE_ENABLE; ``` Note that when you change the STM's IP address, you also have to change the IP address configure in `Core/Inc/rtps/config.h l40` #### Flashing the STM32F767ZI The STM32 should now be connected to the Linux/macOS computer using a micro-USB cable. The cable should be plugged into a USB socket on your computer and into the __debugger__ side of the STM32 Nucleo board. The compiled configuration can then be flashed on to the STM32 in the following steps: ``` Navigation bar -> Run -> Debug ``` It might now be necessary to select the target, in which case "STM32 Application" should be selected. The IDE will then flash the STM32 with your selected configuration. #### Tips - The IDE may prompt you to update the firmware of the onboard ST-Link debugger, this is normal and you can follow the process to update the firmware to the newest version. - The IDE may also ask you to switch to the Run/Debug display after flashing a configuration to the STM32, this is the debug screen of the IDE and thus usefull to see the current callstack and more. --- ### Linux/macOS Project To compile the Linux/macOS project navigate to the `linux/` directory. Then compile the CMakeLists project using the following commands: ```bash cd linux mkdir build cd build cmake -DTHIRDPARTY=ON .. make ``` The resulting executable can then be found in the build directory and is called `hello_world`. ## Testing Communication with STM32 After compiling both projects the communication between both devices can be tested. To conduct this test follow these steps: #### Setup on Linux/macOS 1. Connect the STM32 to your computer using a ethernet cable. 2. Ensure all firewalls are disable. (probably an OSX issue) 3. Manually assign an IP address (and subnet mask) to the STM32.
(for example: IP:192.168.1.1, subnet: 255.255.255.0) 4. (It may be necessary to disable other network connections, like wifi, if the chosen IP address is in your local network, necessary with the example adresses provided here.) 5. (You can also communicate with the STM32 via a router. Network settings such as IP address are in `Core/Inc/rtps/config.h` and `LWIP/App/lwip.c`.) #### Executing the Test 1. Flash a configuration to the STM32 and run it. 2. The debugger will halt on the first line of the main method, press either F8 or the Resume button. 3. The STM32 should now wait for a subscriber match (to verify this flash the debug configuration and execute steps one and two, then halt the debugger after a couple of seconds after clicking resume in step 2, the debugger should halt on line 495). 4. Execute the `hello_world` executable in the `linux/build` directory. 5. The executable will then send test data to the STM32 and the STM32 should respond to by returning other test data of the following form:
``` Received Hello World Data 0 Sending data Received Hello World Data 1 Sending data Received Hello World Data 2 Sending data Received Hello World Data 3 Sending data ```

近期下载者

相关文件


收藏者