Skip to content

Add ethernet support on NUCLEO_H743ZI board #11274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 22, 2019
Merged

Conversation

VVESTM
Copy link
Contributor

@VVESTM VVESTM commented Aug 21, 2019

Description

This pull request adds ethernet support on STM32 H7 platform.
It is based on the STM32 emac driver. As the H7 HAL is slightly different, I have added ETH_IP_VERSION_V2 switch. This has to be included in targets.json.

Work is based on @CurryGuy job and STM32 cube examples.

Tests done with this command (on IAR, ARM and GCC_ARM toolchains) :
mbed test -t IAR -m NUCLEO_H743ZI -v -n testsnetsocket

Pull request type

[ ] Fix
[ ] Refactor
[X] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@jeromecoutant @LMESTM

*(.ethusbram)

} >RAM_D2 AT> FLASH
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe correct this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -475,6 +817,8 @@ void mbed_default_mac_address(char *mac)
uint32_t word0 = *(uint32_t *)0x1FFF7A10;
#elif defined (TARGET_STM32F7)
uint32_t word0 = *(uint32_t *)0x1FF0F420;
#elif defined (TARGET_STM32H7)
uint32_t word0 = *(uint32_t *)0x1FF0F420;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Value to check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with correct value (0x1FF1E800)

VVESTM added 3 commits August 21, 2019 11:40
This port is based on :
    * CurryGuy ethernet branch :
        https://github.com/CurryGuy/mbed-os/tree/feature-stm32h7-emac
    * STM32 Cube example :
        Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS example

Signed-off-by: Vincent Veron <[email protected]>
@@ -3221,9 +3222,13 @@
"macros_add": [
"STM32H743xx",
"EXTRA_IDLE_STACK_REQUIRED",
"MBED_TICKLESS"
"MBED_TICKLESS",
"ETH_IP_VERSION_V2"
Copy link
Contributor

Choose a reason for hiding this comment

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

cant find this used anywhere in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used in features/netsocket/emac-drivers/TARGET_STM_EMAC/stm32xx_emac.cpp file. Used to differentiate H7 specific parts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because github doesn't expand all files by default :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

I've missed that file ! I can see now. Wouldn't the config be better for this or ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You prefer to add this compilation switch in an other file ? Which one do you have in mind ? (features\netsocket\emac-drivers\TARGET_STM_EMAC\mbed_lib.json for example ?)

I need this switch to be activated for only H7 platform for now. Then, if this new hal is deployed on other platform, we will need to activate it also for those new platforms.

Copy link
Contributor

@kjbracey kjbracey Aug 21, 2019

Choose a reason for hiding this comment

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

This location seems correct to me - the target descriptor passing information to its drivers about which mode to select. (As long as the option is describing something concrete about the target, that is conceptually not locked to any particular driver implementation - so we mean this target has "V2 hardware" or "V2 HAL").

Copy link
Contributor

Choose a reason for hiding this comment

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

you may move the stm32xx_emac_config.h file to the family specific folder and add this option there. this way you could tune the IP version per family (and later the thread stack size if needed)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code updated with @LMESTM solution. Effectively, user is not supposed to change this setting so the .json file can be misunderstanding.
Thanks all for comments and propositions !

@ciarmcom ciarmcom requested review from a team August 21, 2019 11:00
@ciarmcom
Copy link
Member

@VVESTM, thank you for your changes.
@ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@jeromecoutant
Copy link
Collaborator

@ARMmbed/team-st-mcd @MarceloSalazar @facchinm

This allows to specify which hal version to use for each family.
It can also be used to modify the thread stack size.

Signed-off-by: Vincent Veron <[email protected]>
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2019

CI started

VVESTM added a commit to VVESTM/mbed-os that referenced this pull request Aug 21, 2019
makes UDPSOCKET_ECHOTEST_BURST_NONBLOCK and UDPSOCKET_ECHOTEST_BURST failed.

In the trace, we see only UDPSOCKET_ECHOTEST_BURST_NONBLOCK failed. For
UDPSOCKET_ECHOTEST_BURST, we have :
  Packets sent: 22, packets received 0, loss ratio 1.00
  >>> 'UDPSOCKET_ECHOTEST': 1 passed, 0 failed

Reproduced on NUCLEO_H743ZI (with PR ARMmbed#11274) and also with K64F board :
  mbed test -t IAR -m K64F -v -n tests*netsocket*udp*

Signed-off-by: Vincent Veron <[email protected]>
@adbridge
Copy link
Contributor

restarted

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit d0c917c into ARMmbed:master Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants