Hi! I'm trying to write a serial number to a Cypress FX2 EEPROM. have used the hex2bix method, and it worked great. But my new method i to edit the binary file from the hex2bix, alter the serial number, an upload the new binary file to the FX2 EEPROM.
I can find the serial number okay, and can alter it. But whe writing to the USB device, nothing seems to happen. I have to reset th device to reconnect, but the serial number doesn't change.
Here's the code I'm using to write the binary file.
// First shut down the processor. ResetFX2(1);
FX2Device->ControlEndPt->ReqCode = 0xA0; FX2Device->ControlEndPt->Index = 0; FX2Device->ControlEndPt->Value = 0;
cur_offset = 0; for(cur_line_num = 0; cur_line_num < num_data_file_lines cur_line_num++) { length = num_chars_per_line[cur_line_num]; FX2Device->ControlEndPt->Value = cur_offset; FX2Device->ControlEndPt->Write(data_file_lines[cur_line_num] length); cur_offset += num_chars_per_line[cur_line_num]; }
// Restart the processor. ResetFX2(0);
data_file_lines consists of the lines of data from the tcxmaster.he file. Each line is 256 bytes long (num_chars_per_line confirms this). believe I may not be writing to the board properly (maybe the wron addressing?) I'm not sure what's missing or how to correct it. - Donner