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

Refine and fix bugs about firmware update tool and watchdog issue #533

Merged
merged 6 commits into from
Jun 5, 2024

Conversation

huaqianli
Copy link
Collaborator

@huaqianli huaqianli commented Mar 25, 2024

iot2050-firmware-update: Fix bug in class destruction and refactor code
iot2050-module-firmware-update: Add module firmware update
iot2050-eio-manager: Refine the firmware update code
linux: Disable lock-step for all iot2050 boards
u-boot: Disable lock-step mode for all iot2050 boards
firmware-update-package: Add two more default uboot envs


if __name__ == '__main__':
CODE = main(sys.argv[1:])
sys.exit(CODE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing newline at EOF

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ACK and done

# COPYING.MIT file in the top-level directory.
#

DESCRIPTION = "Module Firmware Update Scripts"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is is "Module" in this context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refined

@huaqianli huaqianli force-pushed the lee/after-270 branch 2 times, most recently from da9ac14 to 650ceda Compare March 25, 2024 08:19
# COPYING.MIT file in the top-level directory.
#

DESCRIPTION = "Customized Module(Special DI) Firmware Update Scripts"
Copy link
Collaborator

Choose a reason for hiding this comment

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

At what is "Special DI" now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@huaqianli:

IOT2050 Customized external signal module, such as SM SENS DI. This kind of module is not PLC1200 standard, but "customized" by IOT2050. Hence such module could not be upgraded within the PLC ecosystem, but we have to provide method to support the FW upgrading for them.

@@ -35,6 +35,7 @@ IMAGE_INSTALL += " \
customizations-example \
switchserialmode \
iot2050-firmware-update \
iot2050-module-firmware-update \
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't get the commit message in line with with addition of the "module" update package to the image.

@huaqianli huaqianli force-pushed the lee/after-270 branch 2 times, most recently from 94863b1 to 63ca419 Compare March 26, 2024 03:29
@huaqianli huaqianli force-pushed the lee/after-270 branch 2 times, most recently from 5f17d1a to 68cbe5b Compare April 2, 2024 09:32
@huaqianli huaqianli changed the title [pending to merge to master] firmware update tool and watchdog issue fixes Refine and fix bugs about firmware update tool and watchdog issue Apr 2, 2024
@@ -0,0 +1,87 @@
#!/usr/bin/env python3
Copy link
Collaborator

Choose a reason for hiding this comment

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

First sentence of the commit message seems to lack a verb.

except (IOError, TypeError):
self.firmware = firmware
if not hasattr(firmware, 'read'):
raise UpgradeError("TypeError: firmware must be a file-like object!")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: isinstance(firmware, io.IOBase) would be more accurate.



if __name__ == '__main__':
unittest.main()
Copy link
Collaborator

Choose a reason for hiding this comment

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

When and how will those unit tests be run?

@huaqianli huaqianli force-pushed the lee/after-270 branch 2 times, most recently from e5561dc to 3554601 Compare April 9, 2024 05:47
@huaqianli huaqianli force-pushed the lee/after-270 branch 2 times, most recently from 0563c85 to 59b6935 Compare April 25, 2024 05:34
huaqianli added 4 commits May 30, 2024 15:56
The uboot envs "m2_manual_config" and "watchdog_timeout_ms" should be
preserved during the u-boot firmware update

Signed-off-by: Li Hua Qian <[email protected]>
A PG1 A variant of the iot2050 series has been identified which
partially lacks support for lock-step mode. This implies that not all
iot2050 boards can support this mode. As a result, lock-step mode has
been disabled across all iot2050 boards for consistency and to avoid
potential issues.

Signed-off-by: Li Hua Qian <[email protected]>
The PG1 A variant of the iot2050 series has been identified which
partially lacks support for lock-step mode. This implies that all
iot2050 boards can't support this mode. As a result, lock-step mode has
been disabled across all iot2050 boards for consistency and to avoid
potential issues.

Signed-off-by: Li Hua Qian <[email protected]>
For better compatibility, use bytes instead of path string to transfer
binary, and enhance the code scalability.

Signed-off-by: Li Hua Qian <[email protected]>
huaqianli added 2 commits May 30, 2024 16:30
The IOT2050 features a customized external signal module, such as the
SM SENS DI. Unlike the standard PLC1200, this module is specifically
tailored to the IOT2050's requirements. As a result, it cannot be
upgraded within the conventional PLC ecosystem. However, we ensure to
provide a method to support firmware upgrades for these custom modules.

And the firmware update for the module should not be included with the
image. This is because the image becomes too large and cumbersome to
release when only the update tool needs to be released. Instead, the
module firmware update should be packaged separately in its own
Debian package for a more efficient and manageable release process.

Signed-off-by: Li Hua Qian <[email protected]>
This commit addresses two issues:

1. Fixed two bugs in destruction of classes. It was trying to release a
non-existent object, causing an error. This has been corrected.

2. Removed an unnecessary pattern from the Firmware class. This pattern
was not contributing to the functionality of the class and was causing
confusion. Its removal simplifies the class.

Signed-off-by: Li Hua Qian <[email protected]>
@BaochengSu BaochengSu merged commit 420f203 into master Jun 5, 2024
4 checks passed
@BaochengSu BaochengSu deleted the lee/after-270 branch June 5, 2024 06:33
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