eldarkg / emdr1986x-std-per-lib

Milandr MCU 1986x Standard Peripherals Library. Mirror:
https://code.launchpad.net/~eldar/emdr1986x-std-per-lib/+git/emdr1986x-std-per-lib
46 stars 29 forks source link

ETH_SendFrame works incorrectly #41

Open Amomum opened 6 years ago

Amomum commented 6 years ago

The reason, as far as I can tell, is the following. Text in the specification says:

Передатчик начинает работать, прочитав ненулевое поле длины из буфера передатчика. ... Прочитав слово управления, передатчик перемещает указатель head_X на первое слово пакета данных.

So first data word in the ethernet buffer should be data length (in bytes, as far as I can tell from working code example).

However, ETH_SendFrame does not put frame length as first word in ethernet buffer, it just copies the frame. So first byte of the frame is interpreted as it's length which is incorrect most of the time.

It's more or less straight-forward to fix this for ETH_BUFFER_MODE_LINEAR and ETH_BUFFER_MODE_AUTOMATIC_CHANGE_POINTERS but I'm not sure how to do it for ETH_BUFFER_MODE_FIFO.

eldarkg commented 6 years ago

I don't use ethernet. Are anybody can to help in this issue?

eldarkg commented 6 years ago

@Amomum Can we close this issue?

Amomum commented 6 years ago

I'm not sure. Auto and FIFO modes are still broken. Maybe put it in low-priority?

eldarkg commented 6 years ago

@Amomum I understood you

eldarkg commented 5 years ago

@Amomum Can you check the new commit https://github.com/eldarkg/emdr1986x-std-per-lib/commit/e5992182bbf28c9d1782f4aac6f74631b707c6f4 PS I reset your previous commits (use original library files). If you need to fix them add a new pull request. Thank you