Wrestling with MAC on F107 Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: Wrestling with MAC on F107

Post by avrhack »

Hopefully you're still intending to put this simple fix into the next 16.1x Giovanni?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrestling with MAC on F107

Post by Giovanni »

Sure, I am rebuilding a demo for it, it is missing after 2.6.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrestling with MAC on F107

Post by Giovanni »

Hi,

I committed fixes in subversion trunk, could you confirm it is working for you before I backport it to 16.1?

thanks,
Giovanni
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: Wrestling with MAC on F107

Post by avrhack »

Giovanni wrote:Hi,

I committed fixes in subversion trunk, could you confirm it is working for you before I backport it to 16.1?

thanks,
Giovanni


I use git so my testing isn't 100% conclusive, but I've reverted my patched version which causes the compilation to fail as before, then I've taken your new version of hal_mac_lld.c from r9970.

I then had to change its name to mac_lld.c (did you change the names?) and also change the include of hal_mii.h back to mii.h.

Once those hacks are done, my project compiles once again against 16.1.5 with no other changes apart from the missing CAN includes which you've already fixed as bug 772.

So from my perspective it looks like your fix is fine thanks, but hard to tell using only this one file changes as there seem to be some other structural changes around file names that I had to work around.

Hope that helps.....
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrestling with MAC on F107

Post by Giovanni »

I will port the fix back to 16.1.6 and make the changes to names.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrestling with MAC on F107

Post by Giovanni »

Hi,

I committed the change to the 16.1.x branch too:

svn://svn.code.sf.net/p/chibios/svn/bra ... ble_16.1.x

Fixed as bug #798.

Giovanni
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: Wrestling with MAC on F107

Post by avrhack »

So whilst searching I came across this thread that I started 4 years ago LOL!

I'm now working on the same F107 board with an RMII connection to the KSZ8863 3-port 10/100 switch and have changed to using i2c so I can access all the switch registers, which of course now means the LWIP code will no longer work as the PHY is not found.

Giovanni I presume there's not been any change around this ie allowing a fixed MAC config that causes the driver to ignore the PHY and work as permanently 'link up' and with a fixed duplex / speed setting in the MACCR?

If not I guess I'll just have to hack my own into the ChibiOS source code although I really hate doing that for obvious maintainability reasons!

Thanks......
User avatar
kimmoli
Posts: 26
Joined: Sat Oct 01, 2016 8:02 pm
Has thanked: 11 times
Been thanked: 8 times

Re: Wrestling with MAC on F107

Post by kimmoli »

I overrided the MAC driver with a copy under project directory so had not to touch ChibiOS code.
you'll need to copy the platform.mk to your project directory and set Makefile to use it. In platform.mk change the MAC driver to point your modified version driver.mk or something like that.

I used Marvell switch, and there was a chicken-egg issue - STM32 does not flush MAC buffers without RMII clock, and Marvell didn't provide clock before it has been enabled over SMI. Flush was done really early in the initialisation.

And another thing was that force link up thingy.
Last edited by kimmoli on Sat Nov 21, 2020 10:20 pm, edited 1 time in total.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Wrestling with MAC on F107

Post by Giovanni »

There has been no such change.

Giovanni
Post Reply