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

Commit

Permalink
Merge pull request #424 from cw2/dev-cw2-stm32f429idiscovery
Browse files Browse the repository at this point in the history
Added STM32F429IDISCOVERY solution
  • Loading branch information
smaillet-ms authored Jul 9, 2016
2 parents 766de73 + 8ead86d commit addad8a
Show file tree
Hide file tree
Showing 31 changed files with 3,944 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Implementation for the MCBSTM32F400 board (STM32F4): Copyright (c) Oberon microsystems, Inc.
//
// *** STM32F429IDISCOVERY Block Storage Configuration ***
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <tinyhal.h>

#define FLASH_MANUFACTURER_CODE 0x0000 // not used
#define FLASH_DEVICE_CODE 0x0000 // not used

#define FLASH_BASE_ADDRESS1 0x08000000 // 4x 16KB
#define FLASH_BLOCK_COUNT1 4
#define FLASH_BYTES_PER_BLOCK1 0x04000
#define FLASH_BASE_ADDRESS2 0x08010000 // 1x 64KB
#define FLASH_BLOCK_COUNT2 1
#define FLASH_BYTES_PER_BLOCK2 0x10000
#define FLASH_BASE_ADDRESS3 0x08020000 // 7x 128KB
#define FLASH_BLOCK_COUNT3 7
#define FLASH_BYTES_PER_BLOCK3 0x20000
#define FLASH_BASE_ADDRESS4 0x08100000 // 4x 16KB
#define FLASH_BLOCK_COUNT4 4
#define FLASH_BYTES_PER_BLOCK4 0x04000
#define FLASH_BASE_ADDRESS5 0x08110000 // 1x 64KB
#define FLASH_BLOCK_COUNT5 1
#define FLASH_BYTES_PER_BLOCK5 0x10000
#define FLASH_BASE_ADDRESS6 0x08120000 // 7x 128KB
#define FLASH_BLOCK_COUNT6 7
#define FLASH_BYTES_PER_BLOCK6 0x20000

#define FLASH_BYTES_PER_SECTOR 2
#define FLASH_BLOCK_ERASE_TYPICAL_TIME_USEC 1000000 // not used
#define FLASH_SECTOR_WRITE_TYPICAL_TIME_USEC 10 // not used
#define FLASH_BLOCK_ERASE_MAX_TIME_USEC 4000000 // not used
#define FLASH_SECTOR_WRITE_MAX_TIME_USEC 100 // not used
#define FLASH_BLOCK_ERASE_ACTUAL_TIME_USEC 10000 // not used

// EBIU Information

#define STM32F4__CHIP_SELECT 0
#define STM32F4__WAIT_STATES 5 // not used
#define STM32F4__RELEASE_COUNTS 0
#define STM32F4__BIT_WIDTH 16
#define STM32F4__BASE_ADDRESS 0x08000000
#define STM32F4__SIZE_IN_BYTES 0x00100000
#define STM32F4__WP_GPIO_PIN GPIO_PIN_NONE
#define STM32F4__WP_ACTIVE FALSE

// BlockDeviceInformation

#define STM32F4__IS_REMOVABLE FALSE
#define STM32F4__SUPPORTS_XIP TRUE
#define STM32F4__WRITE_PROTECTED FALSE
#define STM32F4__SUPP_COPY_BACK FALSE
#define STM32F4__NUM_REGIONS 6



//--//


const BlockRange g_STM32F4_BlockRange1[] =
{
{ BlockRange::BLOCKTYPE_BOOTSTRAP , 0, 2 }, // 08000000 bootloader 48k
{ BlockRange::BLOCKTYPE_CONFIG , 3, 3 }, // 0800C000 config 16k
};

const BlockRange g_STM32F4_BlockRange2[] =
{
{ BlockRange::BLOCKTYPE_CODE , 0, 0 }, // 08010000 CLR 64k
};

const BlockRange g_STM32F4_BlockRange3[] =
{
{ BlockRange::BLOCKTYPE_CODE , 0, 6 }, // 08020000 CLR 896k
};

const BlockRange g_STM32F4_BlockRange4[] =
{
{ BlockRange::BLOCKTYPE_DEPLOYMENT, 0, 3 }, // 08100000 deployment 64k
};

const BlockRange g_STM32F4_BlockRange5[] =
{
{ BlockRange::BLOCKTYPE_DEPLOYMENT, 0, 0 }, // 08110000 deployment 64k
};

const BlockRange g_STM32F4_BlockRange6[] =
{
{ BlockRange::BLOCKTYPE_DEPLOYMENT, 0, 6 }, // 08120000 deployment 896k
//{ BlockRange::BLOCKTYPE_UPDATE, 3, 6 },
};


const BlockRegionInfo g_STM32F4_BlkRegion[STM32F4__NUM_REGIONS] =
{
{
FLASH_BASE_ADDRESS1, // ByteAddress Start; // Starting Sector address
FLASH_BLOCK_COUNT1, // UINT32 NumBlocks; // total number of blocks in this region
FLASH_BYTES_PER_BLOCK1, // UINT32 BytesPerBlock; // Total number of bytes per block
ARRAYSIZE_CONST_EXPR(g_STM32F4_BlockRange1),
g_STM32F4_BlockRange1,
},

{
FLASH_BASE_ADDRESS2, // ByteAddress Start; // Starting Sector address
FLASH_BLOCK_COUNT2, // UINT32 NumBlocks; // total number of blocks in this region
FLASH_BYTES_PER_BLOCK2, // UINT32 BytesPerBlock; // Total number of bytes per block
ARRAYSIZE_CONST_EXPR(g_STM32F4_BlockRange2),
g_STM32F4_BlockRange2,
},

{
FLASH_BASE_ADDRESS3, // ByteAddress Start; // Starting Sector address
FLASH_BLOCK_COUNT3, // UINT32 NumBlocks; // total number of blocks in this region
FLASH_BYTES_PER_BLOCK3, // UINT32 BytesPerBlock; // Total number of bytes per block
ARRAYSIZE_CONST_EXPR(g_STM32F4_BlockRange3),
g_STM32F4_BlockRange3,
},
{
FLASH_BASE_ADDRESS4, // ByteAddress Start; // Starting Sector address
FLASH_BLOCK_COUNT4, // UINT32 NumBlocks; // total number of blocks in this region
FLASH_BYTES_PER_BLOCK4, // UINT32 BytesPerBlock; // Total number of bytes per block
ARRAYSIZE_CONST_EXPR(g_STM32F4_BlockRange4),
g_STM32F4_BlockRange4,
},

{
FLASH_BASE_ADDRESS5, // ByteAddress Start; // Starting Sector address
FLASH_BLOCK_COUNT5, // UINT32 NumBlocks; // total number of blocks in this region
FLASH_BYTES_PER_BLOCK5, // UINT32 BytesPerBlock; // Total number of bytes per block
ARRAYSIZE_CONST_EXPR(g_STM32F4_BlockRange5),
g_STM32F4_BlockRange5,
},

{
FLASH_BASE_ADDRESS6, // ByteAddress Start; // Starting Sector address
FLASH_BLOCK_COUNT6, // UINT32 NumBlocks; // total number of blocks in this region
FLASH_BYTES_PER_BLOCK6, // UINT32 BytesPerBlock; // Total number of bytes per block
ARRAYSIZE_CONST_EXPR(g_STM32F4_BlockRange6),
g_STM32F4_BlockRange6,
}
};

const BlockDeviceInfo g_STM32F4_DeviceInfo=
{
{
STM32F4__IS_REMOVABLE, // BOOL Removable;
STM32F4__SUPPORTS_XIP, // BOOL SupportsXIP;
STM32F4__WRITE_PROTECTED, // BOOL WriteProtected;
STM32F4__SUPP_COPY_BACK // BOOL SupportsCopyBack
},
FLASH_SECTOR_WRITE_TYPICAL_TIME_USEC, // UINT32 MaxSectorWrite_uSec;
FLASH_BLOCK_ERASE_ACTUAL_TIME_USEC, // UINT32 MaxBlockErase_uSec;
FLASH_BYTES_PER_SECTOR, // UINT32 BytesPerSector;

FLASH_MEMORY_Size, // UINT32 Size;

STM32F4__NUM_REGIONS, // UINT32 NumRegions;
g_STM32F4_BlkRegion, // const BlockRegionInfo* pRegions;
};

struct MEMORY_MAPPED_NOR_BLOCK_CONFIG g_STM32F4_BS_Config =
{
{ // BLOCK_CONFIG
{
STM32F4__WP_GPIO_PIN, // GPIO_PIN Pin;
STM32F4__WP_ACTIVE, // BOOL ActiveState;
},

&g_STM32F4_DeviceInfo, // BlockDeviceinfo
},

{ // CPU_MEMORY_CONFIG
STM32F4__CHIP_SELECT, // UINT8 CPU_MEMORY_CONFIG::ChipSelect;
TRUE, // UINT8 CPU_MEMORY_CONFIG::ReadOnly;
STM32F4__WAIT_STATES, // UINT32 CPU_MEMORY_CONFIG::WaitStates;
STM32F4__RELEASE_COUNTS, // UINT32 CPU_MEMORY_CONFIG::ReleaseCounts;
STM32F4__BIT_WIDTH, // UINT32 CPU_MEMORY_CONFIG::BitWidth;
STM32F4__BASE_ADDRESS, // UINT32 CPU_MEMORY_CONFIG::BaseAddress;
STM32F4__SIZE_IN_BYTES, // UINT32 CPU_MEMORY_CONFIG::SizeInBytes;
0, // UINT8 CPU_MEMORY_CONFIG::XREADYEnable
0, // UINT8 CPU_MEMORY_CONFIG::ByteSignalsForRead
0, // UINT8 CPU_MEMORY_CONFIG::ExternalBufferEnable
},

0, // UINT32 ChipProtection;
FLASH_MANUFACTURER_CODE, // UINT32 ManufacturerCode;
FLASH_DEVICE_CODE, // UINT32 DeviceCode;
};

