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 allow absolute CAN bit rate error #298

Closed
wants to merge 0 commits into from
Closed

Conversation

fastbike
Copy link
Contributor

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Apr 29, 2024
@per1234 per1234 linked an issue Apr 29, 2024 that may be closed by this pull request
@fastbike
Copy link
Contributor Author

fastbike commented Apr 29, 2024

It looks like some of the samples for the Portenta board errored out. I could look at these later today.

@per1234
Copy link
Collaborator

per1234 commented Apr 30, 2024

Thanks for your attention to the results of the continuous integration example sketch compilations @fastbike!

The compilation failure for the Portenta C33 board:

/home/runner/Arduino/hardware/arduino-git/renesas/libraries/Arduino_CAN/src/R7FA6M5_CAN.cpp: In member function 'virtual bool arduino::R7FA6M5_CAN::begin(CanBitRate)':
/home/runner/Arduino/hardware/arduino-git/renesas/libraries/Arduino_CAN/src/R7FA6M5_CAN.cpp:153:120: error: cannot convert 'const CanBitRate' to 'uint32_t {aka long unsigned int}' for argument '1' to 'std::tuple<bool, long unsigned int, long unsigned int, long unsigned int> util::calc_can_bit_timing(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)'
     util::calc_can_bit_timing(can_bitrate, F_CAN_CLK_Hz, TQ_MIN, TQ_MAX, TSEG_1_MIN, TSEG_1_MAX, TSEG_2_MIN, TSEG_2_MAX);
                                                                                                                        ^

Is not caused by the changes made in this pull request. The regression point is at 06bbfea from your previous pull request #296.

I'm sure it would be a welcome contribution if you wanted to investigate and submit a fix.

@aentinger
Copy link
Contributor

aentinger commented Apr 30, 2024

I'm sure it would be a welcome contribution if you wanted to investigate and submit a fix.

A single cast is needed ;)

@fastbike
Copy link
Contributor Author

OK, I will see if I can find time tonight :)

@fastbike
Copy link
Contributor Author

fastbike commented May 1, 2024

Is not caused by the changes made in this pull request. The regression point is at 06bbfea from your previous pull request #296.

I'm sure it would be a welcome contribution if you wanted to investigate and submit a fix.

How can I run the tests before submitting a PR ?
Do I just open the example projects in the IDE for the other controller and compile ?

@per1234
Copy link
Collaborator

per1234 commented May 1, 2024

How can I run the tests before submitting a PR ?

If you enable GitHub Actions in your fork, the compilations will run automatically every time you push a commit to your fork that modifies a relevant file.

I'll provide instructions you can follow to enable GitHub Actions:

  1. Open the homepage of your fork in the browser:
    https://github.com/fastbike/ArduinoCore-renesas
  2. Click the "Actions" tab at the top of the page.
  3. Click the I understand my workflows, go ahead and enable them button.

Do I just open the example projects in the IDE for the other controller and compile ?

You can do that. Make sure to select Tools > Board > Arduino Renesas Portenta Boards > Arduino Portenta C33 from the Arduino IDE menus, and that your modifications are present in the "Arduino_CAN" library used by that board (which by default is under a different path than the library used by the UNO R4 boards since this repository is split into two separate platforms ("Arduino UNO R4 Boards", "Arduino Renesas Portenta Boards") for distribution, each platform with its own copy of the "Arduino_CAN" library.

Ideally you would install the ArduinoCore-renesas repository locally as an Arduino boards platform so that you can test within the full context, but that is a bit complicated to do (especially since the developers haven't provided documentation for the procedure) and probably not necessary in this particular case where you are only modifying the library code.

@aentinger
Copy link
Contributor

If possible, @fastbike I'd prefer to have a separate PR fixing the regression for C33. Can you do this? If it's too much a bother please give me a ping and I shall fix it, it's a simple fix.

@aentinger aentinger force-pushed the main branch 2 times, most recently from af26f8d to 30f0467 Compare May 3, 2024 08:42
@aentinger
Copy link
Contributor

Hi @fastbike ☕ 👋

I've fixed the regression concerning the Portenta C33 in #300. Furthermore I have rebased your branch on ArduinoCore-renesas:main so that the fix is now included.

Important: Before you do anything, run the following command on your end: git pull origin main --rebase.

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: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CAN bit rate enhancement
3 participants