pub struct CubeProgrammer_API {Show 68 fields
pub getStLinkList: Result<unsafe extern "C" fn(stLinkList: *mut *mut debugConnectParameters, shared: c_int) -> c_int, Error>,
pub getStLinkEnumerationList: Result<unsafe extern "C" fn(stlink_list: *mut *mut debugConnectParameters, shared: c_int) -> c_int, Error>,
pub connectStLink: Result<unsafe extern "C" fn(debugParameters: debugConnectParameters) -> c_int, Error>,
pub reset: Result<unsafe extern "C" fn(rstMode: debugResetMode) -> c_int, Error>,
pub getUsartList: Result<unsafe extern "C" fn(usartList: *mut *mut usartConnectParameters) -> c_int, Error>,
pub connectUsartBootloader: Result<unsafe extern "C" fn(usartParameters: usartConnectParameters) -> c_int, Error>,
pub sendByteUart: Result<unsafe extern "C" fn(byte: c_int) -> c_int, Error>,
pub getDfuDeviceList: Result<unsafe extern "C" fn(dfuList: *mut *mut dfuDeviceInfo, iPID: c_int, iVID: c_int) -> c_int, Error>,
pub connectDfuBootloader: Result<unsafe extern "C" fn(usbIndex: *mut c_char) -> c_int, Error>,
pub connectDfuBootloader2: Result<unsafe extern "C" fn(dfuParameters: dfuConnectParameters) -> c_int, Error>,
pub connectSpiBootloader: Result<unsafe extern "C" fn(spiParameters: spiConnectParameters) -> c_int, Error>,
pub connectCanBootloader: Result<unsafe extern "C" fn(canParameters: canConnectParameters) -> c_int, Error>,
pub connectI2cBootloader: Result<unsafe extern "C" fn(i2cParameters: i2cConnectParameters) -> c_int, Error>,
pub setDisplayCallbacks: Result<unsafe extern "C" fn(c: displayCallBacks), Error>,
pub setVerbosityLevel: Result<unsafe extern "C" fn(level: c_int), Error>,
pub checkDeviceConnection: Result<unsafe extern "C" fn() -> c_int, Error>,
pub getDeviceGeneralInf: Result<unsafe extern "C" fn() -> *mut generalInf, Error>,
pub readMemory: Result<unsafe extern "C" fn(address: c_uint, data: *mut *mut c_uchar, size: c_uint) -> c_int, Error>,
pub writeMemory: Result<unsafe extern "C" fn(address: c_uint, data: *mut c_char, size: c_uint) -> c_int, Error>,
pub editSector: Result<unsafe extern "C" fn(address: c_uint, data: *mut c_char, size: c_uint) -> c_int, Error>,
pub downloadFile: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, binPath: *const u32) -> c_int, Error>,
pub execute: Result<unsafe extern "C" fn(address: c_uint) -> c_int, Error>,
pub massErase: Result<unsafe extern "C" fn(sFlashMemName: *mut c_char) -> c_int, Error>,
pub sectorErase: Result<unsafe extern "C" fn(sectors: *mut c_uint, sectorNbr: c_uint, sFlashMemName: *mut c_char) -> c_int, Error>,
pub readUnprotect: Result<unsafe extern "C" fn() -> c_int, Error>,
pub tzenRegression: Result<unsafe extern "C" fn() -> c_int, Error>,
pub getTargetInterfaceType: Result<unsafe extern "C" fn() -> c_int, Error>,
pub getCancelPointer: Result<unsafe extern "C" fn() -> *mut c_int, Error>,
pub fileOpen: Result<unsafe extern "C" fn(filePath: *const u32) -> *mut c_void, Error>,
pub freeFileData: Result<unsafe extern "C" fn(data: *mut fileData_C), Error>,
pub freeLibraryMemory: Result<unsafe extern "C" fn(ptr: *mut c_void), Error>,
pub verify: Result<unsafe extern "C" fn(fileData: *mut fileData_C, address: c_uint) -> c_int, Error>,
pub saveFileToFile: Result<unsafe extern "C" fn(fileData: *mut fileData_C, sFileName: *const u32) -> c_int, Error>,
pub saveMemoryToFile: Result<unsafe extern "C" fn(address: c_int, size: c_int, sFileName: *const u32) -> c_int, Error>,
pub disconnect: Result<unsafe extern "C" fn(), Error>,
pub deleteInterfaceList: Result<unsafe extern "C" fn(), Error>,
pub automaticMode: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, isMassErase: c_int, obCommand: *mut c_char, run: c_int), Error>,
pub serialNumberingAutomaticMode: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, isMassErase: c_int, obCommand: *mut c_char, run: c_int, enableSerialNumbering: c_int, serialAddress: c_int, serialSize: c_int, serialInitialData: *mut c_char), Error>,
pub getStorageStructure: Result<unsafe extern "C" fn(deviceStorageStruct: *mut *mut storageStructure) -> c_int, Error>,
pub sendOptionBytesCmd: Result<unsafe extern "C" fn(command: *mut c_char) -> c_int, Error>,
pub initOptionBytesInterface: Result<unsafe extern "C" fn() -> *mut peripheral_C, Error>,
pub fastRomInitOptionBytesInterface: Result<unsafe extern "C" fn(deviceId: u16) -> *mut peripheral_C, Error>,
pub obDisplay: Result<unsafe extern "C" fn() -> c_int, Error>,
pub setLoadersPath: Result<unsafe extern "C" fn(path: *const c_char), Error>,
pub setExternalLoaderPath: Result<unsafe extern "C" fn(path: *const c_char, externalLoaderInfo: *mut *mut externalLoader), Error>,
pub setExternalLoaderOBL: Result<unsafe extern "C" fn(path: *const c_char, externalLoaderInfo: *mut *mut externalLoader), Error>,
pub getExternalLoaders: Result<unsafe extern "C" fn(path: *const c_char, externalStorageNfo: *mut *mut externalStorageInfo) -> c_int, Error>,
pub removeExternalLoader: Result<unsafe extern "C" fn(path: *const c_char), Error>,
pub deleteLoaders: Result<unsafe extern "C" fn(), Error>,
pub getUID64: Result<unsafe extern "C" fn(data: *mut *mut c_uchar) -> c_int, Error>,
pub firmwareDelete: Result<unsafe extern "C" fn() -> c_int, Error>,
pub firmwareUpgrade: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, firstInstall: c_uint, startStack: c_uint, verify: c_uint) -> c_int, Error>,
pub startWirelessStack: Result<unsafe extern "C" fn() -> c_int, Error>,
pub updateAuthKey: Result<unsafe extern "C" fn(filePath: *const u32) -> c_int, Error>,
pub authKeyLock: Result<unsafe extern "C" fn() -> c_int, Error>,
pub writeUserKey: Result<unsafe extern "C" fn(filePath: *const u32, keyType: c_uchar) -> c_int, Error>,
pub antiRollBack: Result<unsafe extern "C" fn() -> c_int, Error>,
pub startFus: Result<unsafe extern "C" fn() -> c_int, Error>,
pub unlockchip: Result<unsafe extern "C" fn() -> c_int, Error>,
pub programSsp: Result<unsafe extern "C" fn(sspFile: *const u32, licenseFile: *const u32, tfaFile: *const u32, hsmSlotId: c_int) -> c_int, Error>,
pub getHsmFirmwareID: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>,
pub getHsmCounter: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> c_ulong, Error>,
pub getHsmState: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>,
pub getHsmVersion: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>,
pub getHsmType: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>,
pub getHsmLicense: Result<unsafe extern "C" fn(hsmSlotId: c_int, outLicensePath: *const u32) -> c_int, Error>,
pub writeCortexRegistres: Result<unsafe extern "C" fn(reg: c_uint, data: c_uint) -> c_int, Error>,
pub readCortexReg: Result<unsafe extern "C" fn(reg: c_uint, data: *mut c_uint) -> c_int, Error>,
/* private fields */
}
Fields§
§getStLinkList: Result<unsafe extern "C" fn(stLinkList: *mut *mut debugConnectParameters, shared: c_int) -> c_int, Error>
§getStLinkEnumerationList: Result<unsafe extern "C" fn(stlink_list: *mut *mut debugConnectParameters, shared: c_int) -> c_int, Error>
§connectStLink: Result<unsafe extern "C" fn(debugParameters: debugConnectParameters) -> c_int, Error>
§reset: Result<unsafe extern "C" fn(rstMode: debugResetMode) -> c_int, Error>
§getUsartList: Result<unsafe extern "C" fn(usartList: *mut *mut usartConnectParameters) -> c_int, Error>
§connectUsartBootloader: Result<unsafe extern "C" fn(usartParameters: usartConnectParameters) -> c_int, Error>
§sendByteUart: Result<unsafe extern "C" fn(byte: c_int) -> c_int, Error>
§getDfuDeviceList: Result<unsafe extern "C" fn(dfuList: *mut *mut dfuDeviceInfo, iPID: c_int, iVID: c_int) -> c_int, Error>
§connectDfuBootloader: Result<unsafe extern "C" fn(usbIndex: *mut c_char) -> c_int, Error>
§connectDfuBootloader2: Result<unsafe extern "C" fn(dfuParameters: dfuConnectParameters) -> c_int, Error>
§connectSpiBootloader: Result<unsafe extern "C" fn(spiParameters: spiConnectParameters) -> c_int, Error>
§connectCanBootloader: Result<unsafe extern "C" fn(canParameters: canConnectParameters) -> c_int, Error>
§connectI2cBootloader: Result<unsafe extern "C" fn(i2cParameters: i2cConnectParameters) -> c_int, Error>
§setDisplayCallbacks: Result<unsafe extern "C" fn(c: displayCallBacks), Error>
§setVerbosityLevel: Result<unsafe extern "C" fn(level: c_int), Error>
§checkDeviceConnection: Result<unsafe extern "C" fn() -> c_int, Error>
§getDeviceGeneralInf: Result<unsafe extern "C" fn() -> *mut generalInf, Error>
§readMemory: Result<unsafe extern "C" fn(address: c_uint, data: *mut *mut c_uchar, size: c_uint) -> c_int, Error>
§writeMemory: Result<unsafe extern "C" fn(address: c_uint, data: *mut c_char, size: c_uint) -> c_int, Error>
§editSector: Result<unsafe extern "C" fn(address: c_uint, data: *mut c_char, size: c_uint) -> c_int, Error>
§downloadFile: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, binPath: *const u32) -> c_int, Error>
§execute: Result<unsafe extern "C" fn(address: c_uint) -> c_int, Error>
§massErase: Result<unsafe extern "C" fn(sFlashMemName: *mut c_char) -> c_int, Error>
§sectorErase: Result<unsafe extern "C" fn(sectors: *mut c_uint, sectorNbr: c_uint, sFlashMemName: *mut c_char) -> c_int, Error>
§readUnprotect: Result<unsafe extern "C" fn() -> c_int, Error>
§tzenRegression: Result<unsafe extern "C" fn() -> c_int, Error>
§getTargetInterfaceType: Result<unsafe extern "C" fn() -> c_int, Error>
§getCancelPointer: Result<unsafe extern "C" fn() -> *mut c_int, Error>
§fileOpen: Result<unsafe extern "C" fn(filePath: *const u32) -> *mut c_void, Error>
§freeFileData: Result<unsafe extern "C" fn(data: *mut fileData_C), Error>
§freeLibraryMemory: Result<unsafe extern "C" fn(ptr: *mut c_void), Error>
§verify: Result<unsafe extern "C" fn(fileData: *mut fileData_C, address: c_uint) -> c_int, Error>
§saveFileToFile: Result<unsafe extern "C" fn(fileData: *mut fileData_C, sFileName: *const u32) -> c_int, Error>
§saveMemoryToFile: Result<unsafe extern "C" fn(address: c_int, size: c_int, sFileName: *const u32) -> c_int, Error>
§disconnect: Result<unsafe extern "C" fn(), Error>
§deleteInterfaceList: Result<unsafe extern "C" fn(), Error>
§automaticMode: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, isMassErase: c_int, obCommand: *mut c_char, run: c_int), Error>
§serialNumberingAutomaticMode: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, isMassErase: c_int, obCommand: *mut c_char, run: c_int, enableSerialNumbering: c_int, serialAddress: c_int, serialSize: c_int, serialInitialData: *mut c_char), Error>
§getStorageStructure: Result<unsafe extern "C" fn(deviceStorageStruct: *mut *mut storageStructure) -> c_int, Error>
§sendOptionBytesCmd: Result<unsafe extern "C" fn(command: *mut c_char) -> c_int, Error>
§initOptionBytesInterface: Result<unsafe extern "C" fn() -> *mut peripheral_C, Error>
§fastRomInitOptionBytesInterface: Result<unsafe extern "C" fn(deviceId: u16) -> *mut peripheral_C, Error>
§obDisplay: Result<unsafe extern "C" fn() -> c_int, Error>
§setLoadersPath: Result<unsafe extern "C" fn(path: *const c_char), Error>
§setExternalLoaderPath: Result<unsafe extern "C" fn(path: *const c_char, externalLoaderInfo: *mut *mut externalLoader), Error>
§setExternalLoaderOBL: Result<unsafe extern "C" fn(path: *const c_char, externalLoaderInfo: *mut *mut externalLoader), Error>
§getExternalLoaders: Result<unsafe extern "C" fn(path: *const c_char, externalStorageNfo: *mut *mut externalStorageInfo) -> c_int, Error>
§removeExternalLoader: Result<unsafe extern "C" fn(path: *const c_char), Error>
§deleteLoaders: Result<unsafe extern "C" fn(), Error>
§getUID64: Result<unsafe extern "C" fn(data: *mut *mut c_uchar) -> c_int, Error>
§firmwareDelete: Result<unsafe extern "C" fn() -> c_int, Error>
§firmwareUpgrade: Result<unsafe extern "C" fn(filePath: *const u32, address: c_uint, firstInstall: c_uint, startStack: c_uint, verify: c_uint) -> c_int, Error>
§startWirelessStack: Result<unsafe extern "C" fn() -> c_int, Error>
§updateAuthKey: Result<unsafe extern "C" fn(filePath: *const u32) -> c_int, Error>
§authKeyLock: Result<unsafe extern "C" fn() -> c_int, Error>
§writeUserKey: Result<unsafe extern "C" fn(filePath: *const u32, keyType: c_uchar) -> c_int, Error>
§antiRollBack: Result<unsafe extern "C" fn() -> c_int, Error>
§startFus: Result<unsafe extern "C" fn() -> c_int, Error>
§unlockchip: Result<unsafe extern "C" fn() -> c_int, Error>
§programSsp: Result<unsafe extern "C" fn(sspFile: *const u32, licenseFile: *const u32, tfaFile: *const u32, hsmSlotId: c_int) -> c_int, Error>
§getHsmFirmwareID: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>
§getHsmCounter: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> c_ulong, Error>
§getHsmState: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>
§getHsmVersion: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>
§getHsmType: Result<unsafe extern "C" fn(hsmSlotId: c_int) -> *const c_char, Error>
§getHsmLicense: Result<unsafe extern "C" fn(hsmSlotId: c_int, outLicensePath: *const u32) -> c_int, Error>
§writeCortexRegistres: Result<unsafe extern "C" fn(reg: c_uint, data: c_uint) -> c_int, Error>
§readCortexReg: Result<unsafe extern "C" fn(reg: c_uint, data: *mut c_uint) -> c_int, Error>
Implementations§
Source§impl CubeProgrammer_API
impl CubeProgrammer_API
pub unsafe fn new<P>(path: P) -> Result<Self, Error>
pub unsafe fn from_library<L>(library: L) -> Result<Self, Error>
Sourcepub unsafe fn getStLinkList(
&self,
stLinkList: *mut *mut debugConnectParameters,
shared: c_int,
) -> c_int
pub unsafe fn getStLinkList( &self, stLinkList: *mut *mut debugConnectParameters, shared: c_int, ) -> c_int
\brief This routine allows to get ST-LINK conneted probe(s). \param stLinkList : Filled with the connected ST-LINK list and its default configurations. \param shared : Enable shared mode allowing connection of two or more instances to the same ST-LINK probe. \return Number of the ST-LINK probes already exists. \warning The Share option is useful only with ST-LINK Server. \note At the end of usage, #deleteInterfaceList must have been called.
Sourcepub unsafe fn getStLinkEnumerationList(
&self,
stlink_list: *mut *mut debugConnectParameters,
shared: c_int,
) -> c_int
pub unsafe fn getStLinkEnumerationList( &self, stlink_list: *mut *mut debugConnectParameters, shared: c_int, ) -> c_int
\brief This routine allows to get ST-LINK conneted probe(s) without connecting and intruse the target. \param stLinkList : Filled with the connected ST-LINK list and its default configurations. \param shared : Enable shared mode allowing connection of two or more instances to the same ST-LINK probe. \return Number of the ST-LINK probes already exists. \warning The Share option is useful only with ST-LINK Server. \note At the end of usage, #deleteInterfaceList must have been called.
Sourcepub unsafe fn connectStLink(
&self,
debugParameters: debugConnectParameters,
) -> c_int
pub unsafe fn connectStLink( &self, debugParameters: debugConnectParameters, ) -> c_int
\brief This routine allows to start connection to device through SWD or JTAG interfaces. \param debugParameters : Indicates customized configuration for ST-LINK connection, It is recommended to check debugConnectParameters fields before connection. \return 0 if the connection successfully established, otherwise an error occurred.
Sourcepub unsafe fn reset(&self, rstMode: debugResetMode) -> c_int
pub unsafe fn reset(&self, rstMode: debugResetMode) -> c_int
\brief This routine used to apply a target reset. \note Reset operation is only available with JTAG/SWD debug interface. \param rstMode : Indicates the reset type Soft/Hard/Core #debugResetMode. \n \return 0 if the reset operation finished successfully, otherwise an error occurred.
Sourcepub unsafe fn getUsartList(
&self,
usartList: *mut *mut usartConnectParameters,
) -> c_int
pub unsafe fn getUsartList( &self, usartList: *mut *mut usartConnectParameters, ) -> c_int
\brief This routine allows to get connected serial ports. \param usartList : Receive serial ports list and its default configurations. \return Number of serial ports already connected. \note At the end of usage, #deleteInterfaceList must have been called.
Sourcepub unsafe fn connectUsartBootloader(
&self,
usartParameters: usartConnectParameters,
) -> c_int
pub unsafe fn connectUsartBootloader( &self, usartParameters: usartConnectParameters, ) -> c_int
\brief This routine allows to start connection to device through USART interface. \param usartParameters : Indicates customized configuration for USART connection. \return 0 if the connection successfully established, otherwise an error occurred.
Sourcepub unsafe fn sendByteUart(&self, byte: c_int) -> c_int
pub unsafe fn sendByteUart(&self, byte: c_int) -> c_int
\brief This routine allows to send a single byte through the USART interface. \param byte : The data to be written \return 0 if the sending operation correctly achieved, otherwise an error occurred.
Sourcepub unsafe fn getDfuDeviceList(
&self,
dfuList: *mut *mut dfuDeviceInfo,
iPID: c_int,
iVID: c_int,
) -> c_int
pub unsafe fn getDfuDeviceList( &self, dfuList: *mut *mut dfuDeviceInfo, iPID: c_int, iVID: c_int, ) -> c_int
\brief This routine allows to get connected DFU devices. \param dfuList : Receive DFU devices list and its default configurations. \param iPID : Indicate the Product ID to be used for DFU interface. \param iVID : Indicate the Vendor ID to be used for DFU interface. \return Number of DFU devices already connected. \note At the end of usage, #deleteInterfaceList must have been called.
Sourcepub unsafe fn connectDfuBootloader(&self, usbIndex: *mut c_char) -> c_int
pub unsafe fn connectDfuBootloader(&self, usbIndex: *mut c_char) -> c_int
\brief This routine allows to start a simple connection through USB DFU interface. \param usbIndex : Indicates the index of DFU ports already connected. \return 0 if the connection successfully established, otherwise an error occurred.
Sourcepub unsafe fn connectDfuBootloader2(
&self,
dfuParameters: dfuConnectParameters,
) -> c_int
pub unsafe fn connectDfuBootloader2( &self, dfuParameters: dfuConnectParameters, ) -> c_int
\brief This routine allows to start connection to device through USB DFU interface. \param dfuConnectParameters : Indicates the dfu connection parameters \return 0 if the connection successfully established, otherwise an error occurred. \note It’s recommanded to use this routine to disable readout protection when connecting a MCU based device.
Sourcepub unsafe fn connectSpiBootloader(
&self,
spiParameters: spiConnectParameters,
) -> c_int
pub unsafe fn connectSpiBootloader( &self, spiParameters: spiConnectParameters, ) -> c_int
\brief This routine allows to start connection to device through SPI interface. \param spiParameters : Indicates customized configuration for SPI connection \return 0 if the connection successfully established, otherwise an error occurred.
Sourcepub unsafe fn connectCanBootloader(
&self,
canParameters: canConnectParameters,
) -> c_int
pub unsafe fn connectCanBootloader( &self, canParameters: canConnectParameters, ) -> c_int
\brief This routine allows to start connection to device through CAN interface. \param canParameters : Indicates customized configuration for CAN connection \return 0 if the connection successfully established, otherwise an error occurred. \warning To have CAN full support, you must have St-Link firmware version at least v3JxMxB2.
Sourcepub unsafe fn connectI2cBootloader(
&self,
i2cParameters: i2cConnectParameters,
) -> c_int
pub unsafe fn connectI2cBootloader( &self, i2cParameters: i2cConnectParameters, ) -> c_int
\brief This routine allows to start connection to device through I2C interface. \param i2cParameters : Indicates customized configuration for I2C connection \return 0 if the connection successfully established, otherwise an error occurred.
Sourcepub unsafe fn setDisplayCallbacks(&self, c: displayCallBacks)
pub unsafe fn setDisplayCallbacks(&self, c: displayCallBacks)
\brief This routine allows to choose your custom display. \param c : Fill the struct to customize the display tool. \note This function must be called first of all to ensure the display management.
Sourcepub unsafe fn setVerbosityLevel(&self, level: c_int)
pub unsafe fn setVerbosityLevel(&self, level: c_int)
\brief This routine allows to choose the verbosity level for display. \param level : Indicates the verbosity number 0, 1 or 3.
Sourcepub unsafe fn checkDeviceConnection(&self) -> c_int
pub unsafe fn checkDeviceConnection(&self) -> c_int
\brief This routine allows to check connection status [maintained or lost]. \return 1 if the device is already connected, otherwise the connection to device is lost.
Sourcepub unsafe fn getDeviceGeneralInf(&self) -> *mut generalInf
pub unsafe fn getDeviceGeneralInf(&self) -> *mut generalInf
\brief This routine allows to get general device informations. \return Structure #GeneralInf in which the informations are stored.
Sourcepub unsafe fn readMemory(
&self,
address: c_uint,
data: *mut *mut c_uchar,
size: c_uint,
) -> c_int
pub unsafe fn readMemory( &self, address: c_uint, data: *mut *mut c_uchar, size: c_uint, ) -> c_int
\brief This routine allows to receive memory data on the used interface with the configration already initialized. \param address : The address to start reading from. \param data : Pointer to the data buffer. \param size : It indicates the size for read data. \return 0 if the reading operation correctly finished, otherwise an error occurred. \warning Unlike ST-LINK interface, the Bootloader interface can access only to some specific memory regions.
Sourcepub unsafe fn writeMemory(
&self,
address: c_uint,
data: *mut c_char,
size: c_uint,
) -> c_int
pub unsafe fn writeMemory( &self, address: c_uint, data: *mut c_char, size: c_uint, ) -> c_int
\brief This routine allows to write memory data on the user interface with the configration already initialized. \param address : The address to start writing from. \param data : Pointer to the data buffer. \param size : It indicates the size for write data. \return 0 if the writing operation correctly finished, otherwise an error occurred. \warning Unlike ST-LINK interface, the Bootloader interface can access only to some specific memory regions.
Sourcepub unsafe fn editSector(
&self,
address: c_uint,
data: *mut c_char,
size: c_uint,
) -> c_int
pub unsafe fn editSector( &self, address: c_uint, data: *mut c_char, size: c_uint, ) -> c_int
\brief This routine allows to write sector data on the user interface with the configration already initialized. \param address : The address to start writing from. \param data : Pointer to the data buffer. \param size : It indicates the size for write data. \return 0 if the writing operation correctly finished, otherwise an error occurred. \warning Unlike ST-LINK interface, the Bootloader interface can access only to some specific memory regions. \warning Data size should not exceed sector size.
Sourcepub unsafe fn downloadFile(
&self,
filePath: *const u32,
address: c_uint,
skipErase: c_uint,
verify: c_uint,
binPath: *const u32,
) -> c_int
pub unsafe fn downloadFile( &self, filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, binPath: *const u32, ) -> c_int
\brief This routine allows to download data from a file to the memory. File formats that are supported : hex, bin, srec, tsv, elf, axf, out, stm32, ext \param filePath : Indicates the full path of the considered file. \param address : The address to start downloading from. \param skipErase : In case to win in term time and if we have a blank device, we can skip erasing memory before programming [skipErase=0]. \param verify : To add verification step after downloading. \param binPath : Path of the binary file. \return 0 if the downloading operation correctly finished, otherwise an error occurred.
Sourcepub unsafe fn execute(&self, address: c_uint) -> c_int
pub unsafe fn execute(&self, address: c_uint) -> c_int
\brief This routine allows to run the application. \param address : The address to start executing from. In most cases, the program will run from the Flash memory starting from 0x08000000. \return 0 if the execution correctly started, otherwise an error occurred.
Sourcepub unsafe fn massErase(&self, sFlashMemName: *mut c_char) -> c_int
pub unsafe fn massErase(&self, sFlashMemName: *mut c_char) -> c_int
\brief This routine allows to erase the whole Flash memory. \return 0 if the operation finished successfully, otherwise an error was occurred. \note Depending on the device, this routine can take a particular period of time.
Sourcepub unsafe fn sectorErase(
&self,
sectors: *mut c_uint,
sectorNbr: c_uint,
sFlashMemName: *mut c_char,
) -> c_int
pub unsafe fn sectorErase( &self, sectors: *mut c_uint, sectorNbr: c_uint, sFlashMemName: *mut c_char, ) -> c_int
\brief This routine allows to erase specific sectors of the Flash memory. \param sectors : Indicates the indexs of the specific sectors to be erased. \param sectorNbr : The number of chosen sectors. \return 0 if the operation finished successfully, otherwise an error occurred. \note Each circuit has a specific number of Flash memory sectors.
Sourcepub unsafe fn readUnprotect(&self) -> c_int
pub unsafe fn readUnprotect(&self) -> c_int
\brief This routine allows to disable the readout protection. If the memory is not protected, a message appears to indicate that the device is not under Readout protection and the command has no effects. \return 0 if the disabling correctly accomplished, otherwise an error occurred. \note Depending on the device used, this routine take a specific time.
Sourcepub unsafe fn tzenRegression(&self) -> c_int
pub unsafe fn tzenRegression(&self) -> c_int
\brief This routine allows the TZEN Option Byte regression. \return 0 if the disabling correctly accomplished, otherwise an error occurred. \note Depending on the device used, this routine take a specific time.
Sourcepub unsafe fn getTargetInterfaceType(&self) -> c_int
pub unsafe fn getTargetInterfaceType(&self) -> c_int
\brief This routine allows to know the interface what is in use. \return The target interface type #targetInterfaceType, otherwise -1.
Sourcepub unsafe fn getCancelPointer(&self) -> *mut c_int
pub unsafe fn getCancelPointer(&self) -> *mut c_int
\brief This routine allows to drop the current read/write operation. \return 0 if there is no call for stop operation, otherwise 1.
Sourcepub unsafe fn fileOpen(&self, filePath: *const u32) -> *mut c_void
pub unsafe fn fileOpen(&self, filePath: *const u32) -> *mut c_void
\brief This routine allows to open and get data from any supported file extension. \param filePath : Indicates the full path of the considered file. \return Pointer to #fileData_C if the file has hex, bin, srec or elf as extension, otherwise a null pointer to indicate that the file type is not supported.
Sourcepub unsafe fn freeFileData(&self, data: *mut fileData_C)
pub unsafe fn freeFileData(&self, data: *mut fileData_C)
\brief This routine allows to clean up the handled file data. \param data
Sourcepub unsafe fn freeLibraryMemory(&self, ptr: *mut c_void)
pub unsafe fn freeLibraryMemory(&self, ptr: *mut c_void)
@brief This routine allows to free a specific memory region, typically used after readMemory(). @param ptr : The input pointer address. \note it’s crucial to ensure that the data is no longer in use after you free the memory.
Sourcepub unsafe fn verify(&self, fileData: *mut fileData_C, address: c_uint) -> c_int
pub unsafe fn verify(&self, fileData: *mut fileData_C, address: c_uint) -> c_int
\brief This routine allows to verfiy if the indicated file data is identical to Flash memory content. \param fileData : Input file name. \param address : The address to start verifying from, it’s considered only if the file has .bin or .binary as extension. \return 0 if the file data matching Flash memory content, otherwise an error occurred or the data is mismatched.
Sourcepub unsafe fn saveFileToFile(
&self,
fileData: *mut fileData_C,
sFileName: *const u32,
) -> c_int
pub unsafe fn saveFileToFile( &self, fileData: *mut fileData_C, sFileName: *const u32, ) -> c_int
\brief This routine allows to save the data file content to another file. \param fileData : Input file name. \param sFileName : Output file name. \return 0 if the output file was created successfully, otherwise an error occurred.
Sourcepub unsafe fn saveMemoryToFile(
&self,
address: c_int,
size: c_int,
sFileName: *const u32,
) -> c_int
pub unsafe fn saveMemoryToFile( &self, address: c_int, size: c_int, sFileName: *const u32, ) -> c_int
\brief This routine allows to save Flash memory content to file. \param address : The address to start saving from. \param size : Data size to be saved. \param sFileName : Indicates the file name. \return 0 if the data copy was acheived successfully, otherwise an error occurred. \note The file name must finish with an extension “.hex”, “.bin” or “.srec”
Sourcepub unsafe fn disconnect(&self)
pub unsafe fn disconnect(&self)
\brief This routine allows to clean up and disconnect the current connected target. \note This routine disconnect the target and delete the loaded Flash Loaders.
Sourcepub unsafe fn deleteInterfaceList(&self)
pub unsafe fn deleteInterfaceList(&self)
\brief This routine allows to clear the list of each created interface. \note The list is filled by #getStlinkList, #getDfuDeviceList or #getUsartList.
Sourcepub unsafe fn automaticMode(
&self,
filePath: *const u32,
address: c_uint,
skipErase: c_uint,
verify: c_uint,
isMassErase: c_int,
obCommand: *mut c_char,
run: c_int,
)
pub unsafe fn automaticMode( &self, filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, isMassErase: c_int, obCommand: *mut c_char, run: c_int, )
\brief This routine allows to enter and make an automatic process for memory management through JTAG/SWD, UART, DFU, SPI, CAN and I²C interfaces. \param filePath : Indicates the full file path. \param address : The address to start downloading from. \param skipErase : If we have a blank device, we can skip erasing memory before programming [skipErase=0]. \param verify : Add verification step after downloading. \param isMassErase : Erase the whole Flash memory. \param obCommand : Indicates the option bytes commands to be loaded “-ob [optionbyte=value] [optionbyte=value]…” \param run : Start the application. \warning Connection to target must be established before performing automatic mode.
Sourcepub unsafe fn serialNumberingAutomaticMode(
&self,
filePath: *const u32,
address: c_uint,
skipErase: c_uint,
verify: c_uint,
isMassErase: c_int,
obCommand: *mut c_char,
run: c_int,
enableSerialNumbering: c_int,
serialAddress: c_int,
serialSize: c_int,
serialInitialData: *mut c_char,
)
pub unsafe fn serialNumberingAutomaticMode( &self, filePath: *const u32, address: c_uint, skipErase: c_uint, verify: c_uint, isMassErase: c_int, obCommand: *mut c_char, run: c_int, enableSerialNumbering: c_int, serialAddress: c_int, serialSize: c_int, serialInitialData: *mut c_char, )
\brief This routine allows to enter and make an automatic process for memory management with serial numbering through JTAG/SWD, UART, DFU, SPI, CAN and I²C interfaces. \param filePath : Indicates the full file path. \param address : The address to start downloading from. \param skipErase : If we have a blank device, we can skip erasing memory before programming [skipErase=0]. \param verify : Add verification step after downloading. \param isMassErase : Erase the whole Flash memory. \param obCommand : Indicates the option bytes commands to be loaded “-ob [optionbyte=value] [optionbyte=value]…” \param run : Start the application. \param enableSerialNumbering : enables the serial numbering. \param serialAddress : the address where the inital data and the subsequent increments will be made. \param serialSize : size for the serial numbering. \param serialInitialData : intial data used for the serial numbering that will be incremented. \warning Connection to target must be established before performing automatic mode with serial numbering.
Sourcepub unsafe fn getStorageStructure(
&self,
deviceStorageStruct: *mut *mut storageStructure,
) -> c_int
pub unsafe fn getStorageStructure( &self, deviceStorageStruct: *mut *mut storageStructure, ) -> c_int
\brief This routine allows to get Flash storage information. \param deviceStorageStruct : The data strcurure to load memory sectors information. \return 0 if the operation was acheived successfully, otherwise an error occurred.
Sourcepub unsafe fn sendOptionBytesCmd(&self, command: *mut c_char) -> c_int
pub unsafe fn sendOptionBytesCmd(&self, command: *mut c_char) -> c_int
\brief This routine allows program the given Option Byte. The option bytes are configured by the end user depending on the application requirements. \param command : Indicates the command to execute. \return 0 if the programming Option Byte correctly executed, otherwise an error occurred. \note The command must written as: -ob [optionbyte=value] [optionbyte=value] … \code int ob = sendOptionBytesCmd(“–ob rdp=0x0 BOR_LEV=0”); \endcode
Sourcepub unsafe fn initOptionBytesInterface(&self) -> *mut peripheral_C
pub unsafe fn initOptionBytesInterface(&self) -> *mut peripheral_C
\brief This routine allows to get option bytes values of the connected target. \return Structure #Peripheral_C in which the option bytes descriptions are stored.
pub unsafe fn fastRomInitOptionBytesInterface( &self, deviceId: u16, ) -> *mut peripheral_C
Sourcepub unsafe fn obDisplay(&self) -> c_int
pub unsafe fn obDisplay(&self) -> c_int
\brief This routine allows to display the Option bytes. \return 0 if the programming display correctly done, otherwise an error occurred.
Sourcepub unsafe fn setLoadersPath(&self, path: *const c_char)
pub unsafe fn setLoadersPath(&self, path: *const c_char)
\brief This routine allows to specify the location of Flash Loader. \param path : Indicates the full path of the considered folder.
Sourcepub unsafe fn setExternalLoaderPath(
&self,
path: *const c_char,
externalLoaderInfo: *mut *mut externalLoader,
)
pub unsafe fn setExternalLoaderPath( &self, path: *const c_char, externalLoaderInfo: *mut *mut externalLoader, )
\brief This routine allows to specify the path of the external Loaders to be loaded. \param path : Indicates the full path of the folder containing external Loaders. \param externalLoaderInfo : Structure in which the external Loaders informations are stored.
Sourcepub unsafe fn setExternalLoaderOBL(
&self,
path: *const c_char,
externalLoaderInfo: *mut *mut externalLoader,
)
pub unsafe fn setExternalLoaderOBL( &self, path: *const c_char, externalLoaderInfo: *mut *mut externalLoader, )
\brief This routine allows to specify the path of the external Loaders to be loaded via OBL interfaces. \param path : Indicates the full path of the folder containing external Loaders. \param externalLoaderInfo : Structure in which the external Loaders informations are stored.
Sourcepub unsafe fn getExternalLoaders(
&self,
path: *const c_char,
externalStorageNfo: *mut *mut externalStorageInfo,
) -> c_int
pub unsafe fn getExternalLoaders( &self, path: *const c_char, externalStorageNfo: *mut *mut externalStorageInfo, ) -> c_int
\brief This routine allows to get available external Loaders in the mentioned path. \param path : Indicates the full path containing ExternalLoader folder. \param externalStorageNfo : Structure in which we get storage information. \return 1 if the External loaders cannot be loaded from the path, otherwise 0. \warning All external Loader files should have the extension “stldr”.
Sourcepub unsafe fn removeExternalLoader(&self, path: *const c_char)
pub unsafe fn removeExternalLoader(&self, path: *const c_char)
\brief This routine allows to unload an external Loaders. \param path : Indicates the full path of the external Loader file ready for unloading.
Sourcepub unsafe fn deleteLoaders(&self)
pub unsafe fn deleteLoaders(&self)
\brief This routine allows to delete all target Flash Loaders.
Sourcepub unsafe fn getUID64(&self, data: *mut *mut c_uchar) -> c_int
pub unsafe fn getUID64(&self, data: *mut *mut c_uchar) -> c_int
\brief This routine allows to read the device unique identifier. \param data : Pointer to the data buffer.
Sourcepub unsafe fn firmwareDelete(&self) -> c_int
pub unsafe fn firmwareDelete(&self) -> c_int
\brief This routine allows to erase the BLE stack firmware. \return 0 if the operation was acheived successfully, otherwise an error occurred.
Sourcepub unsafe fn firmwareUpgrade(
&self,
filePath: *const u32,
address: c_uint,
firstInstall: c_uint,
startStack: c_uint,
verify: c_uint,
) -> c_int
pub unsafe fn firmwareUpgrade( &self, filePath: *const u32, address: c_uint, firstInstall: c_uint, startStack: c_uint, verify: c_uint, ) -> c_int
\brief This routine allows to make upgrade of BLE stack firmware or FUS firmware. \param filePath : Indicates the full path of the firmware to be programmed. \param address : Start address of download. \param firstInstall : 1 if it is the first installation, otherwise 0, to ignore the firmware delete operation. \param startStack : Starts the stack after programming. \param verify : Verify if the download operation is achieved successfully before starting the upgrade. \return true if the operation was acheived successfully, otherwise an error occurred.
Sourcepub unsafe fn startWirelessStack(&self) -> c_int
pub unsafe fn startWirelessStack(&self) -> c_int
\brief This routine allows to start the programmed Stack. \return true if the Stack was started successfully, otherwise an error occurred.
Sourcepub unsafe fn updateAuthKey(&self, filePath: *const u32) -> c_int
pub unsafe fn updateAuthKey(&self, filePath: *const u32) -> c_int
\brief This routine allows to start the programmed Stack. \param filePath : Indicates the full path of the key file. \note This is the public key generated by STM32TrustedPackageCreator when signing the firmware using -sign command. \return true if the update was performed successfully, otherwise an error occurred.
Sourcepub unsafe fn authKeyLock(&self) -> c_int
pub unsafe fn authKeyLock(&self) -> c_int
\brief This routine allows to lock the authentication key and once locked, it is no longer possible to change it. \return 0 if the lock step was performed successfully, otherwise an error occurred.
Sourcepub unsafe fn writeUserKey(
&self,
filePath: *const u32,
keyType: c_uchar,
) -> c_int
pub unsafe fn writeUserKey( &self, filePath: *const u32, keyType: c_uchar, ) -> c_int
\brief This routine allows to write a customized user key. \param filePath : Indicates the full path of the key file. \param keyType : String indicating the key type to be used “Simple”, “Master”, “Encrypted”. \return 0 if the write was performed successfully, otherwise an error occurred.
Sourcepub unsafe fn antiRollBack(&self) -> c_int
pub unsafe fn antiRollBack(&self) -> c_int
\brief This routine allows to activate the AntiRollBack. \return true if the activation was done successfully, otherwise an error occurred.
Sourcepub unsafe fn startFus(&self) -> c_int
pub unsafe fn startFus(&self) -> c_int
\brief This routine allows to start and establish a communication with the FUS operator. \return true if the FUS operator was started successfully, otherwise an error occurred. \note Availbale only for ST-LINK interfaces.
Sourcepub unsafe fn unlockchip(&self) -> c_int
pub unsafe fn unlockchip(&self) -> c_int
\brief This routine allows to set default option Bytes.
Sourcepub unsafe fn programSsp(
&self,
sspFile: *const u32,
licenseFile: *const u32,
tfaFile: *const u32,
hsmSlotId: c_int,
) -> c_int
pub unsafe fn programSsp( &self, sspFile: *const u32, licenseFile: *const u32, tfaFile: *const u32, hsmSlotId: c_int, ) -> c_int
\brief This routine aims to launch the Secure Secret Provisioning. \param sspFile : Indicates the full path of the ssp file [Use STM32TrustedPackageCreator to generate a ssp image]. \param licenseFile : Indicates the full path of the license file. If you are trying to start the SSP without HSM, the hsmSlotId should be 0. \param tfaFile : Indicates the full path of the tfa-ssp file. \param hsmSlotId : Indicates the HSM slot ID. \return 0 if the SSP was finished successfully, otherwise an error occurred. \note If you are trying to start the SSP with HSM, the licenseFile parametre should be empty.
Sourcepub unsafe fn getHsmFirmwareID(&self, hsmSlotId: c_int) -> *const c_char
pub unsafe fn getHsmFirmwareID(&self, hsmSlotId: c_int) -> *const c_char
@brief getHsmFirmwareID: this routine aims to get the HSM Firmware Identifier. @param hsmSlotId: The slot index of the plugud-in HSM @return string that contains the HSM Firmware Identifier.
Sourcepub unsafe fn getHsmCounter(&self, hsmSlotId: c_int) -> c_ulong
pub unsafe fn getHsmCounter(&self, hsmSlotId: c_int) -> c_ulong
@brief getHsmCounter: this routine aims to get the current HSM counter. @param hsmSlotId: The slot index of the plugud-in HSM @return Counter value
Sourcepub unsafe fn getHsmState(&self, hsmSlotId: c_int) -> *const c_char
pub unsafe fn getHsmState(&self, hsmSlotId: c_int) -> *const c_char
@brief getHsmState: this routine aims to get the HSM State. @param hsmSlotId: The slot index of the plugud-in HSM @return string with possible values: ST_STATE , OEM_STATE, OPERATIONAL_STATE , UNKNOWN_STATE
Sourcepub unsafe fn getHsmVersion(&self, hsmSlotId: c_int) -> *const c_char
pub unsafe fn getHsmVersion(&self, hsmSlotId: c_int) -> *const c_char
@brief getHsmVersion: this routine aims to get the HSM version. @param hsmSlotId: The slot index of the plugud-in HSM @return string with possible values: 1 , 2
Sourcepub unsafe fn getHsmType(&self, hsmSlotId: c_int) -> *const c_char
pub unsafe fn getHsmType(&self, hsmSlotId: c_int) -> *const c_char
@brief getHsmType: this routine aims to get the HSM type. @param hsmSlotId: The slot index of the plugud-in HSM @return string with possible values: SFI. SMU. SSP…
Sourcepub unsafe fn getHsmLicense(
&self,
hsmSlotId: c_int,
outLicensePath: *const u32,
) -> c_int
pub unsafe fn getHsmLicense( &self, hsmSlotId: c_int, outLicensePath: *const u32, ) -> c_int
@brief getHsmLicense: this routine aims to get and save the HSM license into a binary file. @param hsmSlotId: The slot index of the plugud-in HSM @param outLicensePath: path of the output binary file. @return 0 if the operation was finished successfully, otherwise an error occurred. \note Connection to target must be established before performing this routine.
Sourcepub unsafe fn writeCortexRegistres(&self, reg: c_uint, data: c_uint) -> c_int
pub unsafe fn writeCortexRegistres(&self, reg: c_uint, data: c_uint) -> c_int
\brief Write a core register. \param reg : The register to write. \param data : The data to write. \return 0 if the writing operation correctly finished, otherwise an error occurred.