When using dual-core device and running Ethernet on Cortex-M7 core, it must be ensured that memory used by Ethernet is not used by Cortex-M4. For other devices or Cortex-M4 core on dual-core device, different addresses and size might be necessary. Configure regions according to the picture below:Ībove example is for STM32H743 device. Enable memory protection unit (MPU) in “Background Region Privileged access only + MPU Disabled.This step can be skipped when using Cortex-M4 core. The ETH_MDC speed couldn't be changed for some reason, but it doesn't affect the application and it was already fixed in new versions. Other pins should be correctly placed, since we create the project from board selector.This will also allow use PH2/PH3 for QSPI.These signals are optional in full-duplex mode and not connected in default configuration.Relocate Ethernet CRS and COL signals from PH2/PH3 to PA0/PA3.This is required by FreeRTOS in order to call its functions from interrupt handler. Enable Ethernet interrupt and set preemption priority to 5.Enable Ethernet peripheral in pinout view in MII mode (MII used on the board).TIM6 is usually a good option, since it is a simple timer.In pinout/SYS configure different timebase than SysTick (recommended when using FreeRTOS).In clock tree configure 400MHz for core.In pinout/RCC configure HSE in bypass mode.Create new project in STM32CubeMX, select STM32H750-Discovery board and select "No" to "Initialize all peripherals in default mode?" pop-up.You might also need to check board solder bridges to make sure the Ethernet is connected to MCU. The main differences are usually pinout and clock configuration. Send UDP message periodically (optional)Īlthough the example is using STM32H750-Discovery, it might be easy to use the same steps for other STM32H7 based boards.Configure FreeRTOS and LwIP middlewares correctly.Configure project in STM32CubeMX for STM32H750-Discovery.There is minimum code added on top of STM32CubeMX and HAL libraries, this code is provided AS-IS. So the same licenses apply to the these examples. Libraries and middleware is taken from STM32CubeH7 package. When changing memory layout, the MPU configuration needs to be updated accordingly. Value provided here are an example implementation, other configurations are also possible in order to optimize memory usage. The LwIP heap is reduced to fit the rest of D2 RAM together with DMA descriptors. The RX buffers need to be placed in AXI SRAM, since they won't fit to D2 RAM, together with LwIP heap. Variableįor STM32H72x/H73x devices, the D2 SRAM is more limited (only 32kB). On single core devices this part can be used for other purposes. On STM32H74x/H75x devices, all data related to Ethernet and LwIP are placed in D2 SRAM memory (288kB).įirst 128kB of this memory are reserved for Cortex-M4 on dual-core devices. Using GIT tags it should be easy to find examples for particular version of STM32CubeIDE and HAL library TCP/IP configuration in LwIPīelow configuration is necessary to achieve good TCP/IP performance Parameter Initial release on ST community (with minor changes on Github) Added iperf measurement and TCP/IP settings tuned. Ethernet driver reworked in new library release. Changes in code can be find by searching for ETH_CODE keyword.Code should work even when re-generating the code in STM32CubeMX.The same how to step-by-step is also provided below Features These examples are provided to accompany the FAQ article on ST community. Simple Ethernet examples based on LwIP and FreeRTOS, running on ST Nucleo and Discovery boards. For older tool versions please see older version of this readme in the repository This readme is intended for STM32CubeIDE version 1.9.0 and STM32CubeH7 version 1.10.0. Leave the configuration as default, as the X-NUCLEO-SRC1M1 BSP will reconfigure it.STM32H7 STM32CubeMX based Ethernet examples In the Analog section, enable ADC1 peripheral channel 0. To do it, an ADC needs to be configured to measure the VBUS voltage and current.Īs we are going to use the X-NUCLEO-SRC1M1 BSP, the ADC configuration does not need to be done in CubeMX.Īs we need the ADC LL drivers for it to work properly, we still need to configure the ADC in CubeMX for it to include the driver files, but the actual configuration and init function will not be called in our project. Used values and associated decoding for this project have been added to the table.įor the Power Delivery stack to work, VBUS needs to be monitored. The following table is extracted from USB Power Delivery Specification, Table 6-9 Fixed Supply PDO - Source. As a target selection, choose the NUCLEO-G0B1RE from the Board Selector Tab Open STM32CubeIDE and create a New STM32 Project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |