Skip to content
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

Add ethernet support on NUCLEO_H743ZI board #11274

Merged
merged 4 commits into from Aug 22, 2019

Conversation

@VVESTM
Copy link
Contributor

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
}

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant Aug 21, 2019

Contributor

Maybe correct this ?

This comment has been minimized.

Copy link
@VVESTM

VVESTM Aug 21, 2019

Author Contributor

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;

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant Aug 21, 2019

Contributor

Value to check

This comment has been minimized.

Copy link
@VVESTM

VVESTM Aug 21, 2019

Author Contributor

Replaced with correct value (0x1FF1E800)

VVESTM added 3 commits Aug 6, 2019
Add EMAC support for NUCLEO_H743ZI
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 <vincent.veron@st.com>
STM32H7 : update linker script files to use right location for lwip_r…
…am_heap

Signed-off-by: Vincent Veron <vincent.veron@st.com>
lwip: STM32H7: specify heap location
Signed-off-by: Vincent Veron <vincent.veron@st.com>

@VVESTM VVESTM force-pushed the VVESTM:vve_eth_h7 branch from bbd5879 to 93b8164 Aug 21, 2019

@@ -3221,9 +3222,13 @@
"macros_add": [
"STM32H743xx",
"EXTRA_IDLE_STACK_REQUIRED",
"MBED_TICKLESS"
"MBED_TICKLESS",
"ETH_IP_VERSION_V2"

This comment has been minimized.

Copy link
@0xc0170

0xc0170 Aug 21, 2019

Member

cant find this used anywhere in this PR?

This comment has been minimized.

Copy link
@VVESTM

VVESTM Aug 21, 2019

Author Contributor

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

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant Aug 21, 2019

Contributor

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

This comment has been minimized.

Copy link
@0xc0170

0xc0170 Aug 21, 2019

Member

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

This comment has been minimized.

Copy link
@VVESTM

VVESTM Aug 21, 2019

Author Contributor

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.

This comment has been minimized.

Copy link
@kjbracey-arm

kjbracey-arm Aug 21, 2019

Contributor

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").

This comment has been minimized.

Copy link
@LMESTM

LMESTM Aug 21, 2019

Contributor

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)

This comment has been minimized.

Copy link
@VVESTM

VVESTM Aug 21, 2019

Author Contributor

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 ARMmbed/mbed-os-maintainers Aug 21, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Aug 21, 2019

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

@jeromecoutant

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

Move stm32xx_emac_config.h to family specific folder
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 <vincent.veron@st.com>
@0xc0170

This comment has been minimized.

Copy link
Member

commented Aug 21, 2019

CI started

@LMESTM
LMESTM approved these changes Aug 21, 2019
VVESTM added a commit to VVESTM/mbed-os that referenced this pull request Aug 21, 2019
TEST, DO NOT MERGE: debug to reproduce issue ARMmbed#10941
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 <vincent.veron@st.com>
@adbridge

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

restarted

@mbed-ci

This comment has been minimized.

Copy link

commented Aug 21, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Aug 22, 2019

@0xc0170 0xc0170 merged commit d0c917c into ARMmbed:master Aug 22, 2019

25 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8602 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8464B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.