- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Trouble in Verify Security. Can someone give me support for CY8C20446A. Wich address I have to use in READ-SECURITY-1 and READ-SECURITY-3? There are particular settings? Thank you for your time.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you kindly check if you are broadly following this: --------------------------------------------------------------------------------------------------------------------------------------------------------------- // ============================================================================ // fReadSecurity() // This reads from SM0 with Read Supervisory SPC command. // Need to have SPC Test Mode enabled before using these commands? // Returns: // 0 if successful // __________ if timed out on handshake to the device. // ============================================================================ signed char fReadSecurity(void) { SendVector(read_security_setup, num_bits_read_security_setup); bTargetAddress = 0x00; while(bTargetAddress < (SECURITY_BYTES_PER_BANK * 2)) { // we do SECURITY_BYTES_PER_BANK * 2 because we bTargetAddress += 2 // TSYNC Enable SendVector(tsync_enable, num_bits_tsync_enable); SendVector(read_security_pt1, num_bits_read_security_pt1); // Set the drive here because SendByte() does not. SetSDATAStrong(); SendByte(bTargetAddress,7); // hardcode MSb of address as 0 in bit stream SendVector(read_security_pt1_end, num_bits_read_security_pt1_end); // TSYNC Disable SendVector(tsync_disable, num_bits_tsync_disable); SendVector(read_security_pt2, num_bits_read_security_pt2); SendVector(wait_and_poll_end, num_bits_wait_and_poll_end); SendVector(read_security_pt3, num_bits_read_security_pt3); SetSDATAStrong(); SendByte(bTargetAddress,7); SendVector(read_security_pt3_end, num_bits_read_security_pt3_end); SendVector(wait_and_poll_end, num_bits_wait_and_poll_end); bTargetAddress +=2; } bTargetAddress = 0x00; bTargetDataPtr = 0x00; SendVector(tsync_enable, num_bits_tsync_enable); // part of updates from CDT60310 while(bTargetAddress < (SECURITY_BYTES_PER_BANK * 2)) { // we do SECURITY_BYTES_PER_BANK * 2 because we bTargetAddress += 2 //Send Read Byte vector and then get a byte from Target SendVector(read_byte_v, 4); // Set the drive here because SendByte() does not SetSDATAStrong(); SendByte(bTargetAddress,7); RunClock(2); // Run two SCLK cycles between writing and reading SetSDATAHiZ(); // Set to HiZ so Target can drive SDATA bTargetDataIN = bReceiveByte(); RunClock(1); SendVector(read_byte_v + 1, 1); // Send the ReadByte Vector End // Test the Byte that was read from the Target against the original // value (already in the 128-Byte array "abTargetDataOUT[]"). If it // matches, then bump the address & pointer,loop-back and continue. // If it does NOT match abort the loop and return and error. if (bTargetDataIN != abTargetDataOUT[bTargetDataPtr]) return(BLOCK_ERROR); // Increment the address by two to accomodate 7-Bit addressing // (puts the 7-bit address into MSBit locations for "SendByte()"). bTargetDataPtr++; bTargetAddress += 2; } SendVector(tsync_disable, num_bits_tsync_disable); // part of updates from CDT60310 return(PASS); } ----------------------------------------------------------------------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you kindly check if you are broadly following this:
signed char fReadSecurity(void)
{
SendVector(read_security_setup, num_bits_read_security_setup);
bTargetAddress = 0x00;
while(bTargetAddress < (SECURITY_BYTES_PER_BANK * 2)) { // we do SECURITY_BYTES_PER_BANK * 2 because we bTargetAddress += 2
// TSYNC Enable
SendVector(tsync_enable, num_bits_tsync_enable);
SendVector(read_security_pt1, num_bits_read_security_pt1);
// Set the drive here because SendByte() does not.
SetSDATAStrong();
SendByte(bTargetAddress,7); // hardcode MSb of address as 0 in bit stream
SendVector(read_security_pt1_end, num_bits_read_security_pt1_end);
// TSYNC Disable
SendVector(tsync_disable, num_bits_tsync_disable);
SendVector(read_security_pt2, num_bits_read_security_pt2);
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
SendVector(read_security_pt3, num_bits_read_security_pt3);
SetSDATAStrong();
SendByte(bTargetAddress,7);
SendVector(read_security_pt3_end, num_bits_read_security_pt3_end);
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
bTargetAddress +=2;
}
bTargetAddress = 0x00;
bTargetDataPtr = 0x00;
SendVector(tsync_enable, num_bits_tsync_enable); // part of updates from CDT60310
while(bTargetAddress < (SECURITY_BYTES_PER_BANK * 2)) { // we do SECURITY_BYTES_PER_BANK * 2 because we bTargetAddress += 2
//Send Read Byte vector and then get a byte from Target
SendVector(read_byte_v, 4);
// Set the drive here because SendByte() does not
SetSDATAStrong();
SendByte(bTargetAddress,7);
RunClock(2); // Run two SCLK cycles between writing and reading
SetSDATAHiZ(); // Set to HiZ so Target can drive SDATA
bTargetDataIN = bReceiveByte();
RunClock(1);
SendVector(read_byte_v + 1, 1); // Send the ReadByte Vector End
// Test the Byte that was read from the Target against the original
// value (already in the 128-Byte array "abTargetDataOUT[]"). If it
// matches, then bump the address & pointer,loop-back and continue.
// If it does NOT match abort the loop and return and error.
if (bTargetDataIN != abTargetDataOUT[bTargetDataPtr])
return(BLOCK_ERROR);
// Increment the address by two to accomodate 7-Bit addressing
// (puts the 7-bit address into MSBit locations for "SendByte()").
bTargetDataPtr++;
bTargetAddress += 2;
}
SendVector(tsync_disable, num_bits_tsync_disable); // part of updates from CDT60310
return(PASS);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great i need also information about it and will be happy if i will find something great here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Me too 🙂