Sending data from RAM to USB
#2
Ok, so for your error:


pr_CommandErr = 0x02 ; command error (bad structure, etc.)

This means that you are not passing the correct data as a command.

Note the description of the command 0xA9:

Code:
(Command.b, Payload Length.b, RAM_Offset.l, TransferLength.l, Checksum.b)
    0xA9          0x08         0x????????     0x????????          0x??

This command sends the data from on-board 512K static RAM to the USB port, using the offset
into RAM and the transfer length.

The payload data contains the RAM offset and the transfer length, both as longwords in big endian
format.

The RAM offset or transfer length can be an odd value.  After all data has been transferred, a response packet is then returned

Note: Unlike all other functions, the response packet is sent after all of the data has been
received.

Typically, people forget that the RAM offset and transfer length are in BIG endian format.   You should be able to send this hex string command to test the command:

0xA9 0x08 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0xFC

That will transfer 0x00000100 (256 bytes) of data from location 0x00000000 in the RAM to the USB port.  Immediately after the 256 bytes of data will be 0xA9 0x4F as the response code.

Let me know if you have any issues!
Reply


Messages In This Thread
Sending data from RAM to USB - by dfstudios - 01-18-2016, 02:41 PM
RE: Sending data from RAM to USB - by admin - 01-18-2016, 03:04 PM
RE: Sending data from RAM to USB - by dfstudios - 01-18-2016, 04:18 PM
RE: Sending data from RAM to USB - by admin - 01-18-2016, 09:54 PM
RE: Sending data from RAM to USB - by dfstudios - 01-19-2016, 02:31 PM
RE: Sending data from RAM to USB - by admin - 01-19-2016, 08:32 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 01:59 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 02:45 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 03:23 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:30 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:36 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:31 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:35 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:47 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:41 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:50 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:44 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:52 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 05:02 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 05:04 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 05:36 PM



Users browsing this thread: 1 Guest(s)