struct BlockStorageDevice g_STM32F4_BS;

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyName>STM32F4_blconfig_STM32F429IDISCOVERY</AssemblyName>
<Size>
</Size>
<ProjectGuid>{9DF67033-DC20-426A-B499-2A600BE0E134}</ProjectGuid>
<Description>Block storage configuration for STM32F429IDISCOVERY</Description>
<Level>HAL</Level>
<LibraryFile>STM32F4_blconfig_STM32F429IDISCOVERY.$(LIB_EXT)</LibraryFile>
<ProjectPath>$(MSBuildThisFileFullPath)</ProjectPath>
<ManifestFile>STM32F4_blconfig_STM32F429IDISCOVERY.$(LIB_EXT).manifest</ManifestFile>
<Groups>Solutions\STM32F429IDISCOVERY</Groups>
<LibraryCategory>
<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="">
<VersionDependency xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">
<Major>4</Major>
<Minor>0</Minor>
<Revision>0</Revision>
<Build>0</Build>
<Extra />
<Date>2009-08-12</Date>
</VersionDependency>
<ComponentType xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">LibraryCategory</ComponentType>
</MFComponent>
</LibraryCategory>
<Documentation>
</Documentation>
<PlatformIndependent>False</PlatformIndependent>
<CustomSpecific>STM32F429IDISCOVERY</CustomSpecific>
<Required>False</Required>
<IgnoreDefaultLibPath>False</IgnoreDefaultLibPath>
<IsStub>False</IsStub>
<Directory>Solutions\STM32F429IDISCOVERY\DeviceCode\BlockStorage\STM32F4</Directory>
<OutputType>Library</OutputType>
<PlatformIndependentBuild>false</PlatformIndependentBuild>
<Version>4.0.0.0</Version>
</PropertyGroup>
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Settings" />
<PropertyGroup />
<ItemGroup>
<Compile Include="STM32F4_blconfig.cpp" />
</ItemGroup>
<ItemGroup />
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Implementation for the MCBSTM32F400 board (STM32F4): Copyright (c) Oberon microsystems, Inc.
//
// *** STM32F429IDISCOVERY Block Storage AddDevice Configuration ***
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <tinyhal.h>


extern struct BlockStorageDevice g_STM32F4_BS;
extern struct IBlockStorageDevice g_STM32F4_Flash_DeviceTable;
extern struct BLOCK_CONFIG g_STM32F4_BS_Config;



void BlockStorage_AddDevices()
{
BlockStorageList::AddDevice( &g_STM32F4_BS, &g_STM32F4_Flash_DeviceTable, &g_STM32F4_BS_Config, FALSE );
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyName>BlockStorage_AddDevices_STM32F429IDISCOVERY</AssemblyName>
<Size>
</Size>
<ProjectGuid>{A3E9B868-E484-4A15-B4CC-6CEFB50352B1}</ProjectGuid>
<Description>Block storage add device driver for STM32F429IDISCOVERY</Description>
<Level>HAL</Level>
<LibraryFile>BlockStorage_AddDevices_STM32F429IDISCOVERY.$(LIB_EXT)</LibraryFile>
<ProjectPath>$(MSBuildThisFileFullPath)</ProjectPath>
<ManifestFile>BlockStorage_AddDevices_STM32F429IDISCOVERY.$(LIB_EXT).manifest</ManifestFile>
<Groups>Solutions\STM32F429IDISCOVERY</Groups>
<LibraryCategory>
<MFComponent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="BlockStorageAddDevices_HAL" Guid="{D1C1D946-18A1-4f12-807A-A182C4059D86}" ProjectPath="" xmlns="">
<VersionDependency xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">
<Major>4</Major>
<Minor>0</Minor>
<Revision>0</Revision>
<Build>0</Build>
<Extra />
<Date>2009-08-12</Date>
</VersionDependency>
<ComponentType xmlns="http://schemas.microsoft.com/netmf/InventoryFormat.xsd">LibraryCategory</ComponentType>
</MFComponent>
</LibraryCategory>
<Documentation>
</Documentation>
<PlatformIndependent>False</PlatformIndependent>
<CustomSpecific>STM32F429IDISCOVERY</CustomSpecific>
<Required>False</Required>
<IgnoreDefaultLibPath>False</IgnoreDefaultLibPath>
<IsStub>False</IsStub>
<Directory>Solutions\STM32F429IDISCOVERY\DeviceCode\BlockStorage\AddDevices</Directory>
<OutputType>Library</OutputType>
<PlatformIndependentBuild>false</PlatformIndependentBuild>
<Version>4.0.0.0</Version>
</PropertyGroup>
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Settings" />
<PropertyGroup />
<ItemGroup>
<Compile Include="Bl_AddDevices.cpp" />
</ItemGroup>
<ItemGroup />
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

<PropertyGroup>
<Directory>Solutions\STM32F429IDISCOVERY\DeviceCode\BlockStorage</Directory>
</PropertyGroup>

<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Settings" />

<ItemGroup>
<SubDirectories Include="AddDevices"/>
<SubDirectories Include="STM32F4"/>
</ItemGroup>

<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Targets" />

</Project>

Loading

0 comments on commit addad8a

Please sign in to comment.