/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.cpp |
---|
0,0 → 1,827 |
/******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** |
* File Name : STBLLIB.cpp |
* Author : MCD Application Team |
* Version : v2.2.0 |
* Date : 05/03/2010 |
* Description : Implements the System memory boot loader protocol interface |
******************************************************************************** |
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
*******************************************************************************/ |
#include <malloc.h> |
#include "stdafx.h" |
#include "STBLLIB.h" |
/************************************************************************************/ |
/* Generic BL API types |
/* |
/* |
/************************************************************************************/ |
typedef BYTE virt_GetProgress(LPBYTE progress); |
typedef BYTE virt_GetActivityTime(LPDWORD time); |
typedef BYTE virt_SetActivityTime(DWORD time); |
typedef BYTE virt_TARGET_GetFlashSize(DWORD Addr, LPWORD val); |
typedef BYTE virt_TARGET_GetMemoryAddress(DWORD Addr, LPBYTE val); |
typedef BYTE virt_TARGET_GetRDPOptionByte(LPBYTE RDP); |
typedef BYTE virt_TARGET_GetWRPOptionBytes(LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3); |
typedef BYTE virt_Send_RQ(LPSTBL_Request pRQ); |
typedef BYTE virt_SetCOMSettings(int numPort, long speedInBaud, int nbBit, int parity, float nbStopBit); |
typedef BYTE virt_COM_Open(); |
typedef BYTE virt_COM_Close(); |
typedef BYTE virt_STBL_SetSpeed(DWORD speed); |
typedef BYTE virt_STBL_Init_BL(); |
typedef BYTE virt_STBL_GET(LPBYTE Version, LPCommands pCmds); |
typedef BYTE virt_STBL_GET_VER_ROPS(LPBYTE Version, LPBYTE ROPEnabled, LPBYTE ROPDisabled); |
typedef BYTE virt_STBL_GET_ID(LPBYTE size, LPBYTE pID); |
typedef BYTE virt_STBL_READ(DWORD Address, BYTE Size, LPBYTE pData); |
typedef BYTE virt_STBL_GO(DWORD Address); |
typedef BYTE virt_STBL_WRITE(DWORD address, BYTE size, LPBYTE pData); |
typedef BYTE virt_STBL_ERASE(WORD NbSectors, LPBYTE pSectors); |
typedef BYTE virt_STBL_WRITE_PROTECT(BYTE NbSectors, LPBYTE pSectors); |
typedef BYTE virt_STBL_WRITE_TEMP_UNPROTECT(); |
typedef BYTE virt_STBL_WRITE_PERM_UNPROTECT(); |
typedef BYTE virt_STBL_READOUT_PROTECT(); |
typedef BYTE virt_STBL_READOUT_TEMP_UNPROTECT(); |
typedef BYTE virt_STBL_READOUT_PERM_UNPROTECT(); |
typedef BYTE virt_STBL_UPLOAD(DWORD Address, LPBYTE pData, DWORD Length); |
typedef BYTE virt_STBL_VERIFY(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad); |
typedef BYTE virt_STBL_DNLOAD(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad); |
typedef BYTE virt_SetPaketSize(BYTE size); |
typedef BYTE virt_GetPaketSize(LPBYTE size); |
typedef ACKS virt_GetAckValue(); |
typedef BOOL virt_COM_is_Open(); |
typedef BYTE virt_SetTimeOut(DWORD vms); |
typedef BYTE virt_TARGET_GetUserOptionByte(LPBYTE User); |
typedef BYTE virt_TARGET_GetDataOptionByte(LPBYTE Data0, LPBYTE Data1); |
typedef BYTE virt_TARGET_SetSIFData(BYTE User, BYTE RDP, BYTE Data0, BYTE Data1, BYTE WRP0, BYTE WRP1, BYTE WRP2, BYTE WRP3); |
typedef BYTE virt_TARGET_GetSIFData(LPBYTE User, LPBYTE RDP, LPBYTE Data0, LPBYTE Data1, LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3); |
typedef BYTE virt_STBL_SetRts(BOOL Val); |
typedef BYTE virt_STBL_SetDtr(BOOL Val); |
typedef BYTE virt_STBL_setTxd(BOOL val); |
typedef BYTE virt_STBL_getCts(BOOL* pval); |
typedef BYTE virt_STBL_getDtr(BOOL* pval); |
typedef BYTE virt_STBL_getRi(BOOL* pval); |
typedef BYTE virt_STBL_getCd(BOOL* pval); |
typedef BYTE virt_STBL_SetEcho(int val); |
typedef BYTE virt_STBL_SetFlowControl(int Val); |
/************************************************************************************/ |
/* Generic BL API references |
/* |
/* |
/************************************************************************************/ |
virt_GetProgress *pt_GetProgress; //(LPBYTE progress); |
virt_GetActivityTime *pt_GetActivityTime; //(LPDWORD time); |
virt_SetActivityTime *pt_SetActivityTime; //(DWORD time); |
virt_TARGET_GetFlashSize *pt_TARGET_GetFlashSize; //(DWORD Addr, LPWORD val); |
virt_TARGET_GetMemoryAddress *pt_TARGET_GetMemoryAddress; //(DWORD Addr, LPWORD val); |
virt_TARGET_GetRDPOptionByte *pt_TARGET_GetRDPOptionByte; //(LPBYTE RDP); |
virt_TARGET_GetWRPOptionBytes *pt_TARGET_GetWRPOptionBytes; //(LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3); |
virt_Send_RQ *pt_Send_RQ; //(LPSTBL_Request pRQ); |
virt_SetCOMSettings *pt_SetCOMSettings; //(int numPort, long speedInBaud, int nbBit, int parity, float nbStopBit); |
virt_COM_Open *pt_COM_Open; //(); |
virt_COM_Close *pt_COM_Close; //(); |
virt_STBL_SetSpeed *pt_STBL_SetSpeed; //(DWORD speed); |
virt_STBL_Init_BL *pt_STBL_Init_BL; //(); |
virt_STBL_GET *pt_STBL_GET; //(LPBYTE Version, LPCommands pCmds); |
virt_STBL_GET_VER_ROPS *pt_STBL_GET_VER_ROPS; //(LPBYTE Version, LPBYTE ROPEnabled, LPBYTE ROPDisabled); |
virt_STBL_GET_ID *pt_STBL_GET_ID; //(LPBYTE size, LPBYTE pID); |
virt_STBL_READ *pt_STBL_READ; //(DWORD Address, BYTE Size, LPBYTE pData); |
virt_STBL_GO *pt_STBL_GO; //(DWORD Address); |
virt_STBL_WRITE *pt_STBL_WRITE; //(DWORD address, BYTE size, LPBYTE pData); |
virt_STBL_ERASE *pt_STBL_ERASE; //(BYTE NbSectors, LPBYTE pSectors); |
virt_STBL_WRITE_PROTECT *pt_STBL_WRITE_PROTECT; //(BYTE NbSectors, LPBYTE pSectors); |
virt_STBL_WRITE_TEMP_UNPROTECT *pt_STBL_WRITE_TEMP_UNPROTECT; //(); |
virt_STBL_WRITE_PERM_UNPROTECT *pt_STBL_WRITE_PERM_UNPROTECT; //(); |
virt_STBL_READOUT_PROTECT *pt_STBL_READOUT_PROTECT; //(); |
virt_STBL_READOUT_TEMP_UNPROTECT *pt_STBL_READOUT_TEMP_UNPROTECT; //(); |
virt_STBL_READOUT_PERM_UNPROTECT *pt_STBL_READOUT_PERM_UNPROTECT; //(); |
virt_STBL_UPLOAD *pt_STBL_UPLOAD; //(DWORD Address, LPBYTE pData, DWORD Length); |
virt_STBL_VERIFY *pt_STBL_VERIFY; //(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad); |
virt_STBL_DNLOAD *pt_STBL_DNLOAD; //(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad); |
virt_SetPaketSize *pt_SetPaketSize; //(BYTE size); |
virt_GetPaketSize *pt_GetPaketSize; //(LPBYTE size); |
virt_GetAckValue *pt_GetAckValue; //(); |
virt_COM_is_Open *pt_COM_is_Open; //(); |
virt_SetTimeOut *pt_SetTimeOut; //(DWORD vms); |
virt_TARGET_GetUserOptionByte *pt_TARGET_GetUserOptionByte; //(LPBYTE User); |
virt_TARGET_GetDataOptionByte *pt_TARGET_GetDataOptionByte; //(LPBYTE Data0, LPBYTE Data1); |
virt_TARGET_SetSIFData *pt_TARGET_SetSIFData; //(BYTE User, BYTE RDP, BYTE Data0, BYTE Data1, BYTE WRP0, BYTE WRP1, BYTE WRP2, BYTE WRP3); |
virt_TARGET_GetSIFData *pt_TARGET_GetSIFData; //(LPBYTE User, LPBYTE RDP, LPBYTE Data0, LPBYTE Data1, LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3); |
virt_STBL_SetRts *pt_STBL_SetRts; //(BOOL val); |
virt_STBL_SetDtr *pt_STBL_SetDtr; //(BOOL val); |
virt_STBL_setTxd *pt_STBL_setTxd; //(BOOL val); |
virt_STBL_getCts *pt_STBL_getCts; //(BOOL* pval); |
virt_STBL_getDtr *pt_STBL_getDtr; //(BOOL* pval); |
virt_STBL_getRi *pt_STBL_getRi; //(BOOL* pval); |
virt_STBL_getCd *pt_STBL_getCd; //(BOOL* pval); |
virt_STBL_SetEcho *pt_STBL_SetEcho ; //(int val); |
virt_STBL_SetFlowControl *pt_STBL_SetFlowControl ; //(bool val); |
DWORD MAX_DATA_SIZE = 0xFF; // Packet size(in byte) |
BYTE ACK = 0x79; |
BYTE NACK = 0x1F; |
ACKS ACK_VALUE = ST79; |
LPTARGET_DESCRIPTOR Target; |
CRS232 Cur_COM; |
ACKS McuTarget; |
DWORD Progress; |
DWORD ActivityTime ; |
HINSTANCE ST_BL_Lib_Hdle = NULL; |
BOOL APIENTRY DllMain( HANDLE hModule, |
DWORD ul_reason_for_call, |
LPVOID lpReserved |
) |
{ |
switch (ul_reason_for_call) |
{ |
case DLL_PROCESS_ATTACH :{ |
McuTarget = UNDEFINED; |
Target = (LPTARGET_DESCRIPTOR)malloc(sizeof(TARGET_DESCRIPTOR)); |
Target->Version = 0x00; |
Target->CmdCount = 0x00; |
Target->PIDLen = 0x00; |
Target->PID = (LPBYTE)malloc(1); |
Target->ROPE = 0x00; |
Target->ROPD = 0x00; |
Target->GET_CMD = FALSE ; //Get the version and the allowed commands supported by the current version of the boot loader |
Target->GET_VER_ROPS_CMD = FALSE ; //Get the BL version and the Read Protection status of the NVM |
Target->GET_ID_CMD = FALSE ; //Get the chip ID |
Target->READ_CMD = FALSE ; //Read up to 256 bytes of memory starting from an address specified by the user |
Target->GO_CMD = FALSE ; //Jump to an address specified by the user to execute (a loaded) code |
Target->WRITE_CMD = FALSE ; //Write maximum 256 bytes to the RAM or the NVM starting from an address specified by the user |
Target->ERASE_CMD = FALSE ; //Erase from one to all the NVM sectors |
Target->ERASE_EXT_CMD = FALSE ; //Erase from one to all the NVM sectors |
Target->WRITE_PROTECT_CMD = FALSE ; //Enable the write protection in a permanent way for some sectors |
Target->WRITE_TEMP_UNPROTECT_CMD = FALSE ; //Disable the write protection in a temporary way for all NVM sectors |
Target->WRITE_PERM_UNPROTECT_CMD = FALSE ; //Disable the write protection in a permanent way for all NVM sectors |
Target->READOUT_PERM_PROTECT_CMD = FALSE ; //Enable the readout protection in a permanent way |
Target->READOUT_TEMP_UNPROTECT_CMD = FALSE ; //Disable the readout protection in a temporary way |
Target->READOUT_PERM_UNPROTECT_CMD = FALSE ; //Disable the readout protection in a permanent way |
}break; |
case DLL_THREAD_ATTACH :{ |
/*McuTarget = UNDEFINED; |
Target = (LPTARGET_DESCRIPTOR)malloc(sizeof(TARGET_DESCRIPTOR)); |
Target->Version = 0x00; |
Target->CmdCount = 0x00; |
Target->PIDLen = 0x00; |
Target->PID = (LPBYTE)malloc(1); |
Target->ROPE = 0x00; |
Target->ROPD = 0x00; |
Target->GET_CMD = FALSE ; //Get the version and the allowed commands supported by the current version of the boot loader |
Target->GET_VER_ROPS_CMD = FALSE ; //Get the BL version and the Read Protection status of the NVM |
Target->GET_ID_CMD = FALSE ; //Get the chip ID |
Target->READ_CMD = FALSE ; //Read up to 256 bytes of memory starting from an address specified by the user |
Target->GO_CMD = FALSE ; //Jump to an address specified by the user to execute (a loaded) code |
Target->WRITE_CMD = FALSE ; //Write maximum 256 bytes to the RAM or the NVM starting from an address specified by the user |
Target->ERASE_CMD = FALSE ; //Erase from one to all the NVM sectors |
Target->WRITE_PROTECT_CMD = FALSE ; //Enable the write protection in a permanent way for some sectors |
Target->WRITE_TEMP_UNPROTECT_CMD = FALSE ; //Disable the write protection in a temporary way for all NVM sectors |
Target->WRITE_PERM_UNPROTECT_CMD = FALSE ; //Disable the write protection in a permanent way for all NVM sectors |
Target->READOUT_PERM_PROTECT_CMD = FALSE ; //Enable the readout protection in a permanent way |
Target->READOUT_TEMP_UNPROTECT_CMD = FALSE ; //Disable the readout protection in a temporary way |
Target->READOUT_PERM_UNPROTECT_CMD = FALSE ; //Disable the readout protection in a permanent way |
*/}break; |
case DLL_THREAD_DETACH :{}break; |
case DLL_PROCESS_DETACH :{}break; |
} |
return TRUE; |
} |
/************************************************************************************/ |
/* SET COMMUNICATION INTERFACE TYPE |
/* UART - CAN - ... |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_SetComIntType(BYTE com_int_type) |
{ |
//com_int_type = 0; // This is reserved for Future, When the CANtoUSB Bridge will be available |
// The CAN module and DLL should be used in com_int_type =1 |
switch (com_int_type) |
{ |
case 0:{ |
ST_BL_Lib_Hdle = GetModuleHandle("STUARTBLLIB"); |
if ( ST_BL_Lib_Hdle == NULL ) |
{ |
ST_BL_Lib_Hdle = LoadLibrary("STUARTBLLIB") ; |
} |
}break; |
case 1:{ |
ST_BL_Lib_Hdle = GetModuleHandle("STCANBLLIB"); |
if ( ST_BL_Lib_Hdle == NULL ) |
{ |
ST_BL_Lib_Hdle = LoadLibrary("STCANBLLIB") ; |
} |
}break; |
} |
pt_GetProgress = (virt_GetProgress*)GetProcAddress(ST_BL_Lib_Hdle,"GetProgress"); |
pt_GetActivityTime = (virt_GetActivityTime*)GetProcAddress(ST_BL_Lib_Hdle,"GetActivityTime"); //(LPDWORD time); |
pt_SetActivityTime = (virt_SetActivityTime*)GetProcAddress(ST_BL_Lib_Hdle,"SetActivityTime"); //(DWORD time); |
pt_TARGET_GetFlashSize = (virt_TARGET_GetFlashSize*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetFlashSize"); |
pt_TARGET_GetMemoryAddress = (virt_TARGET_GetMemoryAddress*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetMemoryAddress"); |
pt_TARGET_GetRDPOptionByte = (virt_TARGET_GetRDPOptionByte*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetRDPOptionByte"); |
pt_TARGET_GetWRPOptionBytes = (virt_TARGET_GetWRPOptionBytes*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetWRPOptionBytes"); |
pt_Send_RQ = (virt_Send_RQ*)GetProcAddress(ST_BL_Lib_Hdle,"Send_RQ"); |
pt_SetCOMSettings = (virt_SetCOMSettings*)GetProcAddress(ST_BL_Lib_Hdle,"SetCOMSettings"); |
pt_COM_Open = (virt_COM_Open*)GetProcAddress(ST_BL_Lib_Hdle,"COM_Open"); |
pt_COM_Close = (virt_COM_Close*)GetProcAddress(ST_BL_Lib_Hdle,"COM_Close"); |
pt_STBL_SetSpeed = (virt_STBL_SetSpeed*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_SetSpeed"); |
pt_STBL_Init_BL = (virt_STBL_Init_BL*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_Init_BL"); |
pt_STBL_GET = (virt_STBL_GET*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_GET"); |
pt_STBL_GET_VER_ROPS = (virt_STBL_GET_VER_ROPS*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_GET_VER_ROPS"); |
pt_STBL_GET_ID = (virt_STBL_GET_ID*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_GET_ID"); |
pt_STBL_READ = (virt_STBL_READ*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_READ"); |
pt_STBL_GO = (virt_STBL_GO*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_GO"); |
pt_STBL_WRITE = (virt_STBL_WRITE*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_WRITE"); |
pt_STBL_ERASE = (virt_STBL_ERASE*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_ERASE"); |
pt_STBL_WRITE_PROTECT = (virt_STBL_WRITE_PROTECT*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_WRITE_PROTECT"); |
pt_STBL_WRITE_TEMP_UNPROTECT = (virt_STBL_WRITE_TEMP_UNPROTECT*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_WRITE_TEMP_UNPROTECT"); |
pt_STBL_WRITE_PERM_UNPROTECT = (virt_STBL_WRITE_PERM_UNPROTECT*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_WRITE_PERM_UNPROTECT"); |
pt_STBL_READOUT_PROTECT = (virt_STBL_READOUT_PROTECT*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_READOUT_PROTECT"); |
pt_STBL_READOUT_TEMP_UNPROTECT = (virt_STBL_READOUT_TEMP_UNPROTECT*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_READOUT_TEMP_UNPROTECT"); |
pt_STBL_READOUT_PERM_UNPROTECT = (virt_STBL_READOUT_PERM_UNPROTECT*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_READOUT_PERM_UNPROTECT"); |
pt_STBL_UPLOAD = (virt_STBL_UPLOAD*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_UPLOAD"); |
pt_STBL_VERIFY = (virt_STBL_VERIFY*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_VERIFY"); |
pt_STBL_DNLOAD = (virt_STBL_DNLOAD*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_DNLOAD"); |
pt_SetPaketSize = (virt_SetPaketSize*)GetProcAddress(ST_BL_Lib_Hdle,"SetPaketSize"); |
pt_GetPaketSize = (virt_GetPaketSize*)GetProcAddress(ST_BL_Lib_Hdle,"GetPaketSize"); |
pt_GetAckValue = (virt_GetAckValue*)GetProcAddress(ST_BL_Lib_Hdle,"GetAckValue"); |
pt_COM_is_Open = (virt_COM_is_Open*)GetProcAddress(ST_BL_Lib_Hdle,"COM_is_Open"); |
pt_SetTimeOut = (virt_SetTimeOut*)GetProcAddress(ST_BL_Lib_Hdle,"SetTimeOut"); |
pt_TARGET_GetUserOptionByte = (virt_TARGET_GetUserOptionByte*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetUserOptionByte"); |
pt_TARGET_GetDataOptionByte = (virt_TARGET_GetDataOptionByte*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetDataOptionByte"); |
pt_TARGET_SetSIFData = (virt_TARGET_SetSIFData*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_SetSIFData"); |
pt_TARGET_GetSIFData = (virt_TARGET_GetSIFData*)GetProcAddress(ST_BL_Lib_Hdle,"TARGET_GetSIFData"); |
pt_STBL_SetRts = (virt_STBL_SetRts*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_SetRts"); |
pt_STBL_SetDtr = (virt_STBL_SetDtr*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_SetDtr"); |
pt_STBL_setTxd = (virt_STBL_setTxd*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_setTxd"); |
pt_STBL_getCts = (virt_STBL_getCts*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_getCts"); |
pt_STBL_getDtr = (virt_STBL_getDtr*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_getDtr"); |
pt_STBL_getRi = (virt_STBL_getRi*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_getRi"); |
pt_STBL_getCd = (virt_STBL_getCd*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_getCd"); |
pt_STBL_SetEcho = (virt_STBL_SetEcho*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_SetEcho"); |
pt_STBL_SetFlowControl = (virt_STBL_SetFlowControl*)GetProcAddress(ST_BL_Lib_Hdle,"STBL_SetFlowControl"); |
return 0; |
} |
/************************************************************************************/ |
/*Set the communication settings for UART, CAN, ... |
/* UART - numPort, speedInBaud, nbBit, parity, nbStopBit |
/* CAN - only : speedInBaud |
/************************************************************************************/ |
STBLLIB_API BYTE SetCOMSettings(int numPort, long speedInBaud, int nbBit, |
int parity, float nbStopBit) |
{ |
if(pt_SetCOMSettings) |
return pt_SetCOMSettings(numPort, speedInBaud, nbBit, parity, nbStopBit); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE Send_RQ(LPSTBL_Request pRQ) |
{ |
if(pt_Send_RQ) |
return pt_Send_RQ(pRQ); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE COM_Open() |
{ |
if(pt_COM_Open) |
return pt_COM_Open(); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE COM_Close() |
{ |
if(pt_COM_Close) |
return pt_COM_Close(); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_SetSpeed(DWORD speed) |
{ |
if(pt_STBL_SetSpeed) |
return pt_STBL_SetSpeed(speed); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_Init_BL() |
{ |
if(pt_STBL_Init_BL) |
return pt_STBL_Init_BL(); |
else |
return LIB_LOADING_ERROR; |
} |
/******************************************************************************************/ |
/* Boot Loader commands implementation |
/******************************************************************************************/ |
STBLLIB_API BYTE STBL_GET(LPBYTE Version, LPCommands pCmds) |
{ |
if(pt_STBL_GET) |
return pt_STBL_GET(Version, pCmds); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_GET_VER_ROPS(LPBYTE Version, LPBYTE ROPEnabled, LPBYTE ROPDisabled) |
{ |
if(pt_STBL_GET_VER_ROPS) |
return pt_STBL_GET_VER_ROPS(Version, ROPEnabled, ROPDisabled); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_GET_ID(LPBYTE size, LPBYTE pID) |
{ |
if(pt_STBL_GET_ID) |
return pt_STBL_GET_ID(size, pID); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_READ(DWORD Address, BYTE Size, LPBYTE pData) |
{ |
if(pt_STBL_READ) |
return pt_STBL_READ(Address, Size, pData); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_GO(DWORD Address) |
{ |
if(pt_STBL_GO) |
return pt_STBL_GO(Address); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_WRITE(DWORD address, BYTE size, LPBYTE pData) |
{ |
if(pt_STBL_WRITE) |
return pt_STBL_WRITE(address, size, pData); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_ERASE(WORD NbSectors, LPBYTE pSectors) |
{ |
if(pt_STBL_ERASE) |
return pt_STBL_ERASE(NbSectors, pSectors); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_WRITE_PROTECT(BYTE NbSectors, LPBYTE pSectors) |
{ |
if(pt_STBL_WRITE_PROTECT) |
return pt_STBL_WRITE_PROTECT(NbSectors, pSectors); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_WRITE_TEMP_UNPROTECT() |
{ |
if(pt_STBL_WRITE_TEMP_UNPROTECT) |
return pt_STBL_WRITE_TEMP_UNPROTECT(); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_WRITE_PERM_UNPROTECT() |
{ |
if(pt_STBL_WRITE_PERM_UNPROTECT) |
return pt_STBL_WRITE_PERM_UNPROTECT(); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_READOUT_PROTECT() |
{ |
if(pt_STBL_READOUT_PROTECT) |
return pt_STBL_READOUT_PROTECT(); |
else |
return LIB_LOADING_ERROR; |
} |
STBLLIB_API BYTE STBL_READOUT_TEMP_UNPROTECT() |
{ |
if(pt_STBL_READOUT_TEMP_UNPROTECT) |
return pt_STBL_READOUT_TEMP_UNPROTECT(); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* READOUT_PERM_UNPROTECT |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_READOUT_PERM_UNPROTECT() |
{ |
if(pt_STBL_READOUT_PERM_UNPROTECT) |
return pt_STBL_READOUT_PERM_UNPROTECT(); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* UPLOAD |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_UPLOAD(DWORD Address, LPBYTE pData, DWORD Length) |
{ |
if(pt_STBL_UPLOAD) |
return pt_STBL_UPLOAD(Address, pData, Length); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* VERIFY |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_VERIFY(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad) |
{ |
if(pt_STBL_VERIFY) |
return pt_STBL_VERIFY(Address, pData, Length,bTruncateLeadFFForDnLoad); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* DNLOAD - this command uses the STBL_WRITE function to download a big block of data |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_DNLOAD(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad) |
{ |
if(pt_STBL_DNLOAD) |
return pt_STBL_DNLOAD(Address, pData, Length,bTruncateLeadFFForDnLoad); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* SET PACKET SIZE |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetPaketSize(BYTE size) |
{ |
if(pt_SetPaketSize) |
return pt_SetPaketSize(size); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GET PACKET SIZE |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE GetPaketSize(LPBYTE size) |
{ |
if(pt_GetPaketSize) |
return pt_GetPaketSize(size); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetAckValue |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API ACKS GetAckValue() |
{ |
if(pt_GetAckValue) |
return pt_GetAckValue(); |
else |
return UNDEFINED; |
} |
/************************************************************************************/ |
/* IsConnected |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BOOL COM_is_Open() |
{ |
if(pt_COM_is_Open) |
return pt_COM_is_Open(); |
else |
return FALSE; |
} |
/************************************************************************************/ |
/* SetTimeOut |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetTimeOut(DWORD vms) |
{ |
if(pt_SetTimeOut) |
return pt_SetTimeOut(vms); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetFlashSize |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetFlashSize(DWORD Addr, LPWORD val) |
{ |
if(pt_TARGET_GetFlashSize) |
return pt_TARGET_GetFlashSize(Addr, val); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetMemoryAddress |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetMemoryAddress(DWORD Addr, LPBYTE val) |
{ |
if(pt_TARGET_GetMemoryAddress) |
return pt_TARGET_GetMemoryAddress(Addr, val); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetRDPOptionByte |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetRDPOptionByte(LPBYTE RDP) |
{ |
if(pt_TARGET_GetRDPOptionByte) |
return pt_TARGET_GetRDPOptionByte(RDP); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetWRPOptionBytes |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetWRPOptionBytes(LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3) |
{ |
if(pt_TARGET_GetWRPOptionBytes) |
return pt_TARGET_GetWRPOptionBytes(WRP0, WRP1, WRP2, WRP3); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetUserOptionByte |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetUserOptionByte(LPBYTE User) |
{ |
if(pt_TARGET_GetUserOptionByte) |
return pt_TARGET_GetUserOptionByte(User); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GetDataOptionByte |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetDataOptionByte(LPBYTE Data0, LPBYTE Data1) |
{ |
if(pt_TARGET_GetDataOptionByte) |
return pt_TARGET_GetDataOptionByte(Data0, Data1); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* SetSIFData |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_SetSIFData(BYTE User, BYTE RDP, BYTE Data0, BYTE Data1, |
BYTE WRP0, BYTE WRP1, BYTE WRP2, BYTE WRP3) |
{ |
if(pt_TARGET_SetSIFData) |
return pt_TARGET_SetSIFData(User, RDP, Data0, Data1, WRP0, WRP1, WRP2, WRP3); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* SetSIFData |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetSIFData(LPBYTE User, LPBYTE RDP, LPBYTE Data0, LPBYTE Data1, |
LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3) |
{ |
if(pt_TARGET_GetSIFData) |
return pt_TARGET_GetSIFData(User, RDP, Data0, Data1, WRP0, WRP1, WRP2, WRP3); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* GET PROGRESS STATE |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE GetProgress(LPBYTE progress) |
{ |
if(pt_GetProgress) |
return pt_GetProgress(progress); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Get activity time |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE GetActivityTime(LPDWORD time) |
{ |
if(pt_GetActivityTime) |
return pt_GetActivityTime(time); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Set activity time |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetActivityTime(DWORD time) |
{ |
if(pt_SetActivityTime) |
return pt_SetActivityTime(time); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Set Rts Line State |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetRts(BOOL Val) |
{ |
if(pt_STBL_SetRts) |
return pt_STBL_SetRts(Val); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Set Dtr Line State |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetDtr(BOOL Val) |
{ |
if(pt_Send_RQ) |
return pt_STBL_SetDtr(Val); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Set the state of TXD. Return: true if success. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_setTxd(BOOL val) |
{ |
if(pt_STBL_setTxd) |
return pt_STBL_setTxd(val); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Return: The state of CTS. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getCts(BOOL* pval) |
{ |
if(pt_STBL_getCts) |
return pt_STBL_getCts(pval); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Return: The state of DTR. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getDtr(BOOL* pval) |
{ |
if(pt_STBL_getDtr) |
return pt_STBL_getDtr(pval); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Return: The state of RI. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getRi(BOOL* pval) |
{ |
if(pt_STBL_getRi) |
return pt_STBL_getRi(pval); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Return: The state of DTR. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getCd(BOOL* pval) |
{ |
if(pt_STBL_getCd) |
return pt_STBL_getCd(pval); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* Set Echo back Mode |
/* 0 = Echo Disabled |
/* 1 = Echo Back Enabled |
/* 2 = Listen Echo Enabled |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetEcho(int val) |
{ |
if(pt_STBL_SetEcho) |
return pt_STBL_SetEcho(val); |
else |
return LIB_LOADING_ERROR; |
} |
/************************************************************************************/ |
/* SetFlowControl : Enable/Disable Flow Control of DTR and RTS |
/* FALSE = Disabled |
/* TRUE = Enabled |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetFlowControl(bool val) |
{ |
if(pt_STBL_SetFlowControl) |
return pt_STBL_SetFlowControl(val); |
else |
return LIB_LOADING_ERROR; |
} |
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE******/ |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.dsp |
---|
0,0 → 1,129 |
# Microsoft Developer Studio Project File - Name="STBLLIB" - Package Owner=<4> |
# Microsoft Developer Studio Generated Build File, Format Version 6.00 |
# ** DO NOT EDIT ** |
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 |
CFG=STBLLIB - Win32 Debug |
!MESSAGE This is not a valid makefile. To build this project using NMAKE, |
!MESSAGE use the Export Makefile command and run |
!MESSAGE |
!MESSAGE NMAKE /f "STBLLIB.mak". |
!MESSAGE |
!MESSAGE You can specify a configuration when running NMAKE |
!MESSAGE by defining the macro CFG on the command line. For example: |
!MESSAGE |
!MESSAGE NMAKE /f "STBLLIB.mak" CFG="STBLLIB - Win32 Debug" |
!MESSAGE |
!MESSAGE Possible choices for configuration are: |
!MESSAGE |
!MESSAGE "STBLLIB - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") |
!MESSAGE "STBLLIB - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") |
!MESSAGE |
# Begin Project |
# PROP AllowPerConfigDependencies 0 |
# PROP Scc_ProjName ""$/PC/ST Generic Boot Loader/SOFTWARE/STxx BL Lib/Lib Tester", ESSAAAAA" |
# PROP Scc_LocalPath "..\stblgui" |
CPP=cl.exe |
MTL=midl.exe |
RSC=rc.exe |
!IF "$(CFG)" == "STBLLIB - Win32 Release" |
# PROP BASE Use_MFC 0 |
# PROP BASE Use_Debug_Libraries 0 |
# PROP BASE Output_Dir "Release" |
# PROP BASE Intermediate_Dir "Release" |
# PROP BASE Target_Dir "" |
# PROP Use_MFC 1 |
# PROP Use_Debug_Libraries 0 |
# PROP Output_Dir "Release" |
# PROP Intermediate_Dir "Release" |
# PROP Ignore_Export_Lib 0 |
# PROP Target_Dir "" |
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STBLLIB_EXPORTS" /Yu"stdafx.h" /FD /c |
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STBLLIB_EXPORTS" /D "_VS6_USED" /D "_WINDLL" /FD /c |
# SUBTRACT CPP /YX /Yc /Yu |
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
# ADD BASE RSC /l 0x409 /d "NDEBUG" |
# ADD RSC /l 0x409 /d "NDEBUG" |
BSC32=bscmake.exe |
# ADD BASE BSC32 /nologo |
# ADD BSC32 /nologo |
LINK32=link.exe |
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 |
# ADD LINK32 /nologo /dll /machine:I386 /out:"..\BIN\Release\STBLLIB.dll" |
!ELSEIF "$(CFG)" == "STBLLIB - Win32 Debug" |
# PROP BASE Use_MFC 0 |
# PROP BASE Use_Debug_Libraries 1 |
# PROP BASE Output_Dir "Debug" |
# PROP BASE Intermediate_Dir "Debug" |
# PROP BASE Target_Dir "" |
# PROP Use_MFC 1 |
# PROP Use_Debug_Libraries 1 |
# PROP Output_Dir "Debug" |
# PROP Intermediate_Dir "Debug" |
# PROP Ignore_Export_Lib 0 |
# PROP Target_Dir "" |
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STBLLIB_EXPORTS" /Yu"stdafx.h" /FD /GZ /c |
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "STBLLIB_EXPORTS" /D "_WINDLL" /D "_VS6_USED" /FR /FD /GZ /c |
# SUBTRACT CPP /YX /Yc /Yu |
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 |
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 |
# ADD BASE RSC /l 0x409 /d "_DEBUG" |
# ADD RSC /l 0x409 /d "_DEBUG" |
BSC32=bscmake.exe |
# ADD BASE BSC32 /nologo |
# ADD BSC32 /nologo |
LINK32=link.exe |
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept |
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"..\BIN\Debug\STBLLIB.dll" /pdbtype:sept |
!ENDIF |
# Begin Target |
# Name "STBLLIB - Win32 Release" |
# Name "STBLLIB - Win32 Debug" |
# Begin Group "Source Files" |
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
# Begin Source File |
SOURCE=..\Crs232\rs232.cpp |
# End Source File |
# Begin Source File |
SOURCE=.\STBLLIB.cpp |
# End Source File |
# Begin Source File |
SOURCE=.\STBLLIB.rc |
# End Source File |
# End Group |
# Begin Group "Header Files" |
# PROP Default_Filter "h;hpp;hxx;hm;inl" |
# Begin Source File |
SOURCE=..\Crs232\rs232.h |
# End Source File |
# Begin Source File |
SOURCE=.\STBLLIB.h |
# End Source File |
# Begin Source File |
SOURCE=.\StdAfx.h |
# End Source File |
# End Group |
# Begin Group "Resource Files" |
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" |
# End Group |
# End Target |
# End Project |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.h |
---|
0,0 → 1,486 |
/******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** |
* File Name : STBLLIB.h |
* Author : MCD Application Team |
* Version : v2.2.0 |
* Date : 05/03/2010 |
* Description : Defines the system memory boot loader protocol interface |
******************************************************************************** |
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
*******************************************************************************/ |
#ifndef STDLIB_H |
#define STDLIB_H |
#include "StdAfx.h" |
#include "../CRs232/rs232.h" |
#ifdef STBLLIB_EXPORTS |
#define STBLLIB_API __declspec(dllexport) |
#else |
#define STBLLIB_API __declspec(dllimport) |
#endif |
const BYTE INIT_CON = 0x7F; |
const BYTE GET_CMD = 0x00; //Get the version and the allowed commands supported by the current version of the boot loader |
const BYTE GET_VER_ROPS_CMD = 0x01; //Get the BL version and the Read Protection status of the NVM |
const BYTE GET_ID_CMD = 0x02; //Get the chip ID |
const BYTE SET_SPEED_CMD = 0x03; //set the new baudrate |
const BYTE READ_CMD = 0x11; //Read up to 256 bytes of memory starting from an address specified by the user |
const BYTE GO_CMD = 0x21; //Jump to an address specified by the user to execute (a loaded) code |
const BYTE WRITE_CMD = 0x31; //Write maximum 256 bytes to the RAM or the NVM starting from an address specified by the user |
const BYTE ERASE_CMD = 0x43; //Erase from one to all the NVM sectors |
const BYTE ERASE_EXT_CMD = 0x44; //Erase from one to all the NVM sectors |
const BYTE WRITE_PROTECT_CMD = 0x63; //Enable the write protection in a permanent way for some sectors |
const BYTE WRITE_TEMP_UNPROTECT_CMD = 0x71; //Disable the write protection in a temporary way for all NVM sectors |
const BYTE WRITE_PERM_UNPROTECT_CMD = 0x73; //Disable the write protection in a permanent way for all NVM sectors |
const BYTE READOUT_PROTECT_CMD = 0x82; //Enable the readout protection in a permanent way |
const BYTE READOUT_TEMP_UNPROTECT_CMD = 0x91; //Disable the readout protection in a temporary way |
const BYTE READOUT_PERM_UNPROTECT_CMD = 0x92; //Disable the readout protection in a permanent way |
const BYTE SUCCESS = 0x00; // No error |
const BYTE ERROR_OFFSET = 0x00; //error offset |
const BYTE COM_ERROR_OFFSET = ERROR_OFFSET + 0x00; |
const BYTE NO_CON_AVAILABLE = COM_ERROR_OFFSET + 0x01; // No serial port opened |
const BYTE COM_ALREADY_OPENED = COM_ERROR_OFFSET + 0x02; // Serial port already opened |
const BYTE CANT_OPEN_COM = COM_ERROR_OFFSET + 0x03; // Fail to open serial port |
const BYTE SEND_FAIL = COM_ERROR_OFFSET + 0x04; // send over serial port fail |
const BYTE READ_FAIL = COM_ERROR_OFFSET + 0x05; // Read from serial port fail |
const BYTE SYS_MEM_ERROR_OFFSET = ERROR_OFFSET + 0x10; |
const BYTE CANT_INIT_BL = SYS_MEM_ERROR_OFFSET + 0x01; // Fail to start system memory BL |
const BYTE UNREOGNIZED_DEVICE = SYS_MEM_ERROR_OFFSET + 0x02; // Unreconized device |
const BYTE CMD_NOT_ALLOWED = SYS_MEM_ERROR_OFFSET + 0x03; // Command not allowed |
const BYTE CMD_FAIL = SYS_MEM_ERROR_OFFSET + 0x04; // command failed |
const BYTE PROGRAM_ERROR_OFFSET = ERROR_OFFSET + 0x20; |
const BYTE INPUT_PARAMS_ERROR = PROGRAM_ERROR_OFFSET + 0x01; |
const BYTE INPUT_PARAMS_MEMORY_ALLOCATION_ERROR = PROGRAM_ERROR_OFFSET + 0x02; |
const BYTE LIB_LOADING_ERROR = PROGRAM_ERROR_OFFSET + 0x03; |
enum ACKS {UNDEFINED=0x00, ST75=0x75, ST79=0x79}; |
enum INTERFACE_TYPE {UART, CAN}; |
enum EBaudRate { brCustom,br110, br300, br600, br1200, br2400, br4800, br9600, br14400, br19200, br38400, |
br56000, br57600, br115200, br128000, br256000 };// Port Numbers ( custom or COM1..COM16 } |
enum EPortNumber { pnCustom,pnCOM1, pnCOM2, pnCOM3, pnCOM4, pnCOM5, pnCOM6, pnCOM7,pnCOM8, pnCOM9, pnCOM10, |
pnCOM11, pnCOM12, pnCOM13,pnCOM14, pnCOM15, pnCOM16 };// Data bits ( 5, 6, 7, 8 } |
enum EDataBits { db5BITS, db6BITS, db7BITS, db8BITS }; |
// Stop bits ( 1, 1.5, 2 } |
enum EStopBits { sb1BITS, sb1HALFBITS, sb2BITS }; |
// Parity ( None, odd, even, mark, space } |
enum EParity { ptNONE, ptODD, ptEVEN, ptMARK, ptSPACE }; |
// Hardware Flow Control ( None, None + RTS always on, RTS/CTS } |
enum EHwFlowControl { hfNONE, hfNONERTSON, hfRTSCTS }; |
// Software Flow Control ( None, XON/XOFF } |
enum ESwFlowControl { sfNONE, sfXONXOFF }; |
// What to do with incomplete (incoming} packets ( Discard, Pass } |
enum EPacketMode { pmDiscard, pmPass }; |
enum OPERATION {NONE, ERASE, UPLOAD, DNLOAD, DIS_R_PROT, DIS_W_PROT, ENA_R_PROT, ENA_W_PROT}; |
typedef struct RESULT |
{ |
OPERATION operation; |
char* filename; |
HANDLE Image; |
}* LPRESULT; |
typedef struct Commands |
{ |
BOOL GET_CMD ; //Get the version and the allowed commands supported by the current version of the boot loader |
BOOL GET_VER_ROPS_CMD ; //Get the BL version and the Read Protection status of the NVM |
BOOL GET_ID_CMD ; //Get the chip ID |
BOOL SET_SPEED_CMD ; //Change the CAN baudrate |
BOOL READ_CMD ; //Read up to 256 bytes of memory starting from an address specified by the user |
BOOL GO_CMD ; //Jump to an address specified by the user to execute (a loaded) code |
BOOL WRITE_CMD ; //Write maximum 256 bytes to the RAM or the NVM starting from an address specified by the user |
BOOL ERASE_CMD ; //Erase from one to all the NVM sectors |
BOOL ERASE_EXT_CMD ; //Erase from one to all the NVM sectors |
BOOL WRITE_PROTECT_CMD ; //Enable the write protection in a permanent way for some sectors |
BOOL WRITE_TEMP_UNPROTECT_CMD ; //Disable the write protection in a temporary way for all NVM sectors |
BOOL WRITE_PERM_UNPROTECT_CMD ; //Disable the write protection in a permanent way for all NVM sectors |
BOOL READOUT_PROTECT_CMD ; //Enable the readout protection in a permanent way |
BOOL READOUT_TEMP_UNPROTECT_CMD ; //Disable the readout protection in a temporary way |
BOOL READOUT_PERM_UNPROTECT_CMD ; //Disable the readout protection in a permanent way |
}* LPCommands; |
typedef struct TARGET_DESCRIPTOR |
{ |
BYTE Version ; |
BYTE CmdCount ; |
BYTE PIDLen ; |
BYTE* PID ; |
BYTE ROPE ; |
BYTE ROPD ; |
BOOL GET_CMD ; //Get the version and the allowed commands supported by the current version of the boot loader |
BOOL GET_VER_ROPS_CMD ; //Get the BL version and the Read Protection status of the NVM |
BOOL GET_ID_CMD ; //Get the chip ID |
BOOL SET_SPEED_CMD ; |
BOOL READ_CMD ; //Read up to 256 bytes of memory starting from an address specified by the user |
BOOL GO_CMD ; //Jump to an address specified by the user to execute (a loaded) code |
BOOL WRITE_CMD ; //Write maximum 256 bytes to the RAM or the NVM starting from an address specified by the user |
BOOL ERASE_CMD ; //Erase from one to all the NVM sectors |
BOOL ERASE_EXT_CMD ; //Erase from one to all the NVM sectors |
BOOL WRITE_PROTECT_CMD ; //Enable the write protection in a permanent way for some sectors |
BOOL WRITE_TEMP_UNPROTECT_CMD ; //Disable the write protection in a temporary way for all NVM sectors |
BOOL WRITE_PERM_UNPROTECT_CMD ; //Disable the write protection in a permanent way for all NVM sectors |
BOOL READOUT_PERM_PROTECT_CMD ; //Enable the readout protection in a permanent way |
BOOL READOUT_TEMP_UNPROTECT_CMD ; //Disable the readout protection in a temporary way |
BOOL READOUT_PERM_UNPROTECT_CMD ; //Disable the readout protection in a permanent way |
}* LPTARGET_DESCRIPTOR; |
typedef struct STBL_Request |
{ |
BYTE _cmd; |
DWORD _address; |
WORD _length; |
BYTE _nbSectors; |
LPTARGET_DESCRIPTOR _target; |
LPBYTE _data; |
WORD _wbSectors; |
}* LPSTBL_Request; |
extern "C" |
{ |
/************************************************************************************/ |
/* GET PROGRESS STATE |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE GetProgress(LPBYTE progress); |
/************************************************************************************/ |
/* GET ACTIVITY TIME |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE GetActivityTime(LPDWORD time); |
/************************************************************************************/ |
/* SET ACTIVITY TIME |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetActivityTime(DWORD time); |
/************************************************************************************/ |
/* SET COMMUNICATION INTERFACE TYPE |
/* UART - CAN - ... |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_SetComIntType(BYTE com_int_type); |
/************************************************************************************/ |
/* GetFlashSize |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetFlashSize(DWORD Addr, LPWORD val); |
/************************************************************************************/ |
/* GetMemoryAddress |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetMemoryAddress(DWORD Addr, LPBYTE val); |
/************************************************************************************/ |
/* GetRDPOptionByte |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetRDPOptionByte(LPBYTE RDP); |
/************************************************************************************/ |
/* GetWRPOptionBytes |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetWRPOptionBytes(LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3); |
/************************************************************************************/ |
/* Basic function to send a request |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE Send_RQ(LPSTBL_Request pRQ); |
/************************************************************************************/ |
/* |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetCOMSettings(int numPort, long speedInBaud, int nbBit, |
int parity, float nbStopBit); |
/************************************************************************************/ |
/* |
/* |
/* |
/************************************************************************************/ |
/*STBLLIB_API BYTE ESetCOMSettings(EPortNumber numPort, EBaudRate speedInBaud, EDataBits nbBit, |
EParity parity, EStopBits nbStopBit);*/ |
/************************************************************************************/ |
/* |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE COM_Open(); |
/************************************************************************************/ |
/* |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE COM_Close(); |
/************************************************************************************/ |
/* |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetSpeed(DWORD speed); |
/************************************************************************************/ |
/* |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_Init_BL(); |
/************************************************************************************/ |
/* 0x00; //Get the version and the allowed commands supported by the current version of the boot loader |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_GET(LPBYTE Version, LPCommands pCmds); |
/************************************************************************************/ |
/* 0x01; //Get the BL version and the Read Protection status of the NVM |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_GET_VER_ROPS(LPBYTE Version, LPBYTE ROPEnabled, LPBYTE ROPDisabled); |
/************************************************************************************/ |
/* 0x02; //Get the chip ID |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_GET_ID(LPBYTE size, LPBYTE pID); |
/************************************************************************************/ |
/* 0x11; //Read up to 256 bytes of memory starting from an address specified by the user |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_READ(DWORD Address, BYTE Size, LPBYTE pData); |
/************************************************************************************/ |
/* 0x21; //Jump to an address specified by the user to execute (a loaded) code |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_GO(DWORD Address); |
/************************************************************************************/ |
/* 0x31; //Write maximum 256 bytes to the RAM or the NVM starting from an address specified by the user |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_WRITE(DWORD address, BYTE size, LPBYTE pData); |
/************************************************************************************/ |
/* 0x43; //Erase from one to all the NVM sectors |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_ERASE(WORD NbSectors, LPBYTE pSectors); |
/************************************************************************************/ |
/* 0x63; //Enable the write protection in a permanent way for some sectors |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_WRITE_PROTECT(BYTE NbSectors, LPBYTE pSectors); |
/************************************************************************************/ |
/* 0x71; //Disable the write protection in a temporary way for all NVM sectors |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_WRITE_TEMP_UNPROTECT(); |
/************************************************************************************/ |
/* 0x73; //Disable the write protection in a permanent way for all NVM sectors |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_WRITE_PERM_UNPROTECT(); |
/************************************************************************************/ |
/* 0x82; //Enable the readout protection in a permanent way |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_READOUT_PROTECT(); |
/************************************************************************************/ |
/* 0x91; //Disable the readout protection in a temporary way |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_READOUT_TEMP_UNPROTECT(); |
/************************************************************************************/ |
/* 0x92; //Disable the readout protection in a permanent way |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_READOUT_PERM_UNPROTECT(); |
/************************************************************************************/ |
/* UPLOAD |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_UPLOAD(DWORD Address, LPBYTE pData, DWORD Length); |
/************************************************************************************/ |
/* VERIFY |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_VERIFY(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad); |
/************************************************************************************/ |
/* DNLOAD |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_DNLOAD(DWORD Address, LPBYTE pData, DWORD Length,BOOL bTruncateLeadFFForDnLoad); |
/************************************************************************************/ |
/* SET PACKET SIZE |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetPaketSize(BYTE WORD); |
/************************************************************************************/ |
/* GET PACKET SIZE |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE GetPaketSize(LPBYTE size); |
/************************************************************************************/ |
/* GetAckValue |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API ACKS GetAckValue(); |
/************************************************************************************/ |
/* IsConnected |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BOOL COM_is_Open(); |
/************************************************************************************/ |
/* SetTimeOut |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE SetTimeOut(DWORD vms); |
/************************************************************************************/ |
/* GetUserOptionByte |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetUserOptionByte(LPBYTE User); |
/************************************************************************************/ |
/* GetDataOptionByte |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetDataOptionByte(LPBYTE Data0, LPBYTE Data1); |
/************************************************************************************/ |
/* SetSIFData |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_SetSIFData(BYTE User, BYTE RDP, BYTE Data0, BYTE Data1, |
BYTE WRP0, BYTE WRP1, BYTE WRP2, BYTE WRP3); |
/************************************************************************************/ |
/* GetSIFData |
/* |
/* |
/************************************************************************************/ |
STBLLIB_API BYTE TARGET_GetSIFData(LPBYTE User, LPBYTE RDP, LPBYTE Data0, LPBYTE Data1, |
LPBYTE WRP0, LPBYTE WRP1, LPBYTE WRP2, LPBYTE WRP3); |
/************************************************************************************/ |
/* Set Rts Line State |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetRts(BOOL Val); |
/************************************************************************************/ |
/* Set Dtr Line State |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetDtr(BOOL Val); |
/************************************************************************************/ |
/* Set the state of TXD. Return: true if success. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_setTxd(BOOL val); |
/************************************************************************************/ |
/* Return: The state of CTS. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getCts(BOOL* pval); |
/************************************************************************************/ |
/* Return: The state of DTR. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getDtr(BOOL* pval); |
/************************************************************************************/ |
/* Return: The state of RI. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getRi(BOOL* pval); |
/************************************************************************************/ |
/* Return: The state of DTR. |
/* High = TRUE |
/* Low = FALSE |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_getCd(BOOL* pval); |
/************************************************************************************/ |
/* Set Echo back Mode |
/* 0 = Echo Disabled |
/* 1 = Echo Back Enabled |
/* 2 = Listen Echo Enabled |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetEcho(int val); |
/************************************************************************************/ |
/* SetFlowControl : Enable/Disable Flow Control of DTR and RTS |
/* FALSE = Disabled |
/* TRUE = Enabled |
/************************************************************************************/ |
STBLLIB_API BYTE STBL_SetFlowControl(bool val); |
} |
#endif |
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE******/ |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.rc |
---|
0,0 → 1,109 |
//Microsoft Developer Studio generated resource script. |
// |
#include "resource.h" |
#define APSTUDIO_READONLY_SYMBOLS |
///////////////////////////////////////////////////////////////////////////// |
// |
// Generated from the TEXTINCLUDE 2 resource. |
// |
#include "afxres.h" |
///////////////////////////////////////////////////////////////////////////// |
#undef APSTUDIO_READONLY_SYMBOLS |
///////////////////////////////////////////////////////////////////////////// |
// English (U.S.) resources |
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
#ifdef _WIN32 |
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US |
#pragma code_page(1252) |
#endif //_WIN32 |
#ifndef _MAC |
///////////////////////////////////////////////////////////////////////////// |
// |
// Version |
// |
VS_VERSION_INFO VERSIONINFO |
FILEVERSION 2,2,0,0 |
PRODUCTVERSION 2,2,0,0 |
FILEFLAGSMASK 0x3fL |
#ifdef _DEBUG |
FILEFLAGS 0x1L |
#else |
FILEFLAGS 0x0L |
#endif |
FILEOS 0x40004L |
FILETYPE 0x2L |
FILESUBTYPE 0x0L |
BEGIN |
BLOCK "StringFileInfo" |
BEGIN |
BLOCK "040904b0" |
BEGIN |
VALUE "Comments", "\0" |
VALUE "CompanyName", "STMicroelectronics\0" |
VALUE "FileDescription", "Flash Loader protocol Virtual APIs\0" |
VALUE "FileVersion", "2, 2, 0, 0\0" |
VALUE "InternalName", "STBLLIB\0" |
VALUE "LegalCopyright", "Copyright © 2010\0" |
VALUE "LegalTrademarks", "\0" |
VALUE "OriginalFilename", "STBLLIB.dll\0" |
VALUE "PrivateBuild", "\0" |
VALUE "ProductName", "STMicroelectronics STBLLIB\0" |
VALUE "ProductVersion", "2, 2, 0, 0\0" |
VALUE "SpecialBuild", "\0" |
END |
END |
BLOCK "VarFileInfo" |
BEGIN |
VALUE "Translation", 0x409, 1200 |
END |
END |
#endif // !_MAC |
#ifdef APSTUDIO_INVOKED |
///////////////////////////////////////////////////////////////////////////// |
// |
// TEXTINCLUDE |
// |
1 TEXTINCLUDE DISCARDABLE |
BEGIN |
"resource.h\0" |
END |
2 TEXTINCLUDE DISCARDABLE |
BEGIN |
"#include ""afxres.h""\r\n" |
"\0" |
END |
3 TEXTINCLUDE DISCARDABLE |
BEGIN |
"\r\n" |
"\0" |
END |
#endif // APSTUDIO_INVOKED |
#endif // English (U.S.) resources |
///////////////////////////////////////////////////////////////////////////// |
#ifndef APSTUDIO_INVOKED |
///////////////////////////////////////////////////////////////////////////// |
// |
// Generated from the TEXTINCLUDE 3 resource. |
// |
///////////////////////////////////////////////////////////////////////////// |
#endif // not APSTUDIO_INVOKED |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.vcproj |
---|
0,0 → 1,284 |
<?xml version="1.0" encoding="Windows-1252"?> |
<VisualStudioProject |
ProjectType="Visual C++" |
Version="8.00" |
Name="STBLLIB" |
ProjectGUID="{F9F56A1E-4355-4CC9-92E9-5815BDC57534}" |
RootNamespace="STBLLIB" |
Keyword="MFCProj" |
> |
<Platforms> |
<Platform |
Name="Win32" |
/> |
</Platforms> |
<ToolFiles> |
</ToolFiles> |
<Configurations> |
<Configuration |
Name="Release|Win32" |
OutputDirectory=".\Release" |
IntermediateDirectory=".\Release" |
ConfigurationType="2" |
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" |
UseOfMFC="0" |
ATLMinimizesCRunTimeLibraryUsage="false" |
CharacterSet="2" |
> |
<Tool |
Name="VCPreBuildEventTool" |
/> |
<Tool |
Name="VCCustomBuildTool" |
/> |
<Tool |
Name="VCXMLDataGeneratorTool" |
/> |
<Tool |
Name="VCWebServiceProxyGeneratorTool" |
/> |
<Tool |
Name="VCMIDLTool" |
PreprocessorDefinitions="NDEBUG" |
MkTypLibCompatible="true" |
SuppressStartupBanner="true" |
TargetEnvironment="1" |
TypeLibraryName=".\Release/STBLLIB.tlb" |
HeaderFileName="" |
/> |
<Tool |
Name="VCCLCompilerTool" |
Optimization="2" |
InlineFunctionExpansion="1" |
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;STBLLIB_EXPORTS" |
StringPooling="true" |
RuntimeLibrary="0" |
EnableFunctionLevelLinking="true" |
PrecompiledHeaderFile=".\Release/STBLLIB.pch" |
AssemblerListingLocation=".\Release/" |
ObjectFile=".\Release/" |
ProgramDataBaseFileName=".\Release/" |
WarningLevel="3" |
SuppressStartupBanner="true" |
/> |
<Tool |
Name="VCManagedResourceCompilerTool" |
/> |
<Tool |
Name="VCResourceCompilerTool" |
PreprocessorDefinitions="NDEBUG" |
Culture="1033" |
/> |
<Tool |
Name="VCPreLinkEventTool" |
/> |
<Tool |
Name="VCLinkerTool" |
OutputFile="..\BIN\Release\STBLLIB.dll" |
LinkIncremental="1" |
SuppressStartupBanner="true" |
ProgramDatabaseFile=".\Release/STBLLIB.pdb" |
ImportLibrary=".\Release/STBLLIB.lib" |
TargetMachine="1" |
/> |
<Tool |
Name="VCALinkTool" |
/> |
<Tool |
Name="VCManifestTool" |
/> |
<Tool |
Name="VCXDCMakeTool" |
/> |
<Tool |
Name="VCBscMakeTool" |
SuppressStartupBanner="true" |
OutputFile=".\Release/STBLLIB.bsc" |
/> |
<Tool |
Name="VCFxCopTool" |
/> |
<Tool |
Name="VCAppVerifierTool" |
/> |
<Tool |
Name="VCWebDeploymentTool" |
/> |
<Tool |
Name="VCPostBuildEventTool" |
/> |
</Configuration> |
<Configuration |
Name="Debug|Win32" |
OutputDirectory=".\Debug" |
IntermediateDirectory=".\Debug" |
ConfigurationType="2" |
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" |
UseOfMFC="1" |
ATLMinimizesCRunTimeLibraryUsage="false" |
CharacterSet="2" |
> |
<Tool |
Name="VCPreBuildEventTool" |
/> |
<Tool |
Name="VCCustomBuildTool" |
/> |
<Tool |
Name="VCXMLDataGeneratorTool" |
/> |
<Tool |
Name="VCWebServiceProxyGeneratorTool" |
/> |
<Tool |
Name="VCMIDLTool" |
PreprocessorDefinitions="_DEBUG" |
MkTypLibCompatible="true" |
SuppressStartupBanner="true" |
TargetEnvironment="1" |
TypeLibraryName=".\Debug/STBLLIB.tlb" |
HeaderFileName="" |
/> |
<Tool |
Name="VCCLCompilerTool" |
Optimization="0" |
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STBLLIB_EXPORTS" |
MinimalRebuild="true" |
BasicRuntimeChecks="3" |
RuntimeLibrary="1" |
PrecompiledHeaderFile=".\Debug/STBLLIB.pch" |
AssemblerListingLocation=".\Debug/" |
ObjectFile=".\Debug/" |
ProgramDataBaseFileName=".\Debug/" |
BrowseInformation="1" |
WarningLevel="3" |
SuppressStartupBanner="true" |
DebugInformationFormat="4" |
/> |
<Tool |
Name="VCManagedResourceCompilerTool" |
/> |
<Tool |
Name="VCResourceCompilerTool" |
PreprocessorDefinitions="_DEBUG" |
Culture="1033" |
/> |
<Tool |
Name="VCPreLinkEventTool" |
/> |
<Tool |
Name="VCLinkerTool" |
OutputFile="..\BIN\Debug\STBLLIB.dll" |
LinkIncremental="2" |
SuppressStartupBanner="true" |
GenerateDebugInformation="true" |
ProgramDatabaseFile=".\Debug/STBLLIB.pdb" |
ImportLibrary=".\Debug/STBLLIB.lib" |
TargetMachine="1" |
/> |
<Tool |
Name="VCALinkTool" |
/> |
<Tool |
Name="VCManifestTool" |
/> |
<Tool |
Name="VCXDCMakeTool" |
/> |
<Tool |
Name="VCBscMakeTool" |
SuppressStartupBanner="true" |
OutputFile=".\Debug/STBLLIB.bsc" |
/> |
<Tool |
Name="VCFxCopTool" |
/> |
<Tool |
Name="VCAppVerifierTool" |
/> |
<Tool |
Name="VCWebDeploymentTool" |
/> |
<Tool |
Name="VCPostBuildEventTool" |
/> |
</Configuration> |
</Configurations> |
<References> |
</References> |
<Files> |
<Filter |
Name="Source Files" |
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
> |
<File |
RelativePath="..\Crs232\rs232.cpp" |
> |
<FileConfiguration |
Name="Release|Win32" |
> |
<Tool |
Name="VCCLCompilerTool" |
PreprocessorDefinitions="" |
/> |
</FileConfiguration> |
<FileConfiguration |
Name="Debug|Win32" |
> |
<Tool |
Name="VCCLCompilerTool" |
PreprocessorDefinitions="" |
/> |
</FileConfiguration> |
</File> |
<File |
RelativePath="STBLLIB.cpp" |
> |
<FileConfiguration |
Name="Release|Win32" |
> |
<Tool |
Name="VCCLCompilerTool" |
PreprocessorDefinitions="" |
/> |
</FileConfiguration> |
<FileConfiguration |
Name="Debug|Win32" |
> |
<Tool |
Name="VCCLCompilerTool" |
PreprocessorDefinitions="" |
/> |
</FileConfiguration> |
</File> |
<File |
RelativePath=".\STBLLIB.rc" |
> |
</File> |
</Filter> |
<Filter |
Name="Header Files" |
Filter="h;hpp;hxx;hm;inl" |
> |
<File |
RelativePath="..\Crs232\rs232.h" |
> |
</File> |
<File |
RelativePath="STBLLIB.h" |
> |
</File> |
<File |
RelativePath="StdAfx.h" |
> |
</File> |
</Filter> |
<Filter |
Name="Resource Files" |
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" |
> |
</Filter> |
</Files> |
<Globals> |
</Globals> |
</VisualStudioProject> |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.vcxproj |
---|
0,0 → 1,152 |
<?xml version="1.0" encoding="utf-8"?> |
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<ItemGroup Label="ProjectConfigurations"> |
<ProjectConfiguration Include="Debug|Win32"> |
<Configuration>Debug</Configuration> |
<Platform>Win32</Platform> |
</ProjectConfiguration> |
<ProjectConfiguration Include="Release|Win32"> |
<Configuration>Release</Configuration> |
<Platform>Win32</Platform> |
</ProjectConfiguration> |
</ItemGroup> |
<PropertyGroup Label="Globals"> |
<SccProjectName> |
</SccProjectName> |
<SccLocalPath> |
</SccLocalPath> |
<Keyword>MFCProj</Keyword> |
</PropertyGroup> |
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
<ConfigurationType>DynamicLibrary</ConfigurationType> |
<UseOfMfc>Static</UseOfMfc> |
<CharacterSet>MultiByte</CharacterSet> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
<ConfigurationType>DynamicLibrary</ConfigurationType> |
<UseOfMfc>Static</UseOfMfc> |
<CharacterSet>MultiByte</CharacterSet> |
</PropertyGroup> |
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
<ImportGroup Label="ExtensionSettings"> |
</ImportGroup> |
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" /> |
</ImportGroup> |
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" /> |
</ImportGroup> |
<PropertyGroup Label="UserMacros" /> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
<OutDir>.\Release\</OutDir> |
<IntDir>.\Release\</IntDir> |
<LinkIncremental>false</LinkIncremental> |
</PropertyGroup> |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
<OutDir>.\Debug\</OutDir> |
<IntDir>.\Debug\</IntDir> |
<LinkIncremental>true</LinkIncremental> |
</PropertyGroup> |
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
<ClCompile> |
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> |
<StringPooling>true</StringPooling> |
<FunctionLevelLinking>true</FunctionLevelLinking> |
<Optimization>MaxSpeed</Optimization> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<WarningLevel>Level3</WarningLevel> |
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;STBLLIB_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
<AssemblerListingLocation>.\Release\</AssemblerListingLocation> |
<PrecompiledHeaderOutputFile>.\Release\STBLLIB.pch</PrecompiledHeaderOutputFile> |
<PrecompiledHeader> |
</PrecompiledHeader> |
<ObjectFileName>.\Release\</ObjectFileName> |
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName> |
</ClCompile> |
<Midl> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
<TypeLibraryName>.\Release\STBLLIB.tlb</TypeLibraryName> |
<MkTypLibCompatible>true</MkTypLibCompatible> |
<TargetEnvironment>Win32</TargetEnvironment> |
</Midl> |
<ResourceCompile> |
<Culture>0x0409</Culture> |
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
</ResourceCompile> |
<Bscmake> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<OutputFile>.\Release\STBLLIB.bsc</OutputFile> |
</Bscmake> |
<Link> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<LinkDLL>true</LinkDLL> |
<SubSystem>Console</SubSystem> |
<OutputFile>..\BIN\Release\STBLLIB.dll</OutputFile> |
<ImportLibrary>.\Release\STBLLIB.lib</ImportLibrary> |
</Link> |
</ItemDefinitionGroup> |
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
<ClCompile> |
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
<InlineFunctionExpansion>Default</InlineFunctionExpansion> |
<FunctionLevelLinking>false</FunctionLevelLinking> |
<Optimization>Disabled</Optimization> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<WarningLevel>Level3</WarningLevel> |
<MinimalRebuild>true</MinimalRebuild> |
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;STBLLIB_EXPORTS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation> |
<BrowseInformation>true</BrowseInformation> |
<PrecompiledHeaderOutputFile>.\Debug\STBLLIB.pch</PrecompiledHeaderOutputFile> |
<PrecompiledHeader> |
</PrecompiledHeader> |
<ObjectFileName>.\Debug\</ObjectFileName> |
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName> |
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
</ClCompile> |
<Midl> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
<TypeLibraryName>.\Debug\STBLLIB.tlb</TypeLibraryName> |
<MkTypLibCompatible>true</MkTypLibCompatible> |
<TargetEnvironment>Win32</TargetEnvironment> |
</Midl> |
<ResourceCompile> |
<Culture>0x0409</Culture> |
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
</ResourceCompile> |
<Bscmake> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<OutputFile>.\Debug\STBLLIB.bsc</OutputFile> |
</Bscmake> |
<Link> |
<SuppressStartupBanner>true</SuppressStartupBanner> |
<LinkDLL>true</LinkDLL> |
<GenerateDebugInformation>true</GenerateDebugInformation> |
<SubSystem>Console</SubSystem> |
<OutputFile>..\BIN\Debug\STBLLIB.dll</OutputFile> |
<ImportLibrary>.\Debug\STBLLIB.lib</ImportLibrary> |
</Link> |
</ItemDefinitionGroup> |
<ItemGroup> |
<ClCompile Include="..\Crs232\rs232.cpp" /> |
<ClCompile Include="STBLLIB.cpp" /> |
</ItemGroup> |
<ItemGroup> |
<ResourceCompile Include="STBLLIB.rc" /> |
</ItemGroup> |
<ItemGroup> |
<ClInclude Include="..\Crs232\rs232.h" /> |
<ClInclude Include="STBLLIB.h" /> |
<ClInclude Include="StdAfx.h" /> |
</ItemGroup> |
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
<ImportGroup Label="ExtensionTargets"> |
</ImportGroup> |
</Project> |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.vcxproj.filters |
---|
0,0 → 1,41 |
<?xml version="1.0" encoding="utf-8"?> |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<ItemGroup> |
<Filter Include="Source Files"> |
<UniqueIdentifier>{f02c9ef7-81f7-4a3c-bba5-cbd8a7793ff7}</UniqueIdentifier> |
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions> |
</Filter> |
<Filter Include="Header Files"> |
<UniqueIdentifier>{5fa88289-9f8f-49f7-a8e6-bd8c704b257d}</UniqueIdentifier> |
<Extensions>h;hpp;hxx;hm;inl</Extensions> |
</Filter> |
<Filter Include="Resource Files"> |
<UniqueIdentifier>{2186d3c8-01e7-4b41-9322-45da004618c8}</UniqueIdentifier> |
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions> |
</Filter> |
</ItemGroup> |
<ItemGroup> |
<ClCompile Include="..\Crs232\rs232.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
<ClCompile Include="STBLLIB.cpp"> |
<Filter>Source Files</Filter> |
</ClCompile> |
</ItemGroup> |
<ItemGroup> |
<ResourceCompile Include="STBLLIB.rc"> |
<Filter>Source Files</Filter> |
</ResourceCompile> |
</ItemGroup> |
<ItemGroup> |
<ClInclude Include="..\Crs232\rs232.h"> |
<Filter>Header Files</Filter> |
</ClInclude> |
<ClInclude Include="STBLLIB.h"> |
<Filter>Header Files</Filter> |
</ClInclude> |
<ClInclude Include="StdAfx.h"> |
<Filter>Header Files</Filter> |
</ClInclude> |
</ItemGroup> |
</Project> |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/STBLLIB.vcxproj.user |
---|
0,0 → 1,3 |
<?xml version="1.0" encoding="utf-8"?> |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
</Project> |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/StdAfx.cpp |
---|
0,0 → 1,10 |
// stdafx.cpp : source file that includes just the standard includes |
// STBLLIB.pch will be the pre-compiled header |
// stdafx.obj will contain the pre-compiled type information |
#include "stdafx.h" |
// TODO: reference any additional headers you need in STDAFX.H |
// and not in this file |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/StdAfx.h |
---|
0,0 → 1,23 |
#if !defined(AFX_STDAFX_H__5756AFC7_1A09_4C0E_B6E8_BA86A975A687__INCLUDED_) |
#define AFX_STDAFX_H__5756AFC7_1A09_4C0E_B6E8_BA86A975A687__INCLUDED_ |
#if _MSC_VER > 1000 |
#pragma once |
#endif // _MSC_VER > 1000 |
// Insert your headers here |
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers |
#include <windows.h> |
//#include "../Files/Files.h" |
// TODO: reference additional headers your program requires here |
//{{AFX_INSERT_LOCATION}} |
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. |
#endif // !defined(AFX_STDAFX_H__5756AFC7_1A09_4C0E_B6E8_BA86A975A687__INCLUDED_) |
/Modules/ARM/STM32F10xRxT01A/SW/RS232_bootloader/Src/STBLLIB/resource.h |
---|
0,0 → 1,15 |
//{{NO_DEPENDENCIES}} |
// Microsoft Developer Studio generated include file. |
// Used by STBLLIB.rc |
// |
// Next default values for new objects |
// |
#ifdef APSTUDIO_INVOKED |
#ifndef APSTUDIO_READONLY_SYMBOLS |
#define _APS_NEXT_RESOURCE_VALUE 101 |
#define _APS_NEXT_COMMAND_VALUE 40001 |
#define _APS_NEXT_CONTROL_VALUE 1000 |
#define _APS_NEXT_SYMED_VALUE 101 |
#endif |
#endif |