新闻中心

EEPW首页>嵌入式系统>设计应用> 编译STM32库到固件----探索4 NETMF学习

编译STM32库到固件----探索4 NETMF学习

作者: 时间:2016-11-11 来源:网络 收藏
参考莫雨的书本把STM32库移植到MF中去,不过文件都是用的他书本上带的代码

1. 按照书本上65页 在PK中新建一个文件夹

本文引用地址://m.amcfsurvey.com/article/201611/316822.htm

目录C:PKDeviceCodeTargetsNativeSTM32F10xDeviceCodeLibraries STM32F10xDeviceCode Libraries为新建的文件夹 是三级文件夹

2. 比较懒惰 就直接把他文件夹E:MF43玩转NETMF移植SourceCodeSourceCodeDeviceCodeTargetsNativeSTM32F10xDeviceCodeLibraries 下的所有文件拷贝过来了

3. 书本上说的把库的工程加入到NativeSample中,我修改的PK43自带的STM32的工程 里面没有NativeSample工程 所以就把它加载到TinyClr中了

4. 到文件夹C:PKSolutionsSTM32BigStoneTinyCLR 中 修改TinyCLR.Proj

在接近最后的地方加上

equiredProjects Include="$(SPOCLIENT)DeviceCodeTargetsNativeSTM32F10xDeviceCodeLibrariesLibraries.proj" />

5. 可以编译

6在tynyclr.cpp加上点程序看看

int GetLength(char *pszVal)

{

if(pszVal == NULL)

{

return 0;

}

int iLen = 0;

while(pszVal[iLen] != )

{

++ iLen;

}

return iLen;

}

void ApplicationEntryPoint()

{

CLR_SETTINGS clrSettings;

memset(&clrSettings, 0, sizeof(CLR_SETTINGS));

clrSettings.MaxContextSwitches = 50;

clrSettings.WaitForDebugger = false;

clrSettings.EnterDebuggerLoopAfterExit = true;

const int USART_PORT = ConvertCOM_ComPort(COM2);//ConvertCOM_ComPort(COM2);

USART_Initialize(USART_PORT,115200, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE );

char szHello[] = "Hello,.Net Micro Framework!rn";

USART_Write(USART_PORT,szHello,GetLength(szHello));

ClrStartup( clrSettings );

#if !defined(BUILD_RTM)

debug_printf( "Exiting.rn" );

#else

::CPU_Reset();

#endif

}

7 测试一下




评论


技术专区

关闭