Thanks to visit codestin.com
Credit goes to github.com

Skip to content

renesas-ra: Update FSP to the latest v4.4.0 and modify related files. #11386

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

Merged
merged 3 commits into from
May 11, 2023

Conversation

TakeoTakahashi2020
Copy link
Contributor

@TakeoTakahashi2020 TakeoTakahashi2020 commented May 1, 2023

FSP has been updated to the latest v4.4.0.
This PR is related with the PR #10943 conversation.
I really appreciate it if you could review it @dpgeorge , @iabdalkader, @mbedNoobNinja.

Changes are as follows:

  • Update FSP for renesas-ra to the latest version v4.4.0.
  • Update boards and ra directory files to support FSP v4.4.0.
  • Add a macro definition file and modify Makefile to avoid compile error.
    FSP v4.4.0 refers to CMSIS V5.4.1, and __COMPILER_BARRIER() is used in bsp.
    On the other hand, lib/cmsis is V5.1.0 and the macro is not defined.
    Therefore, compile error happens.
    As the workaround, the macro definition is added.
    If lib/cmsis is updated in the future, this addition can be removed.
  • Add import line to avoid no attribute error on run-tests.py

I have updated as following steps:

  • Used e2 studio 2023-04 + FSP v4.4.0 that was installed by setup_fsp_v4_4_0_e2s_v2023-04.exe on https://github.com/renesas/fsp/releases/tag/v4.4.0.
  • Import previous projects for EK and CLICKER boards.
  • Open configuration.xml in the projct and press Generate Project Content.
  • Replace boards/EK & CLICKER/ra_cfg/* and boards/EK & CLICKER/ra_gen/* with generated files.
  • Update some renesas-ra/ra/*.[ch] to support FSP v4.4.0.
  • Prepared boards/compiler_barrier.h and modify Makefile to avoid compile errors.
  • Build & test.
  • I needed to modify tools/pyboard.py to avoid AttributeError: module 'serial' has no attribute 'tools' error.
  • FInally executed tools/codeformat.py for modified files.

@github-actions
Copy link

github-actions bot commented May 1, 2023

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
        rp2:    +0 +0.000% PICO

@codecov-commenter
Copy link

Codecov Report

Merging #11386 (c5c60c3) into master (7fa322a) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master   #11386   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files         156      156           
  Lines       20611    20611           
=======================================
  Hits        20273    20273           
  Misses        338      338           

@iabdalkader
Copy link
Contributor

Looks good, thanks! I also had to fix the missing compiler barrier when testing v4.0.0.

@dpgeorge
Copy link
Member

dpgeorge commented May 2, 2023

Thanks for doing this @TakeoTakahashi2020 .

Are all the generated files needed? @iabdalkader mentioned before that he thinks only the ISR vector code is needed.

@TakeoTakahashi2020
Copy link
Contributor Author

@dpgeorge san, Thank you for pointing that out. I will check some more details to see if there are any files that can be deleted.

@iabdalkader
Copy link
Contributor

Hi, I tested all the changes (in this PR, on top of the other PR and my USB/board support in #11405) and things seem to work fine, well at least for RA6M5, I will do more testing once everything is merged. Thanks @TakeoTakahashi2020 .

@TakeoTakahashi2020
Copy link
Contributor Author

@iabdalkader san, Thank you very much for the test and I am very happy to see your PR to support Portenta C33. I am still checking and testing if there are any files that can be deleted. I need a little more time.

@TakeoTakahashi2020
Copy link
Contributor Author

TakeoTakahashi2020 commented May 4, 2023

Are all the generated files needed? @iabdalkader mentioned before that he thinks only the ISR vector code is needed.

@dpgeorge san, I have finished checks and tests.
Many of the generated files were related to clocks and FSP instances, and it was not possible to remove them on a per-file basis without modifying the files. Replacing was the easiest way to update the FSP.

However, some header files could be removed by editing some c-source files to remove unreferenced instances. This reduces RAM usage 360 bytes (for RA4M1_CLICKER), 312 bytes (for EK-RA4M1), 468 bytes (for EK-RA4W1), 648 bytes (for EK-RA6M1), 744 bytes (for EK-RA6M2 ) .

Also I have removed the unreferenced board_init.c and board_leds.c from the Makefile. This was already reported in #10943 by @iabdalkader .

@TakeoTakahashi2020
Copy link
Contributor Author

TakeoTakahashi2020 commented May 8, 2023

@dpgeorge san, I have recognized that tools/pyboard.py serial import issue had been fixed on 0264465.
So I believe my change is not needed fot it. Please let me know if I should rebase this PR to the latest without my change for pyboard.py. I will be happy to do it.

@dpgeorge
Copy link
Member

dpgeorge commented May 9, 2023

@TakeoTakahashi2020 this PR looks quite good now. Thanks for removing the unnecessary files.

So I believe my change is not needed fot it. Please let me know if I should rebase this PR to the latest without my change for pyboard.py. I will be happy to do it.

Yes, if you rebase you can leave out that commit.

And, are you happy to squash the following two commits together:

  • renesas-ra: Update boards and ra directory files to support FSP v4.4.0.
  • renesas-ra: Remove unreferenced files and instances.
    ?

@TakeoTakahashi2020
Copy link
Contributor Author

@dpgeorge san, OK, I will rebase this and squash the two.

* Update boards and ra files
* Remove unreferenced files, board_init.c and board_leds.c, from Makefile
* Remove unreferenced FSP instances from ra_gen/*.[ch]
* Remove unreferenced FSP config files ra_cfg/*.h
* e2 studio generates FSP instances but renesas-ra uses only followings:
  lpm, flash, ioport

Signed-off-by: Takeo Takahashi <[email protected]>
FSP v4.4.0 refers to CMSIS V5.4.1, and __COMPILER_BARRIER() is used in bsp.
On the other hand, lib/cmsis is V5.1.0 and the macro is not defined.
Therefore, compile error happens.
As the workaround, the macro definition is added.
If lib/cmsis is updated in the future, this addition can be removed.

Signed-off-by: Takeo Takahashi <[email protected]>
@TakeoTakahashi2020
Copy link
Contributor Author

Rebase and squash are completed.

@dpgeorge dpgeorge merged commit 3229791 into micropython:master May 11, 2023
@dpgeorge
Copy link
Member

Thanks @TakeoTakahashi2020 !

@TakeoTakahashi2020
Copy link
Contributor Author

Thank you @dpgeorge san.

@TakeoTakahashi2020 TakeoTakahashi2020 deleted the ra-development-update branch May 29, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants