Skip to content

[BUG] ping failed and rtps test failed. #12

@ZhenshengLee

Description

@ZhenshengLee

Thanks for all authors! But I just cannot reproduce the behavior of the ertps-stm32.

Here is the issue.

Env

  • hardware: stm32f767zi
  • toolchain: gcc8-2019-q3
  • cubeIDE: v6.4 with FW_V7 v1.16.0
  • network: ubuntu2004(192.168.1.104), stm32(192.168.1.103), router(192.168.1.1)
  • source: ZhenshengLee@3b983a3

Steps

change setting according to https://github.com/embedded-software-laboratory/embeddedRTPS-STM32/blob/master/readme.md

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 <sys/errno.h>
edit Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_eth.c l1877 as follows
macinit.PromiscuousMode = ETH_PROMISCUOUS_MODE_ENABLE;

  • change thread prio in stm32/rtps/include/rtps/config.h
       const uint8_t SPDP_WRITER_PRIO = 24;
        const uint8_t SPDP_MAX_NUMBER_FOUND_PARTICIPANTS = 5;
        const uint8_t SPDP_MAX_NUM_LOCATORS = 5;
        const Duration_t SPDP_LEASE_DURATION = {100, 0};

        const int MAX_NUM_UDP_CONNECTIONS = 10;

        const int THREAD_POOL_NUM_WRITERS = 1;
        const int THREAD_POOL_NUM_READERS = 1;
        const int THREAD_POOL_WRITER_PRIO = 24;
        const int THREAD_POOL_READER_PRIO = 24;
  • change ip setting in stm32/rtps/thirdparty/lwip/lwipcfg.h
#define LWIP_PORT_INIT_IPADDR(addr)   IP4_ADDR((addr), 192,168,1,103)
#define LWIP_PORT_INIT_GW(addr)       IP4_ADDR((addr), 192,168,1,1)
#define LWIP_PORT_INIT_NETMASK(addr)  IP4_ADDR((addr), 255,255,255,0)
  • change ip setting in stm32/rtps/include/rtps/config.h
const std::array<uint8_t, 4> IP_ADDRESS = {192,168,1,103};  // Needs to be set in lwipcfg.h too.
  • change ip setting in stm32/Src/lwip.c
void MX_LWIP_Init(void)
{
  /* IP addresses initialization */
  IP_ADDRESS[0] = 192;
  IP_ADDRESS[1] = 168;
  IP_ADDRESS[2] = 1;
  IP_ADDRESS[3] = 103;
  NETMASK_ADDRESS[0] = 255;
  NETMASK_ADDRESS[1] = 255;
  NETMASK_ADDRESS[2] = 255;
  NETMASK_ADDRESS[3] = 0;
  GATEWAY_ADDRESS[0] = 192;
  GATEWAY_ADDRESS[1] = 168;
  GATEWAY_ADDRESS[2] = 1;
  GATEWAY_ADDRESS[3] = 1;

Expected

../embedded_rtps_test show something/

Actuall

  • ../embedded_rtps_test waiting
Creating RTPS Participant...
Creating Participant...
Created Participant succesfully.
Creating RTPS reader on topic:TOLINUX
Creating FastRTPS Writer on topic TOSTM
Successfully created writer.
Waiting for reader match with STM32...
  • ping failed
  • arp -a show something with 192.168.1.103
? (169.254.169.254) at <incomplete> on enx000ec6cac70c
? (192.168.1.105) at 00:e0:4c:36:0f:51 [ether] on enx000ec6cac70c
? (192.168.1.101) at <incomplete> on enx000ec6cac70c
_gateway (192.168.157.254) at 00:00:5e:00:01:02 [ether] on wlxe84e0663b980
? (192.168.1.103) at <incomplete> on enx000ec6cac70c

disable the wifi makes no different of the result.

  • wireshark capturing no packets from 192.168.1.103

  • I added the tasklist function to show the thread report below

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions