- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to provide some interface to a user to download a rpd file into the chip.
So I some questions What format of a rpd-file? byte-sized UTF-8 or may be some extended format like UTF-16? I write with Avalon-MM - it ofers a single word 32-bit (4 bytes) write - so what endianess of a rpd file? First I read all bytes
byte raw_data = File.ReadAllBytes(burn_file_path);
And then I send all bytes over a serial port
for (int i = 0; i < raw_data.Length; i+=4)
{
word_to_write = (UInt32)((raw_data << 24) | (raw_data << 16) | (raw_data << 8) | raw_data);
msg = WRITE_WORD + " " + word_to_write.ToString();
comport.Write(msg);
progressBarBurnProgress.Value = i;
response = ReadComPort(100, 10);
if (response != ACK)
{
MessageBox.Show("Wrong response!");
return;
}
}
So the question is - this way
word_to_write = (UInt32)((raw_data << 24) | (raw_data << 16) | (raw_data << 8) | raw_data);
or this
word_to_write = (UInt32)((raw_data << 24) | (raw_data << 16) | (raw_data << 8) | raw_data[i);
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page