Skip to content

Commit

Permalink
Unified STM32 Network Interface (FreeRTOS#804)
Browse files Browse the repository at this point in the history
* New STM32 driver

* New STM32 driver

* Fix isr usage, add F4, and add missing xGetPhyLinkStatus

* Style fixes and config implementations

* update to 4.0.0 compatibility

* Add STM32 target to Network Interface selection

* Fill Interface and EndPoint fields for all Rx Network buffers

* Ignore packets whose buffers were dropped

* Fix formatting

* Support network down event

* Don't return pdPASS on interface initialize when link is down

* Fix formatting

* Include toplevel HAL headers

* Clean redundant comment

* Work on error handling

* re-add doc

* clean network interface

* add more mac features

* attribute fixes

* remove commented out code and implement fixed configuration

* update mac filter and hash table

* fix compilation issue

* prvMACAddressConfig: fix implicit discarding of const qualifier

* ETH_IRQHandler: add tracing, process all interrupt flags before context switch

* prvEMACHandlerTask: fix NetworkDown event

* fix ipconfigUSE_LINKED_RX_MESSAGES == 0

* remove test files

* allow access to pcLOCAL_ALL_NODES_MULTICAST_MAC in network interfaces

* some restructuring

* reconnection fixes

* fix pcLOCAL_ALL_NODES_MULTICAST_MAC issue

* config checks cleanup

* remove a global

* prep for mac filtering

* add HAL_ETH_MspInit example

* prep packet and frame filtering

* add sample mpu config

* mac filter improvements

* improve some checks

* config improvements

* cache fixes

* fix cache size macro

* remove caching option

* testing updates

* fix mac filtering

* outgoing packet adjustments

* fix interrupt priority set

* remove C99 requirement

* readd caching and reduce reliance on HAL

* remove testing code

* Fix function calls

* fix cache enabled check

* config checks

* check static buffer size and fix caching defines

* Uncrustify: triggered by comment.

* add spellings

* Uncrustify: triggered by comment.

* remove xCheckLoopback() usage

* Fix Phy function return value

* Revert ND changes

* Enable MAC filtering Netif functions

* Add Current HAL Drivers

* Handle Driver Differences

* Exclude portable STM32 for spelling and formating check

* Apply suggestions from code review

Co-authored-by: Błażej Sowa <[email protected]>

* Increment MAC entry index

* Fix packet length assert

* Review Fixes

* Fix spell check CI test

---------

Co-authored-by: Holden <holden-zenithaerotech.com>
Co-authored-by: Błażej Sowa <[email protected]>
Co-authored-by: holden-zenith <[email protected]>
Co-authored-by: Mikhail Paulyshka <[email protected]>
Co-authored-by: Holden <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Ching-Hsin,Lee <[email protected]>
Co-authored-by: chinglee-iot <[email protected]>
Co-authored-by: Rahul Kar <[email protected]>
Co-authored-by: Tony Josi <[email protected]>
  • Loading branch information
10 people authored Nov 4, 2024
1 parent 4f67761 commit fa7b709
Show file tree
Hide file tree
Showing 32 changed files with 25,314 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ DEFR
Deglitchers
DEMCR
DEREN
Descs
DEVAD
DFREERTOS
DFSR
Expand Down Expand Up @@ -394,6 +395,8 @@ ETHERC
ethernetif
ETHMACRX
ETHMACTX
ETHTX
ETHRX
ETIE
EVCNT
EVCNTR
Expand Down Expand Up @@ -441,6 +444,7 @@ FFSR
FIFOSZ
FLMSK
FMAC
FNUM
FOLDEVTENA
FORCEWT
FORWARDALLEXCEPTPA
Expand Down Expand Up @@ -477,6 +481,14 @@ Gpbs
GPCNTRL
gpio
GPIO
GPIOA
GPIOB
GPIOC
GPIOD
GPIOE
GPIOF
GPIOG
GPIOH
GPSL
GPSLCE
gptimer
Expand Down Expand Up @@ -593,6 +605,7 @@ IVLTV
IVTIR
JABBR
JFRAME
Jndex
jscott
jscotts
karkhaz
Expand Down Expand Up @@ -677,6 +690,7 @@ MACECR
MACFCR
MACHT
MACHTLR
MACHWF
MACIMR
MACISR
MACMDIOAR
Expand Down Expand Up @@ -922,6 +936,7 @@ Picovolts
PIDEVAD
pidr
PIDR
PINSEL
PIOA
PKHBT
pkhtb
Expand Down Expand Up @@ -1322,6 +1337,7 @@ TBFT
TBQB
TBQBAPQ
TBUE
TBUS
TCKER
TCMSSV
TCOMP
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ jobs:
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
with:
path: ./
exclude-dirs: source/portable/NetworkInterface/STM32

formatting:
runs-on: ubuntu-20.04
Expand All @@ -135,6 +136,7 @@ jobs:
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
with:
path: ./
exclude-dirs: source/portable/NetworkInterface/STM32

doxygen:
runs-on: ubuntu-latest
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ set(FREERTOS_PLUS_TCP_NETWORK_IF_LIST
POSIX WIN_PCAP # Native Linux & Windows respectively
RX
SH2A
STM32FXX STM32HXX # ST Micro
STM32 # ST Micro
MSP432
TM4C
XILINX_ULTRASCALE ZYNQ # AMD/Xilinx
Expand Down Expand Up @@ -117,8 +117,7 @@ if(NOT FREERTOS_PLUS_TCP_NETWORK_IF IN_LIST FREERTOS_PLUS_TCP_NETWORK_IF_LIST )
" PIC32MZEF_WIFI Target: pic32mzef Wifi Tested: TODO\n"
" RX Target: RX Tested: TODO\n"
" SH2A Target: SH2A Tested: TODO\n"
" STM32FXX Target: STM32Fxx Tested: TODO\n"
" STM32HXX Target: STM32Hxx Tested: TODO\n"
" STM32 Target: STM32 Tested: TODO\n"
" MSP432 Target: MSP432 Tested: TODO\n"
" TM4C Target: TM4C Tested: TODO\n"
" WIN_PCAP Target: Windows Tested: TODO\n"
Expand Down
3 changes: 1 addition & 2 deletions source/portable/NetworkInterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ add_subdirectory(mw300_rd)
add_subdirectory(pic32mzef)
add_subdirectory(RX)
add_subdirectory(SH2A)
add_subdirectory(STM32Fxx)
add_subdirectory(STM32Hxx)
add_subdirectory(STM32)
add_subdirectory(ThirdParty/MSP432)
add_subdirectory(TM4C)
add_subdirectory(WinPCap)
Expand Down
46 changes: 46 additions & 0 deletions source/portable/NetworkInterface/STM32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "STM32") ) )
return()
endif()

#------------------------------------------------------------------------------
add_library( freertos_plus_tcp_network_if STATIC )

set( FREERTOS_PLUS_TCP_STM32_IF_DRIVER "None" CACHE STRING "The driver sources to use with STM32 Network interface" )

target_sources( freertos_plus_tcp_network_if
PRIVATE
NetworkInterface.c
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F4>:
Drivers/F4/stm32f4xx_hal_eth.c>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F7>:
Drivers/F7/stm32f7xx_hal_eth.c>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:
Drivers/H5/stm32h5xx_hal_eth_ex.c>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:
Drivers/H5/stm32h5xx_hal_eth.c>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:
Drivers/H7/stm32h7xx_hal_eth_ex.c>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:
Drivers/H7/stm32h7xx_hal_eth.c>
)

target_include_directories( freertos_plus_tcp_network_if
PUBLIC
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F4>:
Drivers/F4>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},F7>:
Drivers/F7>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H5>:
Drivers/H5>
$<$<STREQUAL:${FREERTOS_PLUS_TCP_STM32_IF_DRIVER},H7>:
Drivers/H7>
)

target_link_libraries( freertos_plus_tcp_network_if
PUBLIC
freertos_plus_tcp_port
freertos_plus_tcp_network_if_common
PRIVATE
freertos_kernel
freertos_plus_tcp
)
Loading

0 comments on commit fa7b709

Please sign in to comment.