cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-144 with STM32F767ZIT6 rev. Z not working lwIP - ETH

Jeffrey V
Associate II
Posted on October 04, 2017 at 15:39

Hi all,

I've been working with the STM32F767ZIT6 rev. 'Z' and this went pretty well up to the point where I needed to add an Ethernet connection. My project is running fine with FreeRTOS, UART2, UART3, some Input and some Output connected, and also using TIM2 for an Rotary Encoder.

Now ive added ETH and LWIP and I cannot get an simple ping command to work. There is approx 10% change that it sometimes responds. Obviously I have read alot about the known issue with ethernet on the F767 but this was rev 'A' and I am using rev 'Z'.

My ETH settings are:

- I am using a static connection between my Laptop (192.168.1.101) and the F767 as client (192.168.1.102).

- I am using stm32Cube to configure the settings.

   - RMII mode, PHY address = 0, IP and NETMASK are set, DHCP is disabled. Everything else is default. (So clock settings are set to HSI, if that matters)

When debugging (ping send from laptop) I get the following results:

MX_LWIP_Init goes fine, netif_is_link_up is also succes.

- I enter the function etharp_input and the settings received are all fine. for_us is set to 1. (so there is a match with IP)

- Then the function ethernet_output is called and eventually netif->linkoutput(netif, p) is called.

If I stop the debugger at this point I can see all information is correct. IP addresses, and both MAC addresses are correct. However the moment I let it send the output I see a garbage response at WireShark.

Even when for some reason a Ping does work, this response is still garbage.

Also when a Ping does work, it is terribly slow (average of 500ms)

Does anybody has an idea if this is SW related (clock settings, or something).

Or if I will be better of ordering a STM32F746ZG and see if it does work on this board.

#lwip #freertos #eth #freertos+tcp
19 REPLIES 19
tj
Associate II
Posted on November 10, 2017 at 09:27

Hi Imen,

could you reproduce the problem with the provided Cube Project?

BR

Thomas

chum
Associate II

Hi all,

I'm using stm32f429 nucleo 144, Please tell how impliment lwip on it (using cubeMX with eclipse).

Kurt Alber
Associate III

Any news on this topic?

I created code with the newest STM32CubeMX for Nucleo-144 STM32F767ZI with LWIP

and added:   MX_LWIP_Process(); to while(1){} in main.

Resulting in: sometimes I can ping the device and then it breaks and is no more accessible.

The same settings generated on STM32F429 results in a perfectly fine Ethernet connection...

I attached the cubeMX file, there is clearly an issue with F767. Could you reproduce the issue with the .ioc file from Thomas?

Unfortunately I need the SPI NSSP function so I can not switch to the STM32429

btw. I generate code for Atollic TrueStudio

switched to F746... works like a charm

Hi,

I'm using stm32f429 nucleo 144.

I want to connect board with PC using Ethernet with static IP.

My application should transfer the PC file data to the target board through Ethernet.

Using latest STM32Cube_FW_F4_V1.24.0 how its possible ?

Which protocol suites this type of file transfer?

Is it possible with this example application - /home/STM32Cube_FW_F4_V1.24.0/Projects/STM32F429ZI-Nucleo/Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS

How to view target board data on debugger memory window ?(Just sharing text information)

PC side and target board side what are the application should alive for this process?

Thanks

have you created you files with cubemx?

enter in :

MX_LWIP_Process(); //<-- add this line to your main loop
  1. can you then ping it?
  2. I simply transfer bytes if you want an ascii protocoll there should be plenty available in the internet
  3. If I understand you, its working for you for `LwIP_HTTP_Server_Netconn_RTOS`? If yes you can adapt it to your needs.

At the time of build :(getting error)

I'm using LWiP enabled CubeMX project :

13:15:22 **** Incremental Build of configuration Debug for project test ****

make all 

Building file: ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c

Invoking: MCU GCC Compiler

/home/work/Cube_workspace/test/Debug

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 '-D__weak=__attribute__((weak))' '-D__packed="__attribute__((__packed__))"' -DUSE_HAL_DRIVER -DSTM32F429xx -I"/home/pcadmin/work/Cube_workspace/test/Inc" -I"/home/work/Cube_workspace/test/Middlewares/Third_Party/LwIP/src/include/posix/sys" -I"/home/work/Cube_workspace/test/Middlewares/Third_Party/LwIP/system/arch" -I"/home/work/Cube_workspace/test/Drivers/CMSIS/Include" -Og -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.d" -MT"Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.o" -o "Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.o" "../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c"

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c: In function 'USB_WritePacket':

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:940:54: error: expected expression before 'uint32_t'

    USBx_DFIFO((uint32_t)ch_ep_num) = *((__packed (uint32_t) *)pSrc);

                           ^~~~~~~~

<command-line>:0:10: error: called object is not a function or function pointer

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:940:44: note: in expansion of macro '__packed'

    USBx_DFIFO((uint32_t)ch_ep_num) = *((__packed (uint32_t) *)pSrc);

                      ^~~~~~~~

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:940:65: error: expected expression before ')' token

    USBx_DFIFO((uint32_t)ch_ep_num) = *((__packed (uint32_t) *)pSrc);

                                 ^

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c: In function 'USB_ReadPacket':

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:969:16: error: expected ')' before 'uint32_t'

   *(__packed uint32_t *)pDest = USBx_DFIFO(0U);

        ^~~~~~~~

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:969:5: warning: statement with no effect [-Wunused-value]

   *(__packed uint32_t *)pDest = USBx_DFIFO(0U);

   ^~~~~~~~~~~~~~~~~~~

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:969:27: error: expected ';' before 'pDest'

   *(__packed uint32_t *)pDest = USBx_DFIFO(0U);

              ^~~~~

../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c:962:12: warning: unused variable 'USBx_BASE' [-Wunused-variable]

  uint32_t USBx_BASE = (uint32_t)USBx;

      ^~~~~~~~~

Drivers/STM32F4xx_HAL_Driver/Src/subdir.mk:75: recipe for target 'Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.o' failed

make: *** [Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.o] Error 1

13:15:22 Build Finished (took 281ms)

Sorry mate, I will not debug it for you! You have to figure this out by your own...

All though I recommend you using Atollic TrueStudio its free after a registration to STM32. You can export the CubeMx project to TrueStudio and go with that... Good Luck

Can you please tell how to create CubeMX project for lwip with new version of CubeMX​

Kurt Alber
Associate III