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

Firmwareupdater – Add support for other processes on multi-core boards #850

Merged
merged 6 commits into from
Feb 9, 2023

Conversation

sgiraz
Copy link
Contributor

@sgiraz sgiraz commented Dec 29, 2022

What's new:

main changes

  • EthMaintainer now uses the new eOuprot_cmd_DISCOVER_REPLY2_t to parse the reply coming from the AMC multi-core family boards.
  • A new uprot_OPC_DISCOVER2 help the processDiscoveryReplies2 to discriminate the parsing strategy, maintaining the back-compatibility with the existing ones.
  • prepareMoreInfoText now parses the info contained in the extraprocesses when they exist.

minor changes

  • Align all the cmake_minimum_required to VERSION 3.12
  • A new Erase Application button is visible when running the Firmwareupdate with the administrator privileges (-a)
  • Add a new warning (⚠️) icon to the dialog window when we try to discover the CAN boards through ETH boards that are running the default application
  • Add some useful comments in EthUpdater.cpp
  • Remove previous existing warnings ⚠️:
    • Resolve some todos simplifying the code
    • Remove unused dead code
    • Fix indentation
    • Fix comparisons between different naive types

Notes:

  • tested with: EMS4, AMC, AMCBLDC
  • The Erase Application is currently a work in progress, so at the moment it does nothing (it is disabled by default)

cc @pattacini @marcoaccame @mfussi66 @davidetome

@@ -1001,6 +1008,8 @@ void MainWindow::onAppendInfo(boardInfo2_t info,eOipv4addr_t address)
infoTreeWidget->addTopLevelItem(bootStrapNode);
infoTreeWidget->addTopLevelItem(propertiesNode);

constexpr uint8_t maxNumberOfProcessesOnSingleCore {3};
Copy link
Contributor

@marcoaccame marcoaccame Jan 13, 2023

Choose a reason for hiding this comment

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

I can see that later on we have a switch(info.boardtype) where it is missing the case of amc.
Some comments:

  • the string name in here is wrongly obtained by a switch case and we don't have amc. That is a wrong implementation. Because there is another mode of obtaining the string and is by using the relevant function eoboards_type2string() inside icub-firmware-shared. We should stick to this latter otherwise we duplicated code and we shall surely forget to change the code in here when new boards come along.
  • At the same mode, if we want to know if the board has two cores, it is wise to add a function inside icub-firmware-shared. Something as: eoboards_type2numberofcores().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed (partially?) in f0b7ded

@@ -815,8 +866,8 @@ std::string EthMaintainer::processMoreInfoReplies(EthBoardList &boardlist)

while(mSocket.ReceiveFrom(rxipv4addr, rxipv4port, mRxBuffer, sizeof(mRxBuffer), 500) > 0)
{
eOuprot_cmd_MOREINFO_REPLY_t *moreinfo = (eOuprot_cmd_MOREINFO_REPLY_t*) mRxBuffer;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a memo to myself for later: so in here we don't need / manage a eOuprot_cmd_MOREINFO2_REPLY_t, or do we?.

@@ -1066,6 +1115,112 @@ std::string EthMaintainer::prepareMoreInfoText(eOuprot_cmd_DISCOVER_REPLY_t * di
return info;
}

std::string EthMaintainer::prepareMoreInfoText(eOuprot_cmd_DISCOVER_REPLY2_t * disc, const char *ipv4rxaddr_string)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a memo to myself: have a look at that.

@@ -22,6 +22,7 @@ const int EthUpdater::partition_UPDATER = uprot_partitionUPDATER;
#define PRINT_DEBUG_INFO_ON_TERMINAL


// TODO: check here if it is called and when (it seems that it's never called)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a check to myself: Is this code called by the FirmwareUpdater?

- Resolve some todos simplifying the code
- Remove unused dead code
- Fix indentation
- Fix comparisons between different naive types
- These changes allow the `FirmwareUpdater` to discover and update the processes running on multicore boards such as the `AMC` boards family
- replace `else if` instead of `if` in `EthMaintainer` for `uprot_OPC_DISCOVER2`
- get the string type of a board using the convert function instead of checking manually the `info.boardtype` structure.
@marcoaccame
Copy link
Contributor

marcoaccame commented Feb 9, 2023

Hi @sgiraz, I will merge these two linked PRs:

and you should put this PR in ready to review state.

@pattacini: the PR is ok by me

Copy link
Contributor

@marcoaccame marcoaccame left a comment

Choose a reason for hiding this comment

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

ok by me

@pattacini pattacini marked this pull request as ready for review February 9, 2023 14:48
@pattacini
Copy link
Member

Awaiting the CI before merging.

@pattacini
Copy link
Member

pattacini commented Feb 9, 2023

CI failed, @sgiraz. Could you please have a look at the report?

Version of dependencies used:

    ycm_version: 0.15.1
    yarp_version: 3.7.2
    icub_firmware_shared_branch: v1.29.0

@pattacini pattacini merged commit 3ed8557 into robotology:devel Feb 9, 2023
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.

4 participants