platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.71k stars 783 forks source link

Add support for Renesas MCUs #4028

Open babanazar opened 2 years ago

babanazar commented 2 years ago

Add support for Renesas MCUs/boards

Charragh commented 2 years ago

No Renesas boards are supported in PlatformIO yet. I hope Renesas boards will be supported in the future.

I had a discussion about this in the community: https://community.platformio.org/t/platfromio-doesnt-support-renesas-platforms-yet/26096

ivankravets commented 2 years ago

Please vote (šŸ‘) for the issue clicking on the "smile" icon in the comment above.

Charragh commented 2 years ago

done

ivankravets commented 2 years ago

Sorry, I meant thumb up šŸ‘ (icon) šŸ˜‚

Charragh commented 2 years ago

done

Kubson320 commented 1 year ago

Is it planned to add support for DA14683 and other chips?

briandilley commented 1 year ago

I'm wondering how feasible this is given smart snippets.

jayemar commented 1 year ago

DA14699 would also be helpful in order to support the DA14699-00HRDB-P development board.

vshymanskyy commented 1 year ago

@ivankravets as Arduino is releasing Portenta C33 and UNO R4, please consider adding these boards.

runger1101001 commented 1 year ago

And the UNO R4 is now out :-) The UNO R4 WiFi looks like a pretty cool board actually. The R4 Minima is also a big upgrade on the R3 in terms of the MCU.

The C33 uses a R7FA6M5BH2CBG (Cortex M33) The UNO R4s use the R7FA4M1AB3CFM (Cortex M4)

All are already supported in Arduino IDE, so have working arm-gcc toolchains.

What needs to be done to get them supported? Is it on the roadmap?

lmolter54 commented 1 year ago

FWIW, even the Arduino 2.1.0 IDE can't upload to the board yet. Go figure. You have to use the antiquated 1.8.13 IDE. Not me. I'll wait either for PIO or 2.1.x of their IDE.

LYB030 commented 1 year ago

FWIW, even the Arduino 2.1.0 IDE can't upload to the board yet. Go figure. You have to use the antiquated 1.8.13 IDE. Not me. I'll wait either for PIO or 2.1.x of their IDE.

the ide 2.1.1 has solve the problem

maxgerhardt commented 1 year ago

I got my Arduino Uno R4 Minima and Uno R4 WiFi today so I used 5 hours of my time to create the PlatformIO integration for that: https://github.com/maxgerhardt/platform-renesas

You can install it per the "Usage" instructions in the readme and then create new projects for the R4 Minima, R4 WiFi and Portenta C33 in the regular "New Project" wizard. Device drivers are here. Example projects for each board are provided too.

grafik grafik

Debugging is not yet possible. Uploading works.

I'm happy to hand this over to @ivankravets after it has been developed properly.

runger1101001 commented 1 year ago

Wow, thanks so much @maxgerhardt that's great news!

Your efforts are really greatly appreciated! I'm going to try to switch my UNO R4 project over to PlatformIO tomorrow.

runger1101001 commented 1 year ago

I couldn't wait until tomorrow. It's working for me on OS X. :-)

vshymanskyy commented 1 year ago

@maxgerhardt it works (on Linux)! I was able to use all 3 boards with Blynk.NCP: https://github.com/blynkkk/BlynkNcpExample

image

Thanks for your time and effort

LYB030 commented 1 year ago

I got my Arduino Uno R4 Minima and Uno R4 WiFi today so I used 5 hours of my time to create the PlatformIO integration for that: https://github.com/maxgerhardt/platform-renesas

You can install it per the "Usage" instructions in the readme and then create new projects for the R4 Minima, R4 WiFi and Portenta C33 in the regular "New Project" wizard. Device drivers are here. Example projects for each board are provided too.

grafik grafik

Debugging is not yet possible. Uploading works.

I'm happy to hand this over to @ivankravets after it has been developed properly.

omg,what a amazing news!

ivankravets commented 1 year ago

@maxgerhardt, thanks for the MVP! I've just created a new repository https://github.com/platformio/platform-renesas-ra and we will be back soon with updates.

LYB030 commented 1 year ago

I got my Arduino Uno R4 Minima and Uno R4 WiFi today so I used 5 hours of my time to create the PlatformIO integration for that: https://github.com/maxgerhardt/platform-renesas

You can install it per the "Usage" instructions in the readme and then create new projects for the R4 Minima, R4 WiFi and Portenta C33 in the regular "New Project" wizard. Device drivers are here. Example projects for each board are provided too.

grafik grafik

Debugging is not yet possible. Uploading works.

I'm happy to hand this over to @ivankravets after it has been developed properly.

image

got error show by vscode,but upload and build all works fine

maxgerhardt commented 1 year ago

Let's discuss that in https://github.com/maxgerhardt/platform-renesas/issues/1 and let's avoid long quote replies.

Edit: Above intellisense issue was resolved.

maxgerhardt commented 1 year ago

Update: I figured out that the Uno R4 WiFi's ESP32-S3 bridge / coprocessor is not only a USB-Serial bridge for the Renesas, but also has CMSIS-DAP functionality compiled in. Thus, we can do debugging with on-board tools!

