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 interface support (OTA and Watchdog) for Portenta H7 #328

Merged
merged 6 commits into from
Nov 7, 2022

Conversation

@pennam pennam requested review from aentinger and facchinm July 27, 2022 08:12
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #328 (c934b8d) into master (04f41b8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #328   +/-   ##
=======================================
  Coverage   94.87%   94.87%           
=======================================
  Files          27       27           
  Lines        1113     1113           
=======================================
  Hits         1056     1056           
  Misses         57       57           
Impacted Files Coverage Δ
src/property/Property.h 88.88% <0.00%> (ø)
src/property/Property.cpp 88.60% <0.00%> (ø)
src/property/types/CloudString.h 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jul 27, 2022
Copy link
Collaborator

@aentinger aentinger left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Just got a couple of questions and small suggestions.

@@ -61,7 +64,13 @@ int portenta_h7_onOTARequest(char const * ota_url)
watchdog_reset();

/* Download the OTA file from the web storage location. */
int const ota_portenta_qspi_download_ret_code = ota_portenta_qspi.download(ota_url, true /* is_https */);
MbedSocketClass * download_socket = static_cast<MbedSocketClass*>(&WiFi);
#if defined (ARDUINO_PORTENTA_H7_M7)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if this ifdef is really needed? After all, should not this file be only compiled for Portenta H7?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is. The file is compiled also for NICLA VISION that does not have Ethernet. I think the best thing to do here is to rename the file into OTA-stm32-h7.cpp to avoid confusion, but then we need also to rename Arduino_Portenta_OTA library; or make a new library called Arduino_STM32_H7_OTA and deprecate Arduino_Portenta_OTA.

@@ -63,6 +66,11 @@ static void samd_watchdog_reset()
}
}

static void samd_watchdog_enable_network_feed()
{
WiFi.setFeedWatchdogFunc(watchdog_reset);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function works for NINA? Not to say that it does not, I just never saw it before 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we added this function with this PR arduino-libraries/WiFiNINA#186 one year ago

@@ -154,4 +173,13 @@ void watchdog_reset()
mbed_watchdog_reset();
#endif
}

void watchdog_enable_network_feed(bool use_ethernet)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In how far is watchdog_enable_network_feed different from watchdog_enable. What are the advantages of one over the other? I don't think I get it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

watchdog_enable enables the mcu watchdog
watchdog_enable_network_feed enables watchdog kiks/resets during network operations. This was introduced with:

@pennam
Copy link
Collaborator Author

pennam commented Jul 28, 2022

LGTM +1 Just got a couple of questions and small suggestions.

Thanks @aentinger

@pennam
Copy link
Collaborator Author

pennam commented Sep 20, 2022

Cleanup and rebase: c6a12f6 should be dropped before merge.

@pennam
Copy link
Collaborator Author

pennam commented Nov 2, 2022

rebased to resolve conflicts

@arduino-libraries arduino-libraries deleted a comment from github-actions bot Nov 2, 2022
  The implementation is done as for WiFi so we can reuse the same define ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC

  Move watchdog network feed configuration into Watchdog module
  In this way we can also use the more meaningful define BOARD_HAS_ETHERNET
…ernet.h

  In this way we can also use the more meaningful define BOARD_HAS_ETHERNET
  This board is an mbed platform + WiFiNINA so needs special handling for watchdog network feed.
@pennam
Copy link
Collaborator Author

pennam commented Nov 7, 2022

Dropped c6a12f6

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Memory usage change @ fdaac0f

Board flash % RAM for global variables %
arduino:mbed_nano:nanorp2040connect 🔺 0 - +24 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 🔺 0 - +64 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 🔺 +64 - +64 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 🔺 0 - +24 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 🔺 0 - +24 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 🔺 0 - +24 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 0 - +16 0.0 - +0.01 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:mbed_nano:nanorp2040connect 24 0.0 0 0.0 24 0.0 0 0.0 24 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 64 0.0 0 0.0 64 0.0 0 0.0 0 0.0 0 0.0 64 0.0 0 0.0
arduino:mbed_portenta:envie_m7 64 0.01 0 0.0 64 0.01 0 0.0 64 0.01 0 0.0 64 0.01 0 0.0
arduino:samd:mkr1000 24 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrgsm1400 24 0.01 0 0.0 24 0.01 0 0.0 24 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 16 0.01 0 0.0 16 0.01 0 0.0 24 0.01 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 16 0.01 0 0.0 16 0.01 0 0.0 16 0.01 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp8266:esp8266:huzzah 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:mbed_nano:nanorp2040connect,24,0.0,0,0.0,24,0.0,0,0.0,24,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,64,0.0,0,0.0,64,0.0,0,0.0,0,0.0,0,0.0,64,0.0,0,0.0,,,,
arduino:mbed_portenta:envie_m7,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,64,0.01,0,0.0,,,,
arduino:samd:mkr1000,24,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrgsm1400,24,0.01,0,0.0,24,0.01,0,0.0,24,0.01,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrnb1500,16,0.01,0,0.0,16,0.01,0,0.0,24,0.01,0,0.0,0,0.0,0,0.0,,,,
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,16,0.01,0,0.0,16,0.01,0,0.0,16,0.01,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
esp8266:esp8266:huzzah,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,

@arduino-libraries arduino-libraries deleted a comment from github-actions bot Nov 7, 2022
@pennam pennam merged commit 5393437 into arduino-libraries:master Nov 7, 2022
@pennam pennam deleted the portenta-eth branch May 17, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants