Skip to content

Conversation

vrsanskytom
Copy link

The goal of this PR is to support the case when STM32 MCU is connected through MII/RMII with fixed link parameters. For example, in more complex systems where FMU is connected directly to ethernet switch, which is not mastered by STM through MDIO bus. In this case, the link parameters are defined in board definition file.

Copy link
Contributor

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to conform to the way ChibiOS configures things

maccr = ETH->MACCR;

/* Fixed link connection defined in board.h.*/
#if !defined(BOARD_PHY_FIXED_LINK)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think what you need to do is add a config item to hal_mmc_lld.h, something like:

/**
 * @brief   <docs in here>
 */
#if !defined(STM32_MAC_PHY_FIXED_LINK) || defined(__DOXYGEN__)
#define STM32_MAC_PHY_FIXED_LINK FALSE
#endif
/**
 * @brief   <docs in here>
 */
#if !defined(STM32_MAC_PHY_FIXED_LINK_TYPE) || defined(__DOXYGEN__)
#define STM32_MAC_PHY_FIXED_LINK_TYPE LINK_100_FULLDUPLEX
#endif

and then adjust the source appropriately for these

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made accordingly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I will ping the ChibiOS guys

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@magicrub
Copy link
Contributor

@vrsanskytom Can you give an example of the connectivity here? Which switch are you testing this on?

@vrsanskytom
Copy link
Author

@vrsanskytom Can you give an example of the connectivity here? Which switch are you testing this on?

Sure, please take a look at following diagram, describing our board architecture. Onboard FMU is the device running on STM which is a subject of this issue.

https://docs.airvolute.com/dronecore-autopilot/dcs2/.pilot-boards/dcs2.pilot-v-1.0/peripherals

We are using ethernet switch from microchip KSZ family, but this will be common issue for all switches not mastered by STM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants