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

Fix to ICC communication between the amc and amc2c board #491

Merged
merged 7 commits into from
Apr 16, 2024

Conversation

marcoaccame
Copy link
Contributor

@marcoaccame marcoaccame commented Apr 11, 2024

This PR fixes the ICC communication mode between the amc and amc2c board that was not correctly working.

In details

The ICC introduced in #474 has stopped working. Only the CAN is working. That is probably due to recent additions to the features of the amc2c board that further reduce its idle time and prevent teh ICC communication mode to work effectively because the reduced CPU time is used by other threads. The ICC requires a tight handshaking between the CM7 (amc) and teh CM4 (amc2c) because for each communication a thread on each core is locked until teh other unlocks teh shared resource.

CAN is less demanding as it uses a HW peripheral.

The solution was to rise the priority of the COMM thread in the amc2c as well as the IRQ priority of the HSEM interrupt handler.

This PR also contains some other changes:

  • enabling / disabling of reading of the Vin power supply voltage by measn of a BSP macro;
  • improvement of the use of either ICC or CAN commnication. Now the ICC or CAN mode can be switched across two launches of YRI (as long as you change teh xml files) w/out restarting the board.

Tests

I have tested the change on the lego setup and it works.
Tested also on ergoCub SN002. It works.

Linked PRs

The binaries:

…e and current w/ EMBOT_ENABLE_hw_analog_ish

the amcbldc uses the same EMBOT_ENABLE_hw_analog_ish but its undefinition does not stop the used HW
now we can switch one to another at each launch of YRI by simply changing the xml file and there is
no need to restart the board as before. to put the previous behavior define COMM_BUS_LOCKED_AT_FIRST_MC_RECEPTION
- increased priority of COMM thread so that the CM4 gets / sends messages as early as possible from CM7
- increased priority of HSEM1_IRQn and HSEM2_IRQn so that the chain IRQ handler, rxICC / txICC threads is executed
  faster and the CM7 is unlocked earlier
none is 8 fast blinks
ICC is one medium blink
CAN is two medium blinks
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.

1 participant