-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add support for Renesas RA4M1 and RA6M2 #7063
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
Conversation
9bc7e61
to
43cdd0b
Compare
Thank you for this contribution. It would be a good addition to MicroPython to support Renesas MCUs. I will need to make time to review this since it's a rather large PR. |
43cdd0b
to
3d3ea61
Compare
d0d9323
to
9777f78
Compare
@dpgeorge |
Hi, By the way, could you let us know your estimated time to review this? |
9777f78
to
3a57283
Compare
Sorry I haven't had time to properly look at this yet. I am still very much interested in it and now have a RA4M1 clicker that I can test it on. |
@dpgeorge Thank you very much for your reply and getting RA4M1 clicker. I will keep following the latest update. |
b7d402c
to
2a2e07e
Compare
Could anyone give me some hints how to download the firmware to the RA4M1 Clicker board, under Linux? It has on-board J-link but I can't get JLinkExe to detect the device, and OpenOCD doesn't seem to support this board. |
@dpgeorge We have WIki pages on our GitHub https://github.com/renesas/micropython/wiki . The page https://github.com/renesas/micropython/wiki/How-to-use-MicroPython-for-RA-MCU describes how to program firmware. You can get "J-Link Software and Documentation pack" from https://www.segger.com/downloads/jlink/ . Note that unfortunatelly our on-board J-link has no serial connection support. |
Hi @dpgeorge , I much appreciate it if you could let me know any update about our pull request. If I need to update our port to the latest, please kindly let me know. Thanks. |
I have now managed to get this firmware running on the RA4M1 clicker board, with the REPL on UART at P401/P402. It works very well! After a review of this PR, here are some of the main points I had:
|
2a2e07e
to
9a568c2
Compare
Thank you very much for your review and sorry for the delay in responding.
|
4ea74aa
to
9dadcad
Compare
Codecov Report
@@ Coverage Diff @@
## master #7063 +/- ##
=======================================
Coverage 98.25% 98.25%
=======================================
Files 154 154
Lines 20288 20288
=======================================
Hits 19933 19933
Misses 355 355 Continue to review full report at Codecov.
|
Hello @TakeoTakahashi2020, building for the EK-RA6M2 board was flawless however I can't seem to deploy the firmware.hex file using J-Flash-Lite v7.60b. I built within a docker container (pwd is the root of a clone of the MicroPython repository with this ra-development-v1.14 PR active): docker run -ti --rm -v $(pwd):/code -w /code micropython/build-micropython-arm make -C mpy-cross && make -C ports/renesas-ra submodules && make -C ports/renesas-ra BOARD=RA6M2_EK And tried to deploy the I'm connected to the device over USB (to the DEBUG USB port) and erasing the chip appeared to work (the blinky application running on the EK stopped). I've read the wiki and can't see anything obvious that I've done wrong. Do have any suggestions? |
Hello @mattytrentini san, Thank you for your confirmation and using EK-RA6M2 board. |
fbf4348
to
47681fd
Compare
I have completed the update and testing. I would appreciate it if you could review it again. Thanks. |
- 'extmod/**' | ||
- 'lib/**' | ||
- 'drivers/**' | ||
- 'ports/ra/**' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be /ports/renesas-ra/**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing that out. I have updated.
tests/run-tests.py
Outdated
@@ -472,6 +472,13 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): | |||
for t in tests: | |||
if t.startswith("basics/io_"): | |||
skip_tests.add(t) | |||
elif args.target == "renesas-ra": | |||
skip_tests.add( | |||
"basics/builtin_pow3_intbig.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test works and passes for me on a RA4M1 clicker board, so I think it should be included in the test run (ie this bit here removed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also have confirmed that this test passes on a RA4M1 clicker board. I included it in the test run.
tools/ci.sh
Outdated
function ci_renesas_ra_board_build { | ||
make ${MAKEOPTS} -C mpy-cross | ||
make ${MAKEOPTS} -C ports/renesas-ra submodules | ||
git submodule update --init lib/fsp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this line is needed, the line above ("make submodules") should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing that out. I removed the duplicated submodule update.
ports/renesas-ra/mpconfigport.h
Outdated
#define MICROPY_PY_IO_FILEIO (MICROPY_VFS_FAT || MICROPY_VFS_LFS1 || MICROPY_VFS_LFS2) | ||
#ifndef MICROPY_PY_SYS_PLATFORM // let boards override it if they want | ||
// #define MICROPY_PY_SYS_PLATFORM "pyboard" | ||
#define MICROPY_PY_SYS_PLATFORM "raboard" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this "renesas-ra"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have changed it to "renesas-ra" and checked by sys.platform.
ports/renesas-ra/mpconfigport.h
Outdated
#define RAB_BUILTIN_MODULE /* no module so far */ | ||
#else | ||
#define RAB_BUILTIN_MODULE | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just remove these 5 lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have removed unused RAB_BUILTIN_MODULE.
ports/renesas-ra/modpyb.c
Outdated
STATIC const mp_rom_map_elem_t pyb_module_globals_table[] = { | ||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_pyb) }, | ||
{ MP_ROM_QSTR(MP_QSTR_fault_debug), MP_ROM_PTR(&pyb_fault_debug_obj) }, | ||
#if MICROPY_PY_PYB_LEGACY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these legacy parts of this pyb
module should be removed, they are deprecated and there are other ways to access these methods (eg machine.bootloader()
, machine.freq()
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have remoted them.
// Whether to enable USB support | ||
#ifndef MICROPY_HW_ENABLE_USB | ||
#define MICROPY_HW_ENABLE_USB (0) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see support for USB anywhere in this port, and this config option is not enabled on any board. So I think all USB related things that remain in this port should be removed (eg remove `usb.h').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. I have done.
@@ -0,0 +1,37 @@ | |||
// ra4m1_prefix.c becomes the initial portion of the generated pins file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this file is duplicated 4 times as ra*_prefix.c
. I'd suggest renaming it to ra_pin_prefix.c
and having only one copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have done.
* and/or its licensors ("Renesas") and subject to statutory and contractual protections. | ||
* | ||
* This file is subject to a Renesas FSP license agreement. Unless otherwise agreed in an FSP license agreement with | ||
* Renesas: 1) you may not use, copy, modify, distribute, display, or perform the contents; 2) you may not use any name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This license does not look very friendly to open source. Having this file in this repository seems to contradict this clause (1), that the file may not be used/copied/etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. I have removed board/*/ra and linke to lib/fsp files.
Hello Takeo-san, I've observed an unusual error when importing a file. A minimal example is attached and the error is:
Note the corruption in the REPL. It looks like there may be an overwritten buffer somewhere? The example can be executed with
I've tested the minimal example, without error, on the RP2 (Pico), ESP32 (TinyPICO) and STM32 (WB55) ports. |
Hello Matt-san, Thank you for your report. I will investigate the issue. |
62db8e5
to
09ce2b2
Compare
Hi @dpgeorge san, I have done migration from pyb to machine about Pin, SPI, I2C, UART, ADC, RTC and following updates.
|
My base line is already little old, so I should update it to the latest and push it. I am going to do tomorrow. |
28e52a8
to
bec9e97
Compare
Hi @dpgeorge san, I have updated the base line to the latest and pushed. |
d762042
to
047a935
Compare
Update to the latest. |
70a7ca1
to
b109e7e
Compare
ports/renesas-ra/boards/RA4M1_CLICKER/ra_cfg/fsp_cfg/bsp/bsp_cfg.h
Outdated
Show resolved
Hide resolved
Now that the images are at micropython/micropython-media#18, please remove them from this PR. |
Removing the images which are moved to micropython/micropython-media#18 has done. |
d1b2dc5
to
4691de0
Compare
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
4691de0
to
6d5c2d6
Compare
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
6d5c2d6
to
52add7b
Compare
Thank you very much for the hard work on this, getting it to a state where it can be merged! |
Thank you so much for your strong supports and advices. We are so happy that Renesas RA port is merged. |
Great work guys! |
Great news! |
This pull request adds support for Renesas RA4M1 and RA6M2 MCU as I mentioned in #7034.