Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 56e82ac

Browse files
committed
Merge pull request #1 from smaillet-ms/dev
MCBSTM32F400 External FLASH and SSL support
2 parents d28c536 + d584ac3 commit 56e82ac

File tree

29 files changed

+1851
-128
lines changed

29 files changed

+1851
-128
lines changed

Application/common/assemblycode/thumb2/RVD_S/FirstEntryMinimal.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ STACK_MODE_PROCESS EQU 2048
4343
;*************************************************************************
4444
AREA SectionForStackBottom, DATA, NOINIT
4545
StackBottom DCD 0
46-
AREA SectionForStackTop, DATA, NOINIT
46+
AREA SectionForStackTop, DATA, NOINIT, ALIGN=3
4747
StackTop DCD 0
4848
AREA SectionForHeapBegin, DATA, NOINIT
4949
HeapBegin DCD 0

DeviceCode/Targets/Native/STM32F4/processor_selector.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,16 @@ ERROR - WE SHOULD NOT INCLUDE THIS HEADER IF NOT BUILDING A STM32F2/F4 PLATFORM
9191
// communicaiton facilities
9292
/////////////////////////////////////////////////////////
9393

94+
// disable conflicting and overly generic macro definitions
95+
#undef FLASH
96+
#undef CRC
97+
#undef HASH
98+
9499
// CMSIS-Core SOC Specific header
95100
#include "stm32f4xx.h"
96101

97102
// disable conflicting and overly generic macro definitions
98103
#undef FLASH
99104
#undef CRC
105+
#undef HASH
100106
#endif

DeviceCode/pal/COM/sockets_lwip_os/sockets_lwip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct Sockets_LWIP_Driver
158158
BOOL m_usingSSL;
159159

160160
static void MulticastDiscoveryRespond(void* arg);
161-
static void Sockets_LWIP_Driver::MulticastDiscoverySchedule();
161+
static void MulticastDiscoverySchedule();
162162

163163
static void CloseDebuggerSocket();
164164
static void OnDebuggerTimeout(void* arg);

DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct OPENSSL_TYPE__FILE
1414
extern OPENSSL_TYPE__FILE SSL_STDERR;
1515
extern OPENSSL_TYPE__FILE SSL_STDOUT;
1616
extern OPENSSL_TYPE__FILE SSL_STDIN;
17-
#if defined(__RENESAS__)
17+
#if defined(__RENESAS__) || defined(__CC_ARM)
1818
extern "C" volatile int errno;
1919
#else
2020
extern "C" int errno;

DeviceCode/pal/PKCS11/pkcs11.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ extern "C" {
224224
/* All the various Cryptoki types and #define'd values are in the
225225
* file pkcs11t.h. */
226226
#include "pkcs11t.h"
227-
227+
#ifdef __CC_ARM
228+
#undef __PASTE
229+
#endif
228230
#define __PASTE(x,y) x##y
229231

230232

DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/lwIP__Sockets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ HRESULT LWIP_SOCKETS_Driver::UpdateAdapterConfiguration( UINT32 interfaceIndex,
777777
}
778778

779779
BOOL fEnableDhcp = (0 != (config->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DHCP));
780-
BOOL fDynamicDns = (0 != (config->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DYNAMIC_DNS));
780+
//BOOL fDynamicDns = (0 != (config->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DYNAMIC_DNS));
781781
BOOL fDhcpStarted;
782782

783783
struct netif *pNetIf = netif_find_interface(g_LWIP_SOCKETS_Driver.m_interfaces[interfaceIndex].m_interfaceNumber);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorDebug", "CorDebug.csproj", "{85DC9C08-FE2A-4D64-84D7-D01E2105D869}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger", "..\..\Debugger\Debugger.csproj", "{D9DCA6FB-680F-4355-ABEF-128DB02721E6}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUsb", "..\..\Debugger\WinUsb\WinUsb.csproj", "{DAEB83A4-5868-4725-A15D-85F75DB87EAC}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildTasks", "..\..\Tools\BuildTasks\BuildTasks.csproj", "{9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{85DC9C08-FE2A-4D64-84D7-D01E2105D869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{85DC9C08-FE2A-4D64-84D7-D01E2105D869}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{85DC9C08-FE2A-4D64-84D7-D01E2105D869}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{85DC9C08-FE2A-4D64-84D7-D01E2105D869}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Release|Any CPU.ActiveCfg = Debug|Any CPU
25+
{D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Release|Any CPU.Build.0 = Debug|Any CPU
26+
{DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Release|Any CPU.ActiveCfg = Debug|Any CPU
29+
{DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Release|Any CPU.Build.0 = Debug|Any CPU
30+
{9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31+
{9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Debug|Any CPU.Build.0 = Debug|Any CPU
32+
{9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Release|Any CPU.ActiveCfg = Debug|Any CPU
33+
{9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Release|Any CPU.Build.0 = Debug|Any CPU
34+
EndGlobalSection
35+
GlobalSection(SolutionProperties) = preSolution
36+
HideSolutionNode = FALSE
37+
EndGlobalSection
38+
EndGlobal
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
//
7+
// Copyright (c) Microsoft Corporation. All rights reserved.
8+
// Implementation for MCBSTM32F400 board
9+
//
10+
// *** Block Storage Configuration for External M29W640FB NOR Flash ***
11+
//
12+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
13+
14+
#include <tinyhal.h>
15+
16+
#define FLASH_BYTES_PER_SECTOR 2
17+
#define FLASH_SECTOR_WRITE_TYPICAL_TIME_USEC 1400 // not used
18+
#define FLASH_BLOCK_ERASE_ACTUAL_TIME_USEC 800000 // not used
19+
#define FLASH_BLOCK_ERASE_MAX_TIME_USEC 6000000 // not used
20+
21+
#define FLASH_ADDRESS1 0x60000000
22+
#define FLASH_BLOCK1_COUNT 8
23+
#define FLASH_BLOCK1_BYTES_PER_BLOCK 8192
24+
25+
#define FLASH_ADDRESS2 0x60010000
26+
#define FLASH_BLOCK2_COUNT 127
27+
#define FLASH_BLOCK2_BYTES_PER_BLOCK 65536
28+
29+
// EBIU Information
30+
31+
#define M29W640FB__SIZE_IN_BYTES 0x00800000 // 8MB
32+
#define M29W640FB__WP_GPIO_PIN GPIO_PIN_NONE
33+
#define M29W640FB__WP_ACTIVE FALSE
34+
35+
// BlockDeviceInformation
36+
37+
#define M29W640FB__IS_REMOVABLE FALSE
38+
#define M29W640FB__SUPPORTS_XIP TRUE
39+
#define M29W640FB__WRITE_PROTECTED FALSE
40+
#define M29W640FB__SUPP_COPY_BACK FALSE
41+
#define M29W640FB__NUM_REGIONS 2
42+
43+
44+
const BlockRange g_M29W640FB_BlockRange1[] =
45+
{
46+
{ BlockRange::BLOCKTYPE_CODE, 0, 7 }, // 64KB
47+
};
48+
49+
const BlockRange g_M29W640FB_BlockRange2[] =
50+
{
51+
{ BlockRange::BLOCKTYPE_CODE, 0, 1 }, // 64KB
52+
53+
{ BlockRange::BLOCKTYPE_DEPLOYMENT, 1, 126 }, // 8064KB
54+
};
55+
56+
57+
const BlockRegionInfo g_M29W640FB_BlkRegion[M29W640FB__NUM_REGIONS] =
58+
{
59+
{
60+
FLASH_ADDRESS1, // ByteAddress Start; // Starting Sector address
61+
FLASH_BLOCK1_COUNT, // UINT32 NumBlocks; // total number of blocks in this region
62+
FLASH_BLOCK1_BYTES_PER_BLOCK, // UINT32 BytesPerBlock; // Total number of bytes per block
63+
ARRAYSIZE_CONST_EXPR(g_M29W640FB_BlockRange1),
64+
g_M29W640FB_BlockRange1,
65+
},
66+
{
67+
FLASH_ADDRESS2, // ByteAddress Start; // Starting Sector address
68+
FLASH_BLOCK2_COUNT, // UINT32 NumBlocks; // total number of blocks in this region
69+
FLASH_BLOCK2_BYTES_PER_BLOCK, // UINT32 BytesPerBlock; // Total number of bytes per block
70+
ARRAYSIZE_CONST_EXPR(g_M29W640FB_BlockRange2),
71+
g_M29W640FB_BlockRange2,
72+
}
73+
};
74+
75+
const BlockDeviceInfo g_M29W640FB_DeviceInfo=
76+
{
77+
{
78+
M29W640FB__IS_REMOVABLE, // BOOL Removable;
79+
M29W640FB__SUPPORTS_XIP, // BOOL SupportsXIP;
80+
M29W640FB__WRITE_PROTECTED, // BOOL WriteProtected;
81+
M29W640FB__SUPP_COPY_BACK // BOOL SupportsCopyBack
82+
},
83+
FLASH_SECTOR_WRITE_TYPICAL_TIME_USEC, // UINT32 MaxSectorWrite_uSec;
84+
FLASH_BLOCK_ERASE_ACTUAL_TIME_USEC, // UINT32 MaxBlockErase_uSec;
85+
FLASH_BYTES_PER_SECTOR, // UINT32 BytesPerSector;
86+
87+
M29W640FB__SIZE_IN_BYTES, // UINT32 Size;
88+
89+
M29W640FB__NUM_REGIONS, // UINT32 NumRegions;
90+
g_M29W640FB_BlkRegion, // const BlockRegionInfo* pRegions;
91+
};
92+
93+
94+
struct BLOCK_CONFIG g_M29W640FB_BS_Config =
95+
{
96+
{
97+
M29W640FB__WP_GPIO_PIN, // GPIO_PIN Pin;
98+
M29W640FB__WP_ACTIVE, // BOOL ActiveState;
99+
},
100+
101+
&g_M29W640FB_DeviceInfo, // BlockDeviceinfo
102+
};
103+
104+
struct BlockStorageDevice g_M29W640FB_BS;
105+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<AssemblyName>M29W640FB_blconfig_MCBSTM32F400</AssemblyName>
4+
<Size>
5+
</Size>
6+
<ProjectGuid>{45FE123C-8BC4-4ACA-A1AD-ECDC2F4EBF59}</ProjectGuid>
7+
<Description>Block storage configuration for external NOR flash M29W640FB on the MCBSTM32F400</Description>
8+
<Level>HAL</Level>
9+
<LibraryFile>M29W640FB_blconfig_MCBSTM32F400.$(LIB_EXT)</LibraryFile>
10+
<ProjectPath>$(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Blockstorage\M29W640FB\dotNetMF.proj</ProjectPath>
11+
<ManifestFile>M29W640FB_blconfig_MCBSTM32F400.$(LIB_EXT).manifest</ManifestFile>
12+
<Groups>Solutions\MCBSTM32F400</Groups>
13+
<LibraryCategory>
14+
<MFComponent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="BlockStorageConfig_HAL" Guid="{497F59BB-55D3-404e-B958-A6284806D184}" ProjectPath="" xmlns="">
15+
<VersionDependency xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">
16+
<Major>4</Major>
17+
<Minor>0</Minor>
18+
<Revision>0</Revision>
19+
<Build>0</Build>
20+
<Extra />
21+
<Date>2014-11-13</Date>
22+
</VersionDependency>
23+
<ComponentType xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">LibraryCategory</ComponentType>
24+
</MFComponent>
25+
</LibraryCategory>
26+
<Documentation>
27+
</Documentation>
28+
<PlatformIndependent>False</PlatformIndependent>
29+
<CustomSpecific>MCBSTM32F400</CustomSpecific>
30+
<Required>False</Required>
31+
<IgnoreDefaultLibPath>False</IgnoreDefaultLibPath>
32+
<IsStub>False</IsStub>
33+
<Directory>Solutions\MCBSTM32F400\DeviceCode\BlockStorage\M29W640FB</Directory>
34+
<OutputType>Library</OutputType>
35+
<PlatformIndependentBuild>false</PlatformIndependentBuild>
36+
<Version>4.0.0.0</Version>
37+
</PropertyGroup>
38+
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Settings" />
39+
<PropertyGroup />
40+
<ItemGroup>
41+
<Compile Include="M29W640FB_blconfig.cpp" />
42+
</ItemGroup>
43+
<ItemGroup />
44+
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Targets" />
45+
</Project>

Solutions/MCBSTM32F400/DeviceCode/Blockstorage/STM32F4/STM32F4_BlConfig.cpp

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
#include <tinyhal.h>
1515

16-
//--//
17-
18-
1916
#define FLASH_MANUFACTURER_CODE 0x0000 // not used
2017
#define FLASH_DEVICE_CODE 0x0000 // not used
2118
#define FLASH_BASE_ADDRESS1 0x08000000
@@ -34,8 +31,6 @@
3431
#define FLASH_SECTOR_WRITE_MAX_TIME_USEC 100 // not used
3532
#define FLASH_BLOCK_ERASE_ACTUAL_TIME_USEC 10000 // not used
3633

37-
//--//
38-
3934
// EBIU Information
4035

4136
#define STM32F4__CHIP_SELECT 0
@@ -47,12 +42,6 @@
4742
#define STM32F4__WP_GPIO_PIN GPIO_PIN_NONE
4843
#define STM32F4__WP_ACTIVE FALSE
4944

50-
51-
52-
//--//
53-
54-
55-
5645
// BlockDeviceInformation
5746

5847
#define STM32F4__IS_REMOVABLE FALSE
@@ -61,19 +50,6 @@
6150
#define STM32F4__SUPP_COPY_BACK FALSE
6251
#define STM32F4__NUM_REGIONS 3
6352

64-
65-
66-
//--//
67-
68-
#if defined(BUILD_RTM)
69-
#define MEMORY_BLOCKTYPE_SPECIAL BlockRange::BLOCKTYPE_DEPLOYMENT
70-
#else
71-
#define MEMORY_BLOCKTYPE_SPECIAL BlockRange::BLOCKTYPE_FILESYSTEM
72-
#endif
73-
74-
//--//
75-
76-
7753
const BlockRange g_STM32F4_BlockRange1[] =
7854
{
7955
{ BlockRange::BLOCKTYPE_BOOTSTRAP , 0, 2 }, // 08000000 bootloader 48k
@@ -88,10 +64,9 @@ const BlockRange g_STM32F4_BlockRange2[] =
8864
const BlockRange g_STM32F4_BlockRange3[] =
8965
{
9066
{ BlockRange::BLOCKTYPE_CODE , 0, 2 }, // 08020000 CLR 384k
91-
{ BlockRange::BLOCKTYPE_DEPLOYMENT, 3, 6 }, // 08080000 deployment 512k
67+
{ BlockRange::BLOCKTYPE_CODE , 3, 6 }, // 08080000 CLR 512k
9268
};
9369

94-
9570
const BlockRegionInfo g_STM32F4_BlkRegion[STM32F4__NUM_REGIONS] =
9671
{
9772
{
@@ -119,10 +94,6 @@ const BlockRegionInfo g_STM32F4_BlkRegion[STM32F4__NUM_REGIONS] =
11994
}
12095
};
12196

122-
123-
//--//
124-
125-
12697
const BlockDeviceInfo g_STM32F4_DeviceInfo=
12798
{
12899
{
@@ -141,7 +112,6 @@ const BlockDeviceInfo g_STM32F4_DeviceInfo=
141112
g_STM32F4_BlkRegion, // const BlockRegionInfo* pRegions;
142113
};
143114

144-
145115
struct MEMORY_MAPPED_NOR_BLOCK_CONFIG g_STM32F4_BS_Config =
146116
{
147117
{ // BLOCK_CONFIG
@@ -171,18 +141,5 @@ struct MEMORY_MAPPED_NOR_BLOCK_CONFIG g_STM32F4_BS_Config =
171141
FLASH_DEVICE_CODE, // UINT32 DeviceCode;
172142
};
173143

174-
//--//
175-
176-
177-
#if defined(ADS_LINKER_BUG__NOT_ALL_UNUSED_VARIABLES_ARE_REMOVED)
178-
#pragma arm section rodata = "g_STM32F4_BS"
179-
#endif
180-
181144
struct BlockStorageDevice g_STM32F4_BS;
182145

183-
#if defined(ADS_LINKER_BUG__NOT_ALL_UNUSED_VARIABLES_ARE_REMOVED)
184-
#pragma arm section rodata
185-
#endif
186-
187-
//--//
188-

0 commit comments

Comments
 (0)