SVD are also added so we can look at all peripheral registers :)

grafik

vshymanskyy commented 1 year ago

So. Looks like we'll have to provide a custom build of Blynk.NCP for this... At some point :rofl:

valeros commented 1 year ago

Hi guys, we've added an initial support for the Renesas hardware here https://github.com/platformio/platform-renesas-ra. Currently, there are only several boards available though the Arduino framework. Please keep in mind we couldn't test it thoroughly as we don't have any of this hardware at hand, so your feedback is very welcome.

Many thanks @maxgerhardt for the initial research and hints!

vshymanskyy commented 1 year ago

I was able to port the CDC Bridge and DAP functionality to Blynk.NCP. Looks working fine so far, including the debugger! This will require a separate NCP build/variant for UNO R4 WiFi, but Iā€™m ok with that (it was needed anyway)

maxgerhardt commented 1 year ago

After some work, the official platform-renesas version 0.0.2 version now has all functionality and bugfixes that my original platform has, so now there's no point in using my version anymore. I've renamed and archived my original repo. Please use platform = renesas-ra@0.0.2 as the stable official platform instead :)

Thanks to the PlatformIO team, @vshymanskyy and @LYB030 for developing and testing the platform, now we have something stable to work from!

vshymanskyy commented 1 year ago

To those interested in using both ESP32 and Renesas chips: https://github.com/vshymanskyy/UNO-R4-WiFi-freedom

image

elral commented 1 year ago

We have a project which also uses servos. Porting from Mega/Uno to the new Uno R4 was mostly successful, but it seems that the servo library is missing.

Additionally strlcpy(...) is missing compared to Mega/Uno/Nano, but this is no big issue as I can add it.

vshymanskyy commented 1 year ago

Please report such kind of bugs directly to Arduino

maxgerhardt commented 1 year ago

Servo library does support Renesas and is right here: https://github.com/arduino-libraries/Servo/releases and PlatformIO also has it as regular lib_deps = arduino-libraries/Servo@1.2.1. Missing strlcpy is either a toolchain bug or a configuration issue (e.g., may need to define _GNU_SOURCE, _BSD_SOURCE, ..)

elral commented 1 year ago

Servo library does support Renesas and is right here: https://github.com/arduino-libraries/Servo/releases and PlatformIO also has it as regular lib_deps = arduino-libraries/Servo@1.2.1.

Ohmg, my simple fault :(

Missing strlcpy is either a toolchain bug or a configuration issue (e.g., may need to define _GNU_SOURCE, _BSD_SOURCE, ..)

Hmhm, seems I have to look around.

Thanks for help!

maxgerhardt commented 1 year ago

Yeah, a short exploration into string.h shows

grafik

So adding to the platformio.ini

build_flags = -D_BSD_SOURCE

enables the declaration of that and it links fine.

MuhdZamwani commented 10 months ago

FWIW, even the Arduino 2.1.0 IDE can't upload to the board yet. Go figure. You have to use the antiquated 1.8.13 IDE. Not me. I'll wait either for PIO or 2.1.x of their IDE.

the ide 2.1.1 has solve the problem

I have same problem, can't upload my code to board even com was detected and I use platformio in vscode. Do i have to use arduino ide instead of platformio?

maxgerhardt commented 10 months ago

Did you install the drivers?

MuhdZamwani commented 10 months ago

Did you install the drivers?

Not yet. How I can install it into my platformio?

maxgerhardt commented 10 months ago

You don't install them into PlatformIO, you install them in your operating system. Those are Windows drivers, after all. You could e.g. install them by downloading the entire repo as a ZIP file (https://github.com/arduino/ArduinoCore-renesas/archive/refs/heads/main.zip), unpacking it and executing the drivers/dpinst-amd64.exe.

It's also handy that you can boot your board into bootloader mode by quickly pressing the reset button twice on it. After the driver installation, there should be no "unknown devices" in the Windows device manager, neither in bootloader mode nor in regular mode.

MuhdZamwani commented 10 months ago

You don't install them into PlatformIO, you install them in your operating system. Those are Windows drivers, after all. You could e.g. install them by downloading the entire repo as a ZIP file (https://github.com/arduino/ArduinoCore-renesas/archive/refs/heads/main.zip), unpacking it and executing the drivers/dpinst-amd64.exe.

It's also handy that you can boot your board into bootloader mode by quickly pressing the reset button twice on it. After the driver installation, there should be no "unknown devices" in the Windows device manager, neither in bootloader mode nor in regular mode.

I done install the driver and press reset on the board, but I still get no device found on COM3. I done uninstall and install arduino 2.2.1

maxgerhardt commented 10 months ago

Boot the device into bootloader mode. Are there multiple COM ports in the device manager? Maybe it just picks the wrong one of two.

MuhdZamwani commented 10 months ago

Its already work after I boot into bootloader mode. But I still dont get it, why could happen like that after I upload my code that have SSL certificate? Can you explain to me please? For future reference.