Skip to end of banner
Go to start of banner

Sequential Functions

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

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. 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.

This function has some exclusive GangPro-ARM 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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM 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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM return values.

Syntax

INT_X F_Segment_Erase( INT_X address );

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • STATUS_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 F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM return values.

Syntax

INT_X F_Sectors_Blank_Check( INT_X start_addr, INT_X stop_addr );

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM Data Buffer Functions | FlashPro-ARM-buffers or GangPro-ARM Data Buffer Functions | GangPro-ARM-buffers to target flash.

This function has some exclusive GangPro-ARM return values.

Syntax

INT_X F_Copy_Buffer_to_Flash( INT_X start_addr, INT_X size );

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range

Example

Custom Buffer Write and Verify - FlashPro-ARM
This code example writes custom bytes to the Write Buffer within the API-DLL, programs the buffer to target flash, and then verifies the programmed data using direct read-back of the target’s flash. This example is geared towards the single target FlashPro-ARM library.

The condition for this example to work properly is that F_OpenInstancesAndFPAs, and F_Initialization has correctly initialized the given fpa index (1 to 64). If testing adapter 1, the user should call F_Set_FPA_index(1) before this code executes. In addition the user should load the intended configuration file using F_ConfigFileLoad so that the right MCU is selected.

MCU_Info struct was initialized using example Get MCU Info.

The code sequence is as follows:

  • Power on target device and open communication using F_Open_Target_Device

  • Get MCU base flash address, MCU_Info.u.x.FlashStartAddr, and add 0x100. This code will write custom bytes to almost the start of flash.

  • In a loop, populate the Write Buffer with custom bytes starting at address addr using F_Put_Byte_to_Buffer

  • Program custom bytes to target using F_Copy_Buffer_to_Flash

  • Read target memory and save contents to Read Data Buffer using F_Copy_Flash_to_Buffer

  • In a loop, read bytes from the Read Data Buffer and print them using F_Get_Byte_from_Buffer

  • Power down target and close communication using F_Close_Target_Device

INT_X response;
const int size=32;

response = F_Open_Target_Device();
if(response != TRUE)
  return response;
  
char text[200];	
long addr = MCU_Info.u.x.FlashStartAddr + 0x100;
for(int k=0; k< size; k++)
{
  //----------------------------------------------------
  F_Put_Byte_to_Buffer( (INT_X )(addr+k), (BYTE)( 0x10 + k ));
  //----------------------------------------------------
}
//----------------------------------------------------
response = F_Copy_Buffer_to_Flash( addr, size );
if(response != TRUE)
  return response;
//----------------------------------------------------

//----------------------------------------------------
response = F_Copy_Flash_to_Buffer( addr, size ); 
if(response != TRUE)
  return response; 
//----------------------------------------------------

for( int n=0; n<size; n += 16 )
{
  for( int k = 0; k<16; k++ )
  {
    //----------------------------------------------------
    sprintf( text+3*k, "%2.2X  ", F_Get_Byte_from_Buffer((INT_X )( addr + k + n) ));//for single buffer, when reading it works only for FlashPro
    //----------------------------------------------------
  }
  strcat( text, "\r\n" );
  printf("%s", text);
}

response = F_Close_Target_Device();
if(response != TRUE)
  return response;

6. F_Copy_Flash_to_Buffer (FlashPro-ARM only)

General Description

Read specified number of bytes from MCU flash to Read Data Buffer in FlashPro-ARM Data Buffer Functions | FlashPro-ARM-buffers.

Syntax

INT_X F_Copy_Flash_to_Buffer( INT_X start_addr, INT_X size );

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 F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM only)

General Description

Write specified number of bytes from Gang Write Buffer in GangPro-ARM Data Buffer Functions | GangPro-ARM-buffers to target flash.

Syntax

INT_X F_Copy_Gang_Buffer_to_Flash( INT_X start_addr, INT_X size );

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 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range

Example

Custom Buffer Write and Verify - GangPro-ARM
This code example writes custom bytes to the Gang Write Buffers (6) within the API-DLL, programs the buffers to targets' flash, and then verifies the programmed data using direct read-back of the targets' flash. This example is geared towards multiple targets GangPro-ARM library.

The condition for this example to work properly is that F_OpenInstancesAndFPAs, and F_Initialization has correctly initialized the given fpa index (1 to 64). If testing adapter 1, the user should call F_Set_FPA_index(1) before this code executes. In addition the user should load the intended configuration file using F_ConfigFileLoad so that the right MCU is selected.

MCU_Info struct was initialized using example Get MCU Info.

The code sequence is as follows:

  • Power on target devices and open communication using F_Open_Target_Device

  • The return value is a TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6, if at least one target succeeded then proceed further.

  • Get MCU base flash address, MCU_Info.u.x.FlashStartAddr, and add 0x100. This code will write custom bytes to almost the start of flash.

  • In a loop, populate the Gang Write Buffer for target 1 with custom bytes starting at address addr using F_Put_Byte_to_Gang_Buffer. The user can change the first parameter to write different bytes to target 2, 3, 4, 5, or 6.

  • Program custom bytes to targets using F_Copy_Gang_Buffer_to_Flash

  • Read target memories and save contents to Gang Read Buffers (6) using F_Copy_Flash_to_Gang_Buffer

  • In a loop, read bytes from the Gang Read Buffers and print them using F_Get_Byte_from_Gang_Buffer, this example iterates over 6 target buffers.

  • Power down targets and close communication using F_Close_Target_Device

#define ANY_TARGET 0x3F
INT_X response;
const int size=32;

response = F_Open_Target_Device();
if((response & ANY_TARGET) == 0)
  return response;
  
char text[1000];	  
long addr = MCU_Info.u.x.FlashStartAddr + 0x100;
for(int k=0; k< size; k++)
{
  //----------------------------------------------------
  F_Put_Byte_to_Gang_Buffer( 1, (INT_X )(addr+k), (BYTE)( 0x10 + k ));
  //----------------------------------------------------
}
//----------------------------------------------------
response = F_Copy_Gang_Buffer_to_Flash( addr, size );
if((response & ANY_TARGET) == 0)
  return response;
//----------------------------------------------------

//----------------------------------------------------
response = F_Copy_Flash_to_Gang_Buffer( addr, size );
if((response & ANY_TARGET) == 0)
  return response;
//----------------------------------------------------

if( F_Get_Active_Targets_Mask() == response )
{
  sprintf( text, "Read from FLASH - address 0x%4.4X\r\n", addr );
  printf("%s", text);
  for(int p=0; p<GANG_SIZE; p++)			
  {
    for( int n=0; n<size; n += 16 )
    {
      for( int k = 0; k<16; k++ )
      {
        //----------------------------------------------------
        sprintf( text+3*k, "%2.2X  ", F_Get_Byte_from_Gang_Buffer( (p+1), (INT_X )( addr + k + n) ));//for gang buffer, when reading in GangPro
        
        //----------------------------------------------------
      }
      strcat( text, "\r\n" );
      printf("%s", text);
    }
  }
}

response = F_Close_Target_Device();
if((response & ANY_TARGET) == 0)
  return response;

8. F_Copy_Flash_to_Gang_Buffer (GangPro-ARM only)

General Description

Read specified number of bytes from targets' MCU flash to Gang Read Buffers in GangPro-ARM Data Buffer Functions | GangPro-ARM-buffers.

Syntax

INT_X F_Copy_Flash_to_Gang_Buffer( INT_X start_addr, INT_X size );

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 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM) or F_Gang_Read_Byte (GangPro-ARM) to verify.

This function has some exclusive GangPro-ARM return values.

Syntax

INT_X F_Write_Byte_to_RAM( INT_X addr, BYTE data );

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM) or F_Gang_Read_Word16 (GangPro-ARM) to verify.

This function has some exclusive GangPro-ARM return values.

Syntax

INT_X F_Write_Word16_to_RAM( INT_X addr, INT_X data )

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM) or F_Gang_Read_Word32 (GangPro-ARM) to verify.

This function has some exclusive GangPro-ARM return values.

Syntax

INT_X F_Write_Word32_to_RAM( INT_X addr, INT_X data )

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • FPA_UNMATCHED_RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with 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-ARM) or F_Gang_Read_Bytes_Block (GangPro-ARM) to verify.

This function has some exclusive GangPro-ARM return values.

Syntax

INT_X F_Write_Bytes_Block_to_RAM( INT_X addr, INT_X size, BYTE *data )

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-ARM - TRUE (1) : succeeded

  • GangPro-ARM - TRUE MASK (0x01..0x3F) : 0x01 - target 1, 0x02 - target 2, 0x04 - target 3, 0x08 - target
    4, 0x10 - target 5, 0x20 - target 6

  • STATUS 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 F_LastStatus

  • FPA_INVALID_NO (-2 or 0xFFFFFFFE) : FPA not opened with F_OpenInstancesAndFPAs or index out of range

F Read Byte

General Description

Use the FPA to read one byte from any address (RAM, flash, etc.).

Syntax

INT_X F_Read_Byte( INT_X addr )

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 F LastStatus(avoid this by not using FPA index 0)

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)

F Read Word16

General Description

Use the FPA to read two bytes from any address (RAM, flash, etc.).

Syntax

INT_X F_Read_Word16( INT_X addr )

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 F LastStatus(avoid this by not using FPA index 0)

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)

F Read Word32

General Description

Use the FPA to read four bytes from any address (RAM, flash, etc.).

Syntax

INT_X F_Read_Word32( INT_X addr )

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 F LastStatus(avoid this by not using FPA index 0)

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)

F Read Bytes Block

General Description

Use the FPA to read a block of bytes from any address (RAM, flash, etc.).

Syntax

INT_X F_Read_Bytes_Block( INT_X addr, INT_X size, BYTE *data );

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. 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 INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range

F Set PC and RUN

General Description

Start target MCU from specified program counter (PC). There should be a valid instruction at the target address.

Syntax

INT_X F_Set_PC_and_RUN( INT_X PC_addr )

Input

INT X PC addr : set program counter to this address and start processor

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

TRUE (1) : succeeded

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range

F Write Locking Registers

General Description

Write to non-volatile memory protection bits 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 bits can be reset to factory settings using the F Clear Locked Device function if the device supports it. To write protection bits, enable the WriteLockingBitsEn config- uration option.

Syntax

INT_X F_Write_Locking_Registers( 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

  • TRUE (1) : succeeded

FPA UNMATCHED RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F LastStatus

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range

F Write Debug Register

General Description

Write to non-volatile protection bits to disable communication over debug interface. These bits can be reset to factory settings using the F Clear Locked Device function if the device supports it. To disable debug access, enable WriteLockingBitsEn and (vendor) USER DBG WrEn configuration options.

Syntax

INT_X F_Write_Debug_Register( 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

  • TRUE (1) : succeeded

FPA UNMATCHED RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F LastStatus

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range

F Get MCU Data

General Description

Return the MCU ID, flash size, or RAM size read by the FPA to identify a specific target device, if supported by vendor.

Syntax

INT_X F_Get_MCU_Data( INT_X type )

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

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 postive value: MCU ID, flash size, RAM size

FPA UNMATCHED RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F LastStatus(avoid this by not using FPA index 0)

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)

F Capture PC Addr

General Description

Read program counter (PC) register using debug interface.

Syntax

INT_X F_Capture_PC_Addr( 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.

  • any postive value: program counter

FPA UNMATCHED RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F LastStatus(avoid this by not using FPA index 0)

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)

F Synch CPU JTAG

General Description

Stop target device (debug enable and halt).

Syntax

INT_X F_Synch_CPU_JTAG();

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 (1) : succeeded. MCU stopped.

FPA UNMATCHED RESULTS (-1 or 0xFFFFFFFF) : Result of operation inconsistent across all selected FPAs, refer to F LastStatus(avoid this by not using FPA index 0)

FPA INVALID NO (-2 or 0xFFFFFFFE) : FPA not opened with F OpenInstancesAndFPAs or index out of range(avoid this by using F Check FPA index first)

  • No labels