Order of bytes in MACDriver

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
xnr
Posts: 9
Joined: Fri Jul 18, 2014 4:49 pm

Order of bytes in MACDriver

Post by xnr »

I'm trying to implement a MACDriver for a new platform. I am wondering how mac_lld_write_transmit_descriptor is supposed to work regarding byte order. (ChibiOS 2.6.4)

Should a program like this ...

Code: Select all

  uint8_t buf[] = {
               0x01, 0x02, 0x03, 0x04,
               0x05, 0x06, 0x07, 0x08,
               0x09, 0x10, 0x11, 0x12,
               0x13, 0x14, 0x15, 0x16,
               0x17, 0x18, 0x19, 0x20,
  };

  macWriteTransmitDescriptor(tdp, buf, 20);

... lead to a tcpdump (tcpdump -XX) like this:

Code: Select all

0x0000:  0102 0304 0506 0708 0910 1112 1314 1516
0x0010:  1718 1920

? Or should they be changed in any kind?

I'm a bit confused because my mcu expects uint32_t to be written to EthMac and therefore byte orders are very confusing.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Order of bytes in MACDriver

Post by Giovanni »

Hi,

The order looks correct, the descriptor is a stream that writes directly into the frame so the order must be the same.

Giovanni
xnr
Posts: 9
Joined: Fri Jul 18, 2014 4:49 pm

Re: Order of bytes in MACDriver

Post by xnr »

Unfortunately, my output doesn't look that way (yet). But now I know how it should look like. :)

Thanks again for your quick support!
Post Reply