Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

STI5518 Firmware modification

Status
Not open for further replies.

chandra

Newbie level 6
Newbie level 6
Joined
Feb 15, 2005
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,401
I read the firmware by jtag from a working STB with STI5518 chip.I want to add a Uart protocal at the firmware. The protocal is as follows:

int SSSP_DoCommand07(void)
{
char szFront[16];
unsigned char ucaReply[32];
unsigned short wLen;
int i, j, k, nErrorCnt;
DWORD dwWriteSize, dwReadSize;
unsigned char *p;
DWORD ident;

s_dwActiveFrequency = s_dwCurrentFrequency;

s_ucaUARTWriteBuffer[0] = 0x07;
s_ucaUARTWriteBuffer[1] = 0x06;
s_ucaUARTWriteBuffer[2] = (s_wCurrentDegree >> 8) & 0xFF;
s_ucaUARTWriteBuffer[3] = (s_wCurrentDegree >> 0) & 0xFF;
s_ucaUARTWriteBuffer[4] = (s_dwCurrentFrequency >> 8) & 0xFF;
s_ucaUARTWriteBuffer[5] = (s_dwCurrentFrequency >> 0) & 0xFF;
s_ucaUARTWriteBuffer[6] = (s_wCurrentServiceID >> 8) & 0xFF;
s_ucaUARTWriteBuffer[7] = (s_wCurrentServiceID >> 0) & 0xFF;

p = &s_ucaUARTWriteBuffer[0];
s_ucaUARTWriteBuffer[8] = p[0] ^ p[1] ^ p[2] ^ p[3] ^ p[4] ^ p[5] ^ p[6] ^ p[7];
STUART_Flush(s_SerialHandle);
STUART_Write(s_SerialHandle, s_ucaUARTWriteBuffer, 9, &dwWriteSize, 500);
for (j = 0;j < 1; j++) {
s_ucWaitStatus = 1;
ucaReply[0] = 0x00;
dwReadSize = 0;
for (k = 0; k < 10; k++) {
STUART_Read(s_SerialHandle, &ucaReply[0], 1, &dwReadSize, 100);
if (dwReadSize == 1) break;
if (s_ucSSSPStatus == 0) break;
}
s_ucWaitStatus = 0;
if (k >= 10) return -2;
if ( (dwReadSize != 1) || (ucaReply[0] != 0xF7)) {
sprintf(szFront, "F%03d", dwReadSize);
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
return -1;
}
STUART_Read(s_SerialHandle, &ucaReply[1], 18, &dwReadSize, 1000);
if (dwReadSize == 18) {
p = &ucaReply[3];
nErrorCnt = 0;
if ((p[3] != ((p[0]+p[1]+p[2]) & 0xFF))) nErrorCnt |= 0x01;
if ((p[7] != ((p[4]+p[5]+p[6]) & 0xFF))) nErrorCnt |= 0x02;
if ((p[11] != ((p[8]+p[9]+p[10]) & 0xFF))) nErrorCnt |= 0x04;
if ((p[15] != ((p[12]+p[13]+p[14]) & 0xFF))) nErrorCnt |= 0x08;
if (nErrorCnt == 0) {
if (memcmp(s_ucaOldCW, &ucaReply[3], 16) != 0) {
sprintf(szFront, "SETK");
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
Descrypt(&ucaReply[3], &ucaReply[3+8], 0);
} else {
sprintf(szFront, "NOSE");
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
}
memcpy(s_ucaOldCW, &ucaReply[3], 16);
return 0;
} else {
sprintf(szFront, "E%d%02d", nErrorCnt, dwReadSize);
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
return -1;
}
} else {
sprintf(szFront, "F%03d", dwReadSize);
szFront[4] = (char)(0xff);
FRONT_PrintData(szFront);
return -1;
}
}

return -1;
}

=============================

How can I add this.
I have the bin file of this protocal also.
I dissassemble the STB flash bin file.Then where to add?
Anybody can help me.
 

Hi chandra,
Unfortunately I can't answer your question, but I want to ask you the other one. I'm new in digital TV, trying to understand how work digital set-top-box. In level of schematic circuit I already understand working process of STB. Now I'd would like to understand software level. Could you please suggest me some books or articles about STB firmware or STB programing.

Many thanks :)
 

Hi, Could you please tell which software did you use to read firmware from STi5518, and Can I write firmware into STi5518 by same software.

Thanks.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top