SLAU358Q September 2011 – October 2019
MSPGANG_GetDataBuffers_ptr gives access to the internal data buffers that provide code contents, data to be programmed, and buffers of data that was read from each target device with following structure.
LONG WINAPI MSPGANG_GetDataBuffers_ptr( void ** x );
#define DBUFFER_SIZE 0x210000
#define JTAG_PASSW_LEN 0x80
#define BSL_PASSW_LEN 0x20 //MSP430
#define ARM_BSL_PASSW_LEN 0x100 //MSP432
#define MAX_BSL_PASSW_LEN 0x100 //max from (ARM_BSL_PASSW_LEN, BSL_PASSW_LEN)
#define MAX_PASSW_LEN 0x100 //max from (ARM_BSL_PASSW_LEN, BSL_PASSW_LEN, JTAG_PASSW_LEN )
#define FLASH_END_ADDR (DBUFFER_SIZE-1)
#define FLASH_BUF_LEN DBUFFER_SIZE
#define GANG_SIZE 8
typedef struct
{
BYTE SourceCode[DBUFFER_SIZE]; //source code from the file
BYTE UsedCode[DBUFFER_SIZE]; //combined data (source code, serialization etc)
BYTE GangRx[DBUFFER_SIZE][GANG_SIZE]; //data read from all targets
BYTE Tmp[DBUFFER_SIZE]; //used for second file cmp
BYTE Flag_ScrCode[DBUFFER_SIZE]; //0 - empty 1-Code1, 2-Code2, 4-Appended Code in SourceCode[x];
#define CODE1_FLAG 1
#define CODE2_FLAG 2
#define APPEND_CODE_FLAG 4
BYTE Flag_UsedCode[DBUFFER_SIZE]; //0 - empty 1-valid data in UsedCode[x];
BYTE Flag_WrEn[DBUFFER_SIZE]; //0 - none 1-write/verify enable in FlashMem[x]
BYTE Flag_EraseEn[DBUFFER_SIZE]; //0 - none 1-erase enable in FlashMem[x]
BYTE Flag_RdEn[DBUFFER_SIZE]; //0 - none 1-read enable in FlashMem[x]
BYTE Flag_Sp3[DBUFFER_SIZE]; //used internally
BYTE JTAG_Passsword[2][JTAG_PASSW_LEN];
BYTE BSL_Passsword[2][MAX_BSL_PASSW_LEN];
BYTE Flag_JTAG_Passw[2][JTAG_PASSW_LEN]; // [0][..]-password from code file; [1][..]-password from password file
BYTE Flag_BSL_Passw[2][MAX_BSL_PASSW_LEN]; // [0][..]-password from code file; [1][..]-password from password file
} DATA_BUFFERS;
extern DATA_BUFFERS dat;
Syntax
LONG MSPGANG_GetDataBuffers_ptr(void ** x)
In the application software, the pointer to the data buffer can be initialized as follows.
DATA_BUFFERS *DBuf;
void *temp;
MSPGANG_GetDataBuffers_ptr((&temp));
DBuf = (DATA_BUFFERS *)temp;
Example
Check if the code contents is specified at the MCU location and get the code contents at that location.
int get_code_content( long MCU_addr, BYTE *data )
{
long baddr, MCU_addr;
BYTE data, used_code;
baddr = MSPGANG_Convert_Address( MCU_TO_DATABUF, MCU_addr );
if( baddr >= 0 )
{
if( DBuf->Flag_ScrCode[ baddr ] )
{
*data = DBuf->SourceCode[ baddr ];
return(SUCCESS):
}
else
return(EMPTY_DATA):
}
return(WRONG_MCV_ADDR);
}