-
-
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.
Improve network configuration blocks
- Add default network config block for STM32F769I using default STM MAC address. - Rework logic to create default network config block on enumeration, only. - Add setting to use auto DNS on default configuration. - Default config block for ESP32 now grabs default MAC from device. Signed-off-by: José Simões <jose.simoes@eclo.solutions>
- Loading branch information
1 parent
c5b419a
commit e7bf3fe
Showing
5 changed files
with
100 additions
and
54 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/ST_STM32F769I_DISCOVERY/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
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
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