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

Commit 0664b4e

Browse files
committed
Merge pull request #245 from cw2/issue-218-stm32f4disco-itm-tinybooter
STM32F4DISCOVERY: TinyBooter uses ITM0
2 parents 51fdb5c + 5142cfc commit 0664b4e

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

Solutions/STM32F4DISCOVERY/DeviceCode/Init/IO_Init.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
#include <tinyhal.h>
1515
#include "..\..\..\..\DeviceCode\Targets\Native\STM32F4\DeviceCode\stm32f4xx.h"
1616

17+
// Define the generic port table, only one generic extensionn port type supported
18+
// and that is the ITM hardware trace port on Channel 0.
19+
extern GenericPortTableEntry const Itm0GenericPort;
20+
extern GenericPortTableEntry const* const g_GenericPorts[TOTAL_GENERIC_PORTS] = { &Itm0GenericPort };
21+
1722
extern void STM32F4_GPIO_Pin_Config( GPIO_PIN pin, UINT32 mode, GPIO_RESISTOR resistor, UINT32 alternate ); // Workaround, since CPU_GPIO_DisablePin() does not correctly initialize pin speeds
1823

1924
void __section("SectionForBootstrapOperations") BootstrapCode_GPIO()

Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
<Compile Include="$(SRC_DIR)\Allocator.cpp" />
3131
<Compile Include="$(SRC_DIR)\TinyBooterEntry.cpp" />
3232
</ItemGroup>
33+
<ItemGroup>
34+
<DriverLibs Include="CortexMx_ItmPort.$(LIB_EXT)" />
35+
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\dotNetMF.proj" />
36+
</ItemGroup>
3337
<ItemGroup>
3438
<PlatformIndependentLibs Include="TinybooterLib.$(LIB_EXT)" />
3539
<RequiredProjects Include="$(SPOCLIENT)\Application\TinyBooter\TinyBooterLib.proj" />
@@ -87,8 +91,8 @@
8791
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\Drivers\Stubs\Processor\stubs_SPI\dotNetMF.proj" />
8892
</ItemGroup>
8993
<ItemGroup>
90-
<DriverLibs Include="STM32F4_USART.$(LIB_EXT)" />
91-
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_USART\dotNetMF.proj" />
94+
<DriverLibs Include="cpu_usart_stubs.$(LIB_EXT)" />
95+
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\Drivers\Stubs\processor\stubs_USART\dotNetMF.proj" />
9296
</ItemGroup>
9397
<ItemGroup>
9498
<DriverLibs Include="STM32F4_USB.$(LIB_EXT)" />
@@ -131,8 +135,8 @@
131135
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\PAL\COM\I2C\stubs\dotNetMF.proj" />
132136
</ItemGroup>
133137
<ItemGroup>
134-
<DriverLibs Include="usart_pal.$(LIB_EXT)" />
135-
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\PAL\COM\USART\dotNetMF.proj" />
138+
<DriverLibs Include="usart_pal_stubs.$(LIB_EXT)" />
139+
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\PAL\COM\USART\stubs\dotNetMF.proj" />
136140
</ItemGroup>
137141
<ItemGroup>
138142
<DriverLibs Include="usb_pal.$(LIB_EXT)" />

Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565
<Import Condition="'$(SERIALIZATION_FEATUREPROJ)'==''" Project="$(SPOCLIENT)\Framework\Features\Serialization.featureproj" />
6666
<Import Condition="'$(WINDOWS_DEVICES_FEATUREPROJ)'==''" Project="$(SPOCLIENT)\Framework\Features\Windows_Devices.featureproj" />
6767
<Import Project="$(SPOCLIENT)\tools\targets\Microsoft.SPOT.System.Interop.Settings" />
68+
<ItemGroup>
69+
<DriverLibs Include="CortexMx_ItmPort.$(LIB_EXT)" />
70+
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\dotNetMF.proj" />
71+
</ItemGroup>
6872
<ItemGroup>
6973
<DriverLibs Include="LargeBuffer_hal_stubs.$(LIB_EXT)" />
7074
<RequiredProjects Include="$(SPOCLIENT)\DeviceCode\drivers\LargeBuffer\stubs\dotnetmf.proj" />

Solutions/STM32F4DISCOVERY/platform_selector.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,16 @@
8080

8181
#define INSTRUMENTATION_H_GPIO_PIN GPIO_PIN_NONE
8282

83-
#define TOTAL_USART_PORT 7 // ITM0 + 6 physical UARTS
83+
#define TOTAL_USART_PORT 6 // 6 physical UARTS
8484

8585
#define USART_DEFAULT_PORT COM1
8686
#define USART_DEFAULT_BAUDRATE 115200
8787

88+
#define TOTAL_GENERIC_PORTS 1 // 1 generic port extensions (ITM channel 0 )
89+
#define ITM_GENERIC_PORTNUM 0 // ITM0 is index 0 in generic port interface table
90+
8891
#define DEBUG_TEXT_PORT ITM0
89-
#define STDIO USB1
92+
#define STDIO ITM0
9093
#define DEBUGGER_PORT USB1
9194
#define MESSAGING_PORT USB1
9295

0 commit comments

Comments
 (0)