Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified STM32 Network Interface #804

Open
wants to merge 96 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6981b02
New STM32 driver
Mar 21, 2023
3b92953
New STM32 driver
Mar 21, 2023
d1d3098
Improve error handling & ipconfig macro checking
Mar 23, 2023
bffd9af
Fix isr usage, add F4, and add missing xGetPhyLinkStatus
Mar 24, 2023
2beff06
Style fixes and config implementations
Mar 25, 2023
520831c
Merge remote-tracking branch 'origin/main' into dev-stm32
Jul 24, 2023
dffe267
update to 4.0.0 compatibility
Jul 24, 2023
eaa7f49
Add STM32 target to Network Interface selection
bjsowa Aug 14, 2023
1073648
Fill Interface and EndPoint fields for all Rx Network buffers
bjsowa Aug 30, 2023
67db92d
Merge pull request #2 from bjsowa/dev-stm32-cmake
HTRamsey Aug 31, 2023
d8d3f96
Merge pull request #3 from bjsowa/dev-stm32-rx-fix
HTRamsey Aug 31, 2023
8f14d4d
Ignore packets whose buffers were dropped
bjsowa Sep 25, 2023
bb367fd
Fix formatting
bjsowa Sep 25, 2023
a747194
Support network down event
bjsowa Sep 21, 2023
08604cf
Don't return pdPASS on interface initialize when link is down
bjsowa Sep 22, 2023
57d78d9
Fix formatting
bjsowa Sep 25, 2023
9cc1cfe
Include toplevel HAL headers
bjsowa Sep 25, 2023
41d699c
Clean redundant comment
bjsowa Sep 25, 2023
a3acf79
Merge pull request #6 from bjsowa/dev-stm32-toplevel-hal-headers
HTRamsey Oct 20, 2023
0265752
Merge pull request #4 from bjsowa/dev-stm32-ignore-dropped-packets
HTRamsey Oct 20, 2023
9d9dbeb
Merge pull request #5 from bjsowa/dev-stm32-network-down
HTRamsey Oct 20, 2023
8004068
Work on error handling
Nov 8, 2023
3155173
Merge remote-tracking branch 'origin/main' into dev-stm32
Dec 3, 2023
18c5883
Merge branch 'main' into dev-stm32
HTRamsey Dec 3, 2023
07c5321
re-add doc
Dec 3, 2023
03cf5c2
clean network interface
Dec 3, 2023
1f3e33b
add more mac features
Dec 3, 2023
6a50bbb
attribute fixes
Dec 4, 2023
74b7548
remove commented out code and implement fixed configuration
Dec 11, 2023
d0d082b
update mac filter and hash table
Dec 12, 2023
3a831e9
Merge branch 'main' into dev-stm32
HTRamsey Dec 12, 2023
a20e044
fix compilation issue
Dec 12, 2023
36508bf
prvMACAddressConfig: fix implicit discarding of const qualifier
Mixaill Dec 13, 2023
7ef89d4
ETH_IRQHandler: add tracing, process all interrupt flags before conte…
Mixaill Dec 13, 2023
0d5e412
Merge pull request #8 from Mixaill/dev-stm32
HTRamsey Dec 14, 2023
014392c
Merge pull request #9 from Mixaill/dev-stm32-isr
HTRamsey Dec 14, 2023
9c602a2
prvEMACHandlerTask: fix NetworkDown event
HTRamsey Dec 14, 2023
272bae4
Merge pull request #10 from Mixaill/de-stm32-networkdown
HTRamsey Dec 14, 2023
f59a771
fix ipconfigUSE_LINKED_RX_MESSAGES == 0
Dec 18, 2023
80d4380
remove test files
Dec 22, 2023
e40ea1b
allow access to pcLOCAL_ALL_NODES_MULTICAST_MAC in network interfaces
Jan 5, 2024
e09a9e7
some restructuring
Jan 5, 2024
4319b6f
reconnection fixes
Jan 6, 2024
2bd8eb4
fix pcLOCAL_ALL_NODES_MULTICAST_MAC issue
Jan 6, 2024
e8fe63a
config checks cleanup
Jan 6, 2024
9365b8e
remove a global
Jan 6, 2024
fbb5257
prep for mac filtering
Jan 6, 2024
7987744
add HAL_ETH_MspInit example
Jan 6, 2024
d4c8386
prep packet and frame filtering
Jan 7, 2024
8a37763
add sample mpu config
Jan 10, 2024
17ee341
mac filter improvements
Jan 17, 2024
9edef7a
improve some checks
Jan 17, 2024
71b5eeb
config improvements
Jan 18, 2024
423b5cf
cache fixes
Jan 18, 2024
cd9024d
fix cache size macro
Jan 18, 2024
0da9777
remove caching option
Jan 18, 2024
288cef2
testing updates
Jan 22, 2024
c7cfcd6
fix mac filtering
Jan 22, 2024
3b85eae
outgoing packet adjustments
Jan 22, 2024
86fcd67
fix interrupt priority set
Mixaill Jan 22, 2024
4a8f60a
Merge pull request #11 from Mixaill/dev-stm32-fixprio
HTRamsey Jan 22, 2024
270b1f8
remove C99 requirement
Jan 25, 2024
8549ed5
readd caching and reduce reliance on HAL
HTRamsey Jan 29, 2024
400e46a
remove testing code
HTRamsey Jan 30, 2024
e63a6ee
Merge branch 'main' into dev-stm32
HTRamsey Jan 30, 2024
9f1ccbc
Fix function calls
HTRamsey Jan 30, 2024
4541b3e
fix cache enabled check
HTRamsey Jan 30, 2024
05af791
config checks
HTRamsey Jan 30, 2024
2c4cb01
check static buffer size and fix caching defines
HTRamsey Feb 1, 2024
41eb37a
Merge branch 'main' into dev-stm32
HTRamsey Feb 5, 2024
1228bec
Uncrustify: triggered by comment.
actions-user Feb 5, 2024
3a61d7f
add spellings
HTRamsey Feb 7, 2024
4d812ad
Merge branch 'main' into dev-stm32
HTRamsey Feb 7, 2024
5bed226
Uncrustify: triggered by comment.
actions-user Feb 7, 2024
6bda6e0
remove xCheckLoopback() usage
Mixaill Feb 12, 2024
99c8c03
Fix Phy function return value
HTRamsey Feb 12, 2024
7cf8996
Merge pull request #12 from Mixaill/fix/loopback
HTRamsey Feb 16, 2024
755f640
Merge branch 'main' into dev-stm32
HTRamsey Apr 8, 2024
004ca89
Revert ND changes
HTRamsey Apr 8, 2024
17a0021
Enable MAC filtering Netif functions
HTRamsey Apr 8, 2024
1728ba0
Add Current HAL Drivers
HTRamsey Jun 6, 2024
f9ce39f
Merge branch 'main' into dev-stm32
HTRamsey Jul 4, 2024
31f8caa
Merge branch 'main' into dev-stm32
HTRamsey Jul 4, 2024
b278985
Handle Driver Differences
HTRamsey Jul 5, 2024
390f69a
Merge branch 'main' into dev-stm32
HTRamsey Jul 10, 2024
4e0ab39
Exclude portable STM32 for spelling and formating check
chinglee-iot Jul 12, 2024
c614c67
Merge branch 'main' into dev-stm32
chinglee-iot Jul 12, 2024
c18bfe7
Apply suggestions from code review
HTRamsey Jul 12, 2024
0abb36b
Increment MAC entry index
bjsowa Jul 17, 2024
9576301
Merge pull request #13 from bjsowa/dev-stm32-fix-mac-index
HTRamsey Jul 27, 2024
445dc68
Fix packet length assert
HTRamsey Aug 1, 2024
b8c0fd8
Merge branch 'main' into dev-stm32
kar-rahul-aws Aug 5, 2024
125b153
Review Fixes
HTRamsey Sep 19, 2024
f737291
Merge branch 'main' into dev-stm32
HTRamsey Sep 19, 2024
adfb1d1
Merge branch 'main' into dev-stm32
tony-josi-aws Oct 10, 2024
b1d730b
Merge branch 'main' into dev-stm32
tony-josi-aws Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions source/portable/NetworkInterface/STM32/Fxx/STM32F767ZITX_FLASH.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
/*
******************************************************************************
**
** @file : LinkerScript.ld
**
** @author : Auto-generated by STM32CubeIDE
**
** Abstract : Linker script for NUCLEO-F767ZI Board embedding STM32F767ZITx Device from stm32f7 series
** 2048Kbytes FLASH
** 512Kbytes RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used
**
** Target : STMicroelectronics STM32
**
** Distribution: The file is distributed as is, without any warranty
** of any kind.
**
******************************************************************************
** @attention
**
** Copyright (c) 2022 STMicroelectronics.
** All rights reserved.
**
** This software is licensed under terms that can be found in the LICENSE file
** in the root directory of this software component.
** If no LICENSE file comes with this software, it is provided AS-IS.
**
******************************************************************************
*/

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */

_Min_Heap_Size = 8K; /* required amount of heap */
_Min_Stack_Size = 4K; /* required amount of stack */

/* Memories definition */
MEMORY
{
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 447K
RAM_NO_CACHE (rwx) : ORIGIN = 0x2006FC00, LENGTH = 65K
}

/* Sections */
SECTIONS
{
/* The startup code into "FLASH" Rom type memory */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH

/* The program code and other data into "FLASH" Rom type memory */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)

KEEP (*(.init))
KEEP (*(.fini))

. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH

/* Constant data into "FLASH" Rom type memory */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >FLASH

.ARM.extab : {
. = ALIGN(4);
*(.ARM.extab* .gnu.linkonce.armextab.*)
. = ALIGN(4);
} >FLASH

.ARM : {
. = ALIGN(4);
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
. = ALIGN(4);
} >FLASH

.preinit_array :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
} >FLASH

.init_array :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
} >FLASH

.fini_array :
{
. = ALIGN(4);
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
. = ALIGN(4);
} >FLASH

/* Used by the startup to initialize data */
_sidata = LOADADDR(.data);

/* Initialized data sections into "RAM" Ram type memory */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
*(.RamFunc) /* .RamFunc sections */
*(.RamFunc*) /* .RamFunc* sections */

. = ALIGN(4);
_edata = .; /* define a global symbol at data end */

} >RAM AT> FLASH

/* Uninitialized data section into "RAM" Ram type memory */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss section */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)

. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM

/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >RAM

.EthDescriptorsBlock (NOLOAD) :
{
. = ALIGN(1K);
__ETH_DESCRIPTORS_START = .;
*(.RxDescripSection)
*(.TxDescripSection)
. = ALIGN(1K);
__ETH_DESCRIPTORS_END = .;
} >RAM_NO_CACHE

.EthBuffersBlock (NOLOAD) :
{
. = ALIGN(64K);
__ETH_BUFFERS_START = .;
*(.EthBuffersSection)
. = ALIGN(64K);
__ETH_BUFFERS_END = .;
} >RAM_NO_CACHE

/* Remove information from the compiler libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}

.ARM.attributes 0 : { *(.ARM.attributes) }
}
31 changes: 31 additions & 0 deletions source/portable/NetworkInterface/STM32/Fxx/mpu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "main.h"
#include "mpu.h"

void MPU_Config(void)
{
LL_MPU_Disable();

extern int __ETH_DESCRIPTORS_START, __ETH_BUFFERS_START;

LL_MPU_ConfigRegion(
LL_MPU_REGION_NUMBER0,
0x0,
( uint32_t )&__ETH_DESCRIPTORS_START,
LL_MPU_REGION_SIZE_1KB|LL_MPU_TEX_LEVEL0|LL_MPU_REGION_FULL_ACCESS|\
LL_MPU_INSTRUCTION_ACCESS_DISABLE|LL_MPU_ACCESS_NOT_SHAREABLE|LL_MPU_ACCESS_NOT_CACHEABLE|\
LL_MPU_ACCESS_BUFFERABLE
);
LL_MPU_EnableRegion(LL_MPU_REGION_NUMBER0);

LL_MPU_ConfigRegion(
LL_MPU_REGION_NUMBER1,
0x0,
( uint32_t )&__ETH_BUFFERS_START,
LL_MPU_REGION_SIZE_64KB|LL_MPU_TEX_LEVEL1|LL_MPU_REGION_FULL_ACCESS|\
LL_MPU_INSTRUCTION_ACCESS_DISABLE|LL_MPU_ACCESS_NOT_SHAREABLE|LL_MPU_ACCESS_NOT_CACHEABLE|\
LL_MPU_ACCESS_NOT_BUFFERABLE
);
LL_MPU_EnableRegion(LL_MPU_REGION_NUMBER1);

LL_MPU_Enable(LL_MPU_CTRL_PRIVILEGED_DEFAULT);
}
Loading