Sequential Functions
Sequential functions allow access to the target device in any combination of small instructions like erase, read, write sector, modify part of memory, etc. Sequential functions work correctly after communication between target device and programming adapter has been initialized. This requires the target FPA to be opened using F_OpenInstancesAndFPAs and F Initialization, and for proper configuration options to be set using Generic Functions | F_ConfigFileLoad or Generic Functions | F_Set_Config_Value_by_Name.
Once the FPA has been initialized using the aforementioned functions, open the target device using the function Sequential Functions | F_Open_Target_Device. When communication is established, then any of the sequential instructions can be called. When finished, conclude your task by calling Sequential Functions | F_Close_Target_Device.
NOTE: Sequential Functions | F_Open_Target_Device is a high overhead function (usually around one second of execution time). Therefore call Sequential Functions | F_Open_Target_Device only once and perform all sequential functions before closing the target with Sequential Functions | F_Close_Target_Device. Sample code sequence:
F_OpenInstancesAndFPAs("*# *");//only first FPA
F_Set_FPA_index(1); //select FPA 1
F_Initialization(); //initialize selected FPA(s)
F_ConfigFileLoad(<config file path>); //load config file to selected FPA(s)
F_Open_Target_Device(); //power on, initialize JTAG/SWD communication, calib clk
... < all sequential functions here > ...
F_Close_Target_Device(); //power off
- 1 1. F_Open_Target_Device
- 2 2. F_Close_Target_Device
- 3 3. F_Segment_Erase
- 4 4. F_Sectors_Blank_Check
- 5 5. F_Copy_Buffer_to_Flash
- 6 6. F_Copy_Flash_to_Buffer (FlashPro-M only)
- 7 7. F_Copy_Gang_Buffer_to_Flash (GangPro-M only)
- 8 8. F_Copy_Flash_to_Gang_Buffer (GangPro-M only)
- 9 9. F_Write_Byte_to_RAM
- 10 10. F_Write_Word16_to_RAM
- 11 11. F_Write_Word32_to_RAM
- 12 12. F_Write_Bytes_Block_to_RAM
- 13 13. F_Read_Byte (FlashPro-M only)
- 14 14. F_Read_Word16 (FlashPro-M only)
- 15 15. F_Read_Word32 (FlashPro-M only)
- 16 16. F_Read_Bytes_Block (FlashPro-M only)
- 17 17. F_Gang_Read_Byte (GangPro-M only)
- 18 18. F_Gang_Read_Word16 (GangPro-M only)
- 19 19. F_Gang_Read_Word32 (GangPro-M only)
- 20 20. F_Gang_Bytes_Block (GangPro-M only)
- 21 21. F_Write_Locking_Registers
- 22 22. F_Write_Debug_Register
- 23 23. F_Get_MCU_Data
- 24 24. F_Capture_PC_Addr
- 25 25. F_Get_Targets_Result (GangPro-M only)
- 26 26. F_Get_Active_Targets_Mask (GangPro-M only)
1. F_Open_Target_Device
General Description
The FPA will establish communication with the target device(s). This step requires a working connection, a read of the processor ID, RAM size, and flash size checked against internal records (except when target MCU doesn’t have this meta-data available), and calibration of internal CPU clock. If these steps match expected values the operation will succeed.
If General Configuration | MetadataWrnIsErr is disabled, only the processor ID needs to match records, the RAM and flash size do not. If the RAM and flash do not match a warning will be printed and accessible via Generic Functions | F_ReportMessage
If General Configuration | MetadataWrnIsErr is enabled, all values need to match, processor ID, RAM size, and flash size, otherwise function will fail.
This function has some exclusive GangPro-M return values.
Syntax
INT_X F_Open_Target_Device( void );
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index , index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
2. F_Close_Target_Device
General Description
Terminates communication between FPA and target device. Sets reset line to GND and communication lines (TMS, TCK, TDI) to configuration setting “ReleaseJtagState”.
This function has some exclusive GangPro-M return values.
Syntax
INT_X F_Close_Target_Device( void );
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index , index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
3. F_Segment_Erase
General Description
Send command to erase target device’s memory segment.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X address : address of segment/sector to be erased
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6STATUS_ADDRESS_OUT_OF_FLASH_SPACE_ERR (534) : address out of range
STATUS_ERASE_SEGMENT_FAILED (549) : erase operation failed
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
4. F_Sectors_Blank_Check
General Description
Blank check part or all of the target device’s memory.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X start_addr : first memory address to be included in blank check (inclusive)
INT_X stop_addr : last memory address to be included in blank check (inclusive)
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
5. F_Copy_Buffer_to_Flash
General Description
Write specified number of bytes from Write Buffer in FlashPro-M Data Buffer Functions | FlashPro-M-buffers or GangPro-M Data Buffer Functions | GangPro-M-buffers to target flash.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X start_addr : valid flash address
INT_X size : number of bytes to copy beginning at start address
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
6. F_Copy_Flash_to_Buffer (FlashPro-M only)
General Description
Read specified number of bytes from MCU flash to Read Data Buffer in FlashPro-M Data Buffer Functions | FlashPro-M-buffers.
Syntax
Input
INT_X start_addr : valid flash address
INT_X size : number of bytes to copy beginning at start address
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
TRUE (1) : succeeded
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
Refer to Sequential Functions | F_Copy_Buffer_to_Flash.
7. F_Copy_Gang_Buffer_to_Flash (GangPro-M only)
General Description
Write specified number of bytes from Gang Write Buffer in GangPro-M Data Buffer Functions | GangPro-M-buffers to target flash.
Syntax
Input
INT_X start_addr : valid flash address
INT_X size : number of bytes to copy beginning at start address
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
8. F_Copy_Flash_to_Gang_Buffer (GangPro-M only)
General Description
Read specified number of bytes from targets' MCU flash to Gang Read Buffers in GangPro-M Data Buffer Functions | GangPro-M-buffers.
Syntax
Input
INT_X start_addr : valid flash address
INT_X size : number of bytes to copy beginning at start address
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
Example
Refer to Sequential Functions | F_Copy_Gang_Buffer_to_Flash.
9. F_Write_Byte_to_RAM
General Description
Use the FPA to write a byte to the target device(s) RAM. This write is not verified (no read performed). Use F_Read_Byte (FlashPro-M) or F_Gang_Read_Byte (GangPro-M) to verify.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X addr : address of byte to be written (byte addressable)
BYTE data : byte to be written
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
10. F_Write_Word16_to_RAM
General Description
Use the FPA to write two bytes to the target device(s) RAM. This write is not verified (no read performed). Use F_Read_Word16 (FlashPro-M) or F_Gang_Read_Word16 (GangPro-M) to verify.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X addr : address of 16-bit data to be written (byte addressable)
INT_X data : 16-bit data to be written
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
11. F_Write_Word32_to_RAM
General Description
Use the FPA to write four bytes to the target device(s) RAM. This write is not verified (no read performed). Use F_Read_Word32 (FlashPro-M) or F_Gang_Read_Word32 (GangPro-M) to verify.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X addr : address of 32-bit data to be written (byte addressable)
INT_X data : 32-bit data to be written
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
12. F_Write_Bytes_Block_to_RAM
General Description
Use the FPA to write a block of bytes to RAM. Currently this function only writes a block of bytes with a size that is a multiple of four, to a 32-bit word aligned address. These writes are not verified (no reads performed). Use F_Read_Bytes_Block (FlashPro-M) or F_Gang_Read_Bytes_Block (GangPro-M) to verify.
This function has some exclusive GangPro-M return values.
Syntax
Input
INT_X addr : address of 32-bit data to be written (byte addressable)
INT_X size : number of bytes to be written
BYTE *data : array of bytes to be written (not verified)
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6STATUS ADDR ALIGNMENT ERROR (543) : not 32-bit word aligned address
STATUS SIZE ALIGNMENT ERROR (544) : number of bytes not a multiple of four
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
13. F_Read_Byte (FlashPro-M only)
General Description
Use the FPA to read one byte from any address (RAM, flash, etc.).
Syntax
Input
INT_X addr : address of byte to be read
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : data read
0-0xFF : byte value
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
14. F_Read_Word16 (FlashPro-M only)
General Description
Use the FPA to read two bytes from any address (RAM, flash, etc.).
Syntax
Input
INT_X addr : address of 16-bit word to be read
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : data read
0-0xFFFF : 16-bit word value
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
15. F_Read_Word32 (FlashPro-M only)
General Description
Use the FPA to read four bytes from any address (RAM, flash, etc.).
Syntax
Input
INT_X addr : address of 32-bit word to be read
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : data read
0-0xFFFFFFFF : 32-bit word value
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
16. F_Read_Bytes_Block (FlashPro-M only)
General Description
Use the FPA to read a block of bytes from any address (RAM, flash, etc.).
Syntax
Input
INT_X addr : first byte address to be read (byte addressable)
INT_X size : number of bytes to be read
BYTE *data : array of bytes that will be written with memory contents
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64.
Output
INT_X : result of operation
FALSE (0) : failed
TRUE (1) : succeeded
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
17. F_Gang_Read_Byte (GangPro-M only)
General Description
Use the FPA to read one byte from any address (RAM, flash, etc.).
Syntax
Input
BYTE target no : MCU target number 1 to 6
INT_X addr : address of byte to be read
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : data read
0-0xFF : byte value
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
18. F_Gang_Read_Word16 (GangPro-M only)
General Description
Use the FPA to read two bytes from any address (RAM, flash, etc.).
Syntax
Input
BYTE target no : MCU target number 1 to 6
INT_X addr : address of 16-bit word to be read
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : data read
0-0xFFFF : 16-bit word value
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
19. F_Gang_Read_Word32 (GangPro-M only)
General Description
Use the FPA to read four bytes from any address (RAM, flash, etc.).
Syntax
Input
BYTE target no : MCU target number 1 to 6
INT_X addr : address of 32-bit word to be read
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : data read
0-0xFFFFFFFF : 32-bit word value
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
20. F_Gang_Bytes_Block (GangPro-M only)
General Description
Use the FPA to read a block of bytes from any address (RAM, flash, etc.).
Syntax
Input
INT_X addr : first byte address to be read (byte addressable)
INT_X size : number of bytes to be read
BYTE data[][GANG SIZE] : array of bytes that will be written with memory contents
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64.
Output
INT_X : result of operation
FALSE (0) : failed
TRUE (1) : succeeded
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
21. F_Write_Locking_Registers
General Description
Write to non-volatile memory protection bits, option bytes, and/or persistent user-data registers (if supported). Does not block communication over debug interface, but can disable writing and/or reading from target device’s memory. These option bytes can be reset to factory settings using the Encapsulated Functions | F_Clear_Locked_Device function if the device supports it. To write protection bits, the Memory Protection Configuration | WriteLockingBitsEn configuration option has to be enabled. To control the exact data that is program, consult in detail the Main FP/GP M GUI->Setup->Memory protection, or section 2. Configuration and select the correct MCU vendor.
This function has some exclusive GangPro-M return values.
Syntax
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
22. F_Write_Debug_Register
General Description
Write to non-volatile protection bits, or option bytes to disable communication over debug interface. These bits can be reset to factory settings using the Encapsulated Functions | F_Clear_Locked_Device function if the device supports it. To disable debug access, the Memory Protection Configuration | WriteLockingBitsEn configuration option has to be enabled. To control the exact data that is program, consult in detail the Main FP/GP M GUI->Setup->Memory protection, or section 2. Configuration and select the correct MCU vendor.
This function has some exclusive GangPro-M return values.
Syntax
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
FlashPro-M - TRUE (1) : succeeded
GangPro-M - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
23. F_Get_MCU_Data
General Description
Return the actual MCU ID, flash size, and/or RAM size read by the FPA from target, if supported by vendor.
This function has some exclusive GangPro-M input values.
Syntax
Input
INT_X type : select type of information to receive
GET_MCU_ID (1) : connected MCU package identifier (MCU family and group, etc.), not a unique silicon ID
GET_MCU_FLASH_SIZE (2) : connected MCU flash size, if available
GET_MCU_RAM_SIZE (3) : connected MCU RAM size, if available
GET_MCU_TARGET_1 (0x10) : read from target 1, OR with type of info. requested (GangPro-M only)
GET_MCU_TARGET_2 (0x20) : read from target 2, OR with type of info. requested (GangPro-M only)
GET_MCU_TARGET_3 (0x30) : read from target 3, OR with type of info. requested (GangPro-M only)
GET_MCU_TARGET_4 (0x40) : read from target 4, OR with type of info. requested (GangPro-M only)
GET_MCU_TARGET_5 (0x50) : read from target 5, OR with type of info. requested (GangPro-M only)
GET_MCU_TARGET_6 (0x60) : read from target 6, OR with type of info. requested (GangPro-M only)
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed. No communication or incorrect parameters.
any positive value : MCU ID, flash size, or RAM size
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
24. F_Capture_PC_Addr
General Description
Read program counter (PC) register using debug interface.
Syntax
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
any positive value : program counter
FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
25. F_Get_Targets_Result (GangPro-M only)
General Description
Return per-target success result for encapsulated functions. An error mask can be produced by
subtracting F_Get_Targets_Result() from F_Get_Active_Targets_Mask().
Syntax
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range
26. F_Get_Active_Targets_Mask (GangPro-M only)
General Description
Return per-target active status. Set intended target mask using: Generic Functions | F_Set_Config_Value_By_Name. Value returned by this function is updated during communication initialization, after any encapsulated function or Sequential Functions | F_Open_Target_Device . An error mask can be produced by subtracting F_Get_Targets_Result() from F_Get_Active_Targets_Mask().
Syntax
Input
none.
Select FPA to perform operation on using Multi API-DLL Functions | F_Set_FPA_index, index 1 to 64. Use index 0 to perform operation on all FPAs (if results differ, use Multi API-DLL Functions | F_LastStatus to get individual results).
Output
INT_X : result of operation
FALSE (0) : failed
TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
4, 0x10 - target 5, 0x20 - target 6FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to Multi API-DLL Functions | F_LastStatus
FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with Multi API-DLL Functions | F_OpenInstancesAndFPAs or index out of range