-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add network default config to F4 and F7 boards
- Following #1422.
- Loading branch information
1 parent
27243c8
commit c2208fe
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
targets/CMSIS-OS/ChibiOS/ORGPAL_PAL3_STM32F469_NF/common/targetHAL_ConfigurationManager.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (c) 2019 The nanoFramework project contributors | ||
// See LICENSE file in the project root for full license information. | ||
// | ||
|
||
#include <nanoHAL.h> | ||
#include <nanoHAL_v2.h> | ||
#include <nanoWeak.h> | ||
#include <Target_BlockStorage_STM32FlashDriver.h> | ||
|
||
// Default initialisation for Network interface config blocks | ||
// strong implementation replacing ChibiOS 'weak' one | ||
bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface * pconfig, uint32_t configurationIndex) | ||
{ | ||
(void)configurationIndex; | ||
|
||
// make sure the config block marker is set | ||
memcpy(pconfig->Marker, c_MARKER_CONFIGURATION_NETWORK_V1, sizeof(c_MARKER_CONFIGURATION_NETWORK_V1)); | ||
|
||
pconfig->InterfaceType = NetworkInterfaceType_Ethernet; | ||
pconfig->StartupAddressMode = AddressMode_DHCP; | ||
pconfig->AutomaticDNS = 1; | ||
pconfig->SpecificConfigId = 0; | ||
|
||
// set MAC address with ST provided MAC for development boards | ||
// 00:80:E1:01:35:D1 | ||
pconfig->MacAddress[0] = 0x00; | ||
pconfig->MacAddress[1] = 0x80; | ||
pconfig->MacAddress[2] = 0xE1; | ||
pconfig->MacAddress[3] = 0x01; | ||
pconfig->MacAddress[4] = 0x35; | ||
pconfig->MacAddress[5] = 0xD1; | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
targets/CMSIS-OS/ChibiOS/ORGPAL_PAL3_STM32F769_NF/common/targetHAL_ConfigurationManager.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (c) 2019 The nanoFramework project contributors | ||
// See LICENSE file in the project root for full license information. | ||
// | ||
|
||
#include <nanoHAL.h> | ||
#include <nanoHAL_v2.h> | ||
#include <nanoWeak.h> | ||
#include <Target_BlockStorage_STM32FlashDriver.h> | ||
|
||
// Default initialisation for Network interface config blocks | ||
// strong implementation replacing ChibiOS 'weak' one | ||
bool InitialiseNetworkDefaultConfig(HAL_Configuration_NetworkInterface * pconfig, uint32_t configurationIndex) | ||
{ | ||
(void)configurationIndex; | ||
|
||
// make sure the config block marker is set | ||
memcpy(pconfig->Marker, c_MARKER_CONFIGURATION_NETWORK_V1, sizeof(c_MARKER_CONFIGURATION_NETWORK_V1)); | ||
|
||
pconfig->InterfaceType = NetworkInterfaceType_Ethernet; | ||
pconfig->StartupAddressMode = AddressMode_DHCP; | ||
pconfig->AutomaticDNS = 1; | ||
pconfig->SpecificConfigId = 0; | ||
|
||
// set MAC address with ST provided MAC for development boards | ||
// 00:80:E1:01:35:D1 | ||
pconfig->MacAddress[0] = 0x00; | ||
pconfig->MacAddress[1] = 0x80; | ||
pconfig->MacAddress[2] = 0xE1; | ||
pconfig->MacAddress[3] = 0x01; | ||
pconfig->MacAddress[4] = 0x35; | ||
pconfig->MacAddress[5] = 0xD1; | ||
|
||
return true; | ||
} |