Giter Site home page Giter Site logo

platformio / platform-renesas-ra Goto Github PK

View Code? Open in Web Editor NEW
10.0 6.0 4.0 347 KB

Renesas RA: development platform for PlatformIO

Home Page: https://registry.platformio.org/platforms/platformio/renesas-ra

License: Apache License 2.0

Python 100.00%
arduino platformio platformio-platform renesas renesas-ra

platform-renesas-ra's Introduction

Renesas RA: development platform for PlatformIO

Build Status

Renesas Advanced (RA) 32-bit microcontrollers with the Arm Cortex-M33, -M23 and -M4 processor cores deliver key advantages compared to competitive Arm Cortex-M MCUs by providing stronger embedded security, superior CoreMark performance and ultra-low power operation.

  • Home (home page in the PlatformIO Registry)
  • Documentation (advanced usage, packages, boards, frameworks, etc.)

Usage

  1. Install PlatformIO
  2. Create PlatformIO project and configure a platform option in platformio.ini file:

Stable version

[env:stable]
platform = renesas-ra
board = ...
...

Development version

[env:development]
platform = https://github.com/platformio/platform-renesas-ra.git
board = ...
...

Configuration

Please navigate to documentation.

platform-renesas-ra's People

Contributors

ivankravets avatar maxgerhardt avatar myselfandjo avatar valeros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

platform-renesas-ra's Issues

JLink Device Names wrong

Per https://community.platformio.org/t/arduino-portenta-c33-jlink-flash-problem/37346

"mcu": "r7fa6m5bh2cbg",
"variant": "PORTENTA_C33"
},
"debug": {
"jlink_device": "R7FA6M5",

device name should be R7FA6M5BH per https://www.segger.com/supported-devices/search/R7FA6M5

"jlink_device": "ra4m1",

"jlink_device": "ra4m1",

should be R7FA4M1AB per https://www.segger.com/supported-devices/search/RA4M1

Uno R4 Minima upload doesn't work

CURRENT: upload_protocol = dfu
CURRENT: upload_protocol = dfu
"C:\Users\Max\.platformio\packages\tool-dfuutil\bin\dfu-util" -d 0x2341:0x0069,0x2341:0x0369 -a 0 -s 0x4000:leave -D "C:\Users\Max\Desktop\ren\example\.pio\build\uno_r4_minima\firmware.bin"
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
Device ID 2341:0369
Device DFU version 0101
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 0101
Warning: DfuSe option used on non-DfuSe device
Device returned transfer size 64
DfuSe interface name: "CodeFlash "
Downloading element to address = 0x00004000, size = 70240

Erase           [                         ]   0%            0 bytes
Erase           [=                        ]   4%         2816 bytes
Erase           [==                       ]   8%         5632 bytes
Erase           [===                      ]  12%         8448 bytes
Erase           [====                     ]  16%        11264 bytes
Erase           [=====                    ]  20%        14080 bytes
Erase           [======                   ]  24%        16896 bytes
Erase           [=======                  ]  28%        19712 bytes
Erase           [========                 ]  32%        22528 bytes
Erase           [=========                ]  36%        25344 bytes
Erase           [==========               ]  40%        28096 bytes
Erase           [===========              ]  44%        30912 bytes
Erase           [============             ]  48%        33728 bytes
Erase           [=============            ]  52%        36544 bytes
Erase           [==============           ]  56%        39360 bytes
Erase           [===============          ]  60%        42176 bytes
Erase           [================         ]  64%        44992 bytes
Erase           [=================        ]  68%        47808 bytes
Erase           [==================       ]  72%        50624 bytes
Erase           [===================      ]  76%        53440 bytes
Erase           [====================     ]  80%        56192 bytes
Erase           [=====================    ]  84%        59008 bytes
Erase           [======================   ]  88%        61824 bytes
Erase           [=======================  ]  92%        64640 bytes
Erase           [======================== ]  96%        67456 bytes
Erase           [=========================] 100%        70240 bytes
Erase    done.

Download        [                         ]   0%            0 bytes

Then it hangs forever.

Likely this is becuase

  1. The wrong dfu-util version is used, it really really needs that one referenced in https://downloads.arduino.cc/packages/package_index.json ("version": "0.11.0-arduino5", "name": "dfu-util"). PlatformIO built in one has problems on some systems (maxgerhardt/platform-renesas-old-dontuse#2)
  2. The -s 0x4000:leave syntax does not work (with the one from the Arduino IDE)
  3. -Q flag is not given for final reset (like Arduino IDE does)

Intellisense issue on some systems

Per maxgerhardt/platform-renesas-old-dontuse#1 (comment).

Magically on this user's system, the c_cpp_properties.json gets wrongly generated with missing path seperator character:
On my old platform:

grafik

On this current-version version platform:

 "compilerArgs": [ "-mcpu=cortex-m4", "-mfloat-abi=hard", "-mfpu=fpv4-sp-d16", "-mthumb", "-iprefixC:Users94837.platformiopackagesframework-arduinorenesas-uno", "@C:Users94837.platformiopackagesframework-arduinorenesas-unovariantsUNOWIFIR4includes.txt", "" ]

I have no idea how that's possible since it does work on my Windows 10, x64, system:

            "compilerPath": "C:/Users/Max/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe",
            "compilerArgs": [
                "-mcpu=cortex-m4",
                "-mfloat-abi=hard",
                "-mfpu=fpv4-sp-d16",
                "-mthumb",
                "-iprefixC:/Users/Max/.platformio/packages/framework-arduinorenesas-uno",
                "@C:/Users/Max/.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4/includes.txt",
                ""
            ]

I pushed a countermeasure for this, that is, in the __idedata phase, don't return -iprefix <prefx> @<file>, but actually expand out all include paths: https://github.com/maxgerhardt/platform-renesas/blob/bc8d2f1ae4d0a8507dbee06861a884293c0d83a2/builder/frameworks/arduino/mbed-core/arduino-core-mbed.py#L157-L179

According to the user, the problem remained present even after reinstalling everything and trying it on a different computer. Might be issues with specific character encoding sets, e.g. Chinese? I have no idea real idea though. They had the exact same VSCode version, C/C++ extension version, PlatformIO core and PlatformIO extension version as me.

`ARDUINO_ARCH_RENESAS_UNO` is not defined

The original Arduino core defines ARDUINO_ARCH_{build.arch}, which leads to ARDUINO_ARCH_RENESAS_UNO being defined:

-DARDUINO=10607 -DARDUINO_UNOWIFIR4 -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE

In PlatformIO, this definition is missing:

-DPLATFORMIO=60110 -DARDUINO_UNOWIFIR4 -DARDUINO_UNOR4_WIFI -DNO_USB -DBACKTRACE_SUPPORT -DLWIP_DNS=1 -DCFG_TUSB_MCU=OPT_MCU_RAXXX -DNO_OTA_NETWORK -D_RA_CORE=CM4 -D_RENESAS_RA_ -DARDUINO=10810 -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE

This is already in use by some libraries and code examples: https://github.com/search?q=ARDUINO_ARCH_RENESAS_UNO&type=code

Simple sketch using LED matrix doesn't work. void loop() is never called

Hello,

I tried to write some code on Arduino UNO R4 WiFi and it desn't work. I was debugging code and it seems that after enabling timer irq it is invoked all the time so program cannot go to loop function. But I'm not sure that is the case here.

code:

#include <Arduino.h>
#include <Arduino_LED_Matrix.h>

ArduinoLEDMatrix matrix;

uint32_t frame1 [3] =
{
  0,
  0,
  0
};

uint32_t frame2[3] =
{
  UINT32_MAX,
  UINT32_MAX,
  UINT32_MAX
};


void setup() {
  Serial.begin(115200);
  matrix.begin();
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  matrix.loadFrame(frame2);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  matrix.loadFrame(frame1);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

the same code works fine in newest Arduino IDE 2.2.1

Linking errors with Arduino IoT Cloud

Consider the platformio.ini

[env:portenta_c33]
platform = renesas-ra
board = portenta_c33
framework = arduino
lib_ldf_mode = deep+
lib_deps =
	arduino-libraries/ArduinoIoTCloud@^1.13.0

with src/* files from https://github.com/arduino-libraries/ArduinoIoTCloud/tree/1.13.0/examples/ArduinoIoTCloud-Basic.

Compilation will go through, but linking will fail, complaining about double-defined symbols with libnosys.a and the "Storage" library, which also wants to implement _write, _read, et cetera.

.pio/build/portenta_c33/libbf8/libStorage.a(storage_retarget.cpp.o): In function `_close':
storage_retarget.cpp:(.text._close+0x0): multiple definition of `_close'
/home/zak/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard/libnosys.a(close.o):close.c:(.text._close+0x0): first defined here
.pio/build/portenta_c33/libbf8/libStorage.a(storage_retarget.cpp.o): In function `_write':
storage_retarget.cpp:(.text._write+0x0): multiple definition of `_write'
/home/zak/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard/libnosys.a(write.o):write.c:(.text._write+0x0): first defined here
.pio/build/portenta_c33/libbf8/libStorage.a(storage_retarget.cpp.o): In function `_read':
storage_retarget.cpp:(.text._read+0x0): multiple definition of `_read'
/home/zak/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard/libnosys.a(read.o):read.c:(.text._read+0x0): first defined here
.pio/build/portenta_c33/libbf8/libStorage.a(storage_retarget.cpp.o): In function `_lseek':
storage_retarget.cpp:(.text._lseek+0x0): multiple definition of `_lseek'
/home/zak/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard/libnosys.a(lseek.o):lseek.c:(.text._lseek+0x0): first defined here

While it does compile just fine in the Arduino IDE.

I've recorded the Arduino IDE linker commands here. Noticable differences:

  • no --specs=nano.specs in Arduino IDE`, but PIO has it
  • missing -nostdlib in PIO during C/C++ files compilation but present during linking
  • missing -Wl,--whole-archive -Wl,--start-group [..] -Wl,--no-whole-archive -Wl,--end-group missing in PIO

Trying to patch that in, especially with

env.Prepend(_LIBFLAGS="-Wl,--whole-archive  -Wl,--start-group ")
env.Append(_LIBFLAGS=" -Wl,--no-whole-archive -lfsp -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group ")

in the arduino.py scirpt results.. in diferent kind of linking errors, in lwip.

Linking .pio\build\portenta_c33\firmware.elf
C:\Users\Max\.platformio\packages\framework-arduinorenesas-portenta\libraries\lwIpWrapper\src\cortex-m33\liblwIP.a(fsdata.o):(.rodata.file__index_html+0x0): multiple definition of `file__index_html'
C:\Users\Max\.platformio\packages\framework-arduinorenesas-portenta\libraries\lwIpWrapper\src\cortex-m33\liblwIP.a(fs.o):(.rodata.file__index_html+0x0): first defined here
C:\Users\Max\.platformio\packages\framework-arduinorenesas-portenta\libraries\lwIpWrapper\src\cortex-m33\liblwIP.a(fsdata.o):(.rodata.file__404_html+0x0): multiple definition of `file__404_html'
C:\Users\Max\.platformio\packages\framework-arduinorenesas-portenta\libraries\lwIpWrapper\src\cortex-m33\liblwIP.a(fs.o):(.rodata.file__404_html+0x0): first defined here
C:\Users\Max\.platformio\packages\framework-arduinorenesas-portenta\libraries\lwIpWrapper\src\cortex-m33\liblwIP.a(fsdata.o):(.rodata.file__img_sics_gif+0x0): multiple definition 
of `file__img_sics_gif'
C:\Users\Max\.platformio\packages\framework-arduinorenesas-portenta\libraries\lwIpWrapper\src\cortex-m33\liblwIP.a(fs.o):(.rodata.file__img_sics_gif+0x0): first defined here      
c:/users/max/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard\libc.a(lib_a-fini.o): In function `__libc_fini_array':
fini.c:(.text.__libc_fini_array+0x26): undefined reference to `_fini'
collect2.exe: error: ld returned 1 exit status

whatever the case may be, something is causing this to not build correctly in PIO while it does work in the Arduino IDE.

cannot compile with -flto flag

I get build errors as soon as I add -flto to the build flags.

I was also able to reproduce the issue on the arduino-blink example

Just adding

build_flags = -flto

makes the build fail with:

arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/msc/msc_host.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/net/ecm_rndis_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/net/ncm_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/usbtmc/usbtmc_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/vendor/vendor_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/vendor/vendor_host.c.o: plugin needed to handle lto object
.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4/libs/libfsp.a(startup.o): In function `Reset_Handler':
/ssd/products-Eslov/FW/MainPrograms/hardware/arduino-git/renesas/extras/e2studioProjects/Santiago/Debug/../ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c:67: undefined reference to `main'

I was able to use the flag when going back to v1.2.0
like this:

platform = [email protected]

Thank you

RTC.begin() deadlocks processor

See arduino/ArduinoCore-renesas#88.

The Arduino framework code has a bug / undefined behavior in which the RTClass::begin() function, when compiled by the here used ARM GCC 10.3.1. produces wrong assembly in such a way that it causes an infinite loop at the is_initialized = false statement. Calling RTC.begin(); is a game-over.

Broke a user trying to use an Arduino IoT sketch with the Uno R4 WiFi at https://community.platformio.org/t/cant-connect-to-arduino-iot-cloud-with-platformio/35087.

This either needs a minimal package update with just the patch or (sadly) a downgrade of the compiler version to exactly match the Arduino IDE's behavior (7.0.1). In the last case I cannot however guarantee whether a certain set of compiler / optimization switches also ends up producing the wrong assembly code in 7.0.1.

Cannot upload to the board

Having such issues uploading a "Blink" example on Ubuntu Linux:

Board\Core renesas-ra (develop) maxgerhardt official from Arduino IDE
R4 Minima OK OK OK
R4 WiFi name 'basename' is not defined.
OK after fixing builder/main.py
OK OK
Portenta C33 OK OK OK

@ivankravets @valeros

Usage fault when executing code complied with GCC 10 but not with GCC 7

The following example causes a usage fault when built with GCC 10, but reverting back to GCC 7 fixes the problem. The fault occurs when executing the 2nd delay in loop(), or directly thereafter.

#include  < Arduino.h >
#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

void setup() {
    Serial.begin(115200);
    matrix.begin();
}

const uint32_t happy[] = {
        0x19819,
        0x80000001,
        0x81f8000
};
const uint32_t heart[] = {
        0x3184a444,
        0x44042081,
        0x100a0040
};

void loop(){
    matrix.loadFrame(happy);
    delay(500);
    matrix.loadFrame(heart);
    delay(500);
}

with platformio.ini

[env:uno_r4_wifi]
platform = renesas-ra
;platform = https://github.com/platformio/[email protected]
board = uno_r4_wifi
framework = arduino

and stack trace:

Firmware name: PROJECT_NAME, compiled on: Oct 10 2023
Fault on interrupt or bare metal(no OS) environment
===== Thread stack information =====
  addr: 20007ec0    data: 00000000
  addr: 20007ec4    data: 0000a500
  addr: 20007ec8    data: ffffffff
  addr: 20007ecc    data: 40046f00
  addr: 20007ed0    data: 00000000
  addr: 20007ed4    data: 0000440f
  addr: 20007ed8    data: 200009e8
  addr: 20007edc    data: 00006d89
  addr: 20007ee0    data: 0000d29c
  addr: 20007ee4    data: 00006dcf
  addr: 20007ee8    data: 0000d29c
  addr: 20007eec    data: 0000ce43
  addr: 20007ef0    data: 0000d29c
  addr: 20007ef4    data: 0000a8ff
  addr: 20007ef8    data: 0000a8f5
  addr: 20007efc    data: 00002599
====================================
=================== Registers information ====================
  R0 : 00000001  R1 : 0007a120  R2 : ffffffff  R3 : 0000416d
  R12: 00000003  LR : 00006e3f  PC : 200000b4  PSR: 20000000
==============================================================
Usage fault is caused by attempts to switch to an invalid state (e.g., ARM)
Show more call stack info by run: addr2line -e PROJECT_NAME.elf -a -f 200000b4 00006e3e 0000440e 00006d88 00006dce 0000ce42 0000a8fe 0000a8f4

and addr2line:

0x200000b4
__bss_start__
.//SynologyDrive/Documents/MCU/projects/Arduino Uno R4 Wifi/src/main.cpp:18
0x00006e3e
delay
.//.platformio/packages/framework-arduinorenesas-uno/cores/arduino/time.cpp:9
0x0000440e
setup
.//SynologyDrive/Documents/MCU/projects/Arduino Uno R4 Wifi/src/main.cpp:22
0x00006d88
_Z12arduino_mainv
.//.platformio/packages/framework-arduinorenesas-uno/cores/arduino/main.cpp:117 (discriminator 1)
0x00006dce
atexit
.//.platformio/packages/framework-arduinorenesas-uno/cores/arduino/main.cpp:139
0x0000ce42
main
.//.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4/tmp_gen_c_files/main.c:7
0x0000a8fe
Reset_Handler
/ssd/products-Eslov/FW/MainPrograms/hardware/arduino-git/renesas/extras/e2studioProjects/Santiago/Debug/../ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c:67
0x0000a8f4
Reset_Handler
/ssd/products-Eslov/FW/MainPrograms/hardware/arduino-git/renesas/extras/e2studioProjects/Santiago/Debug/../ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c:62

Uno R4 WiFi library doesn't build

With example main.cpp from https://github.com/maxgerhardt/platform-renesas/blob/main/examples/arduino-uno-r4-wifi-wifi-scan/src/main.cpp and

[env]
platform = https://github.com/platformio/platform-renesas-ra.git
framework = arduino
monitor_speed = 115200

[env:uno_r4_wifi]
board = uno_r4_wifi
lib_ldf_mode = deep+
C:\Users\Max\.platformio\packages\framework-arduinorenesas-uno\libraries\WiFiS3\src\Modem.cpp:270:33: error: 'D24' was not declared in this scope; did you mean 'D4'?
  270 |   ModemClass modem = ModemClass(D24,D25);
      |                                 ^~~
      |                                 D4
C:\Users\Max\.platformio\packages\framework-arduinorenesas-uno\libraries\WiFiS3\src\Modem.cpp:270:37: error: 'D25' was not declared in this scope; did you mean 'D15'?
  270 |   ModemClass modem = ModemClass(D24,D25);
      |                                     ^~~
      |                                     D15
Archiving .pio\build\uno_r4_wifi\libFrameworkArduinoVariant.a
Compiling .pio\build\uno_r4_wifi\FrameworkArduino\SerialObj3.cpp.o
*** [.pio\build\uno_r4_wifi\libf36\WiFiS3\Modem.cpp.o] Error 1
Indexing .pio\build\uno_r4_wifi\libFrameworkArduinoVariant.a
=========== [FAILED] Took 3.94 seconds ===========

This is because the JSON board definition for the Uno R4 WiFi is missing an identifying macro, Obvious give-away:

grafik

So -DARDUINO_UNOWIFIR4 is missing in the Uno R4 WiFi's extra_flags.

Build flags missing /wrong from Arduino

Reference platform.txt: https://github.com/arduino/ArduinoCore-renesas/blob/1.0.1/platform.txt

Example PlatformIO invocation:

arm-none-eabi-g++ -o .pio\build\uno_r4_minima\FrameworkArduino\api\Print.cpp.o -c -Waggregate-return -Wall -Wconversion -Wextra -Wfloat-equal -Wlogical-op -Wmissing-declarations -Wpointer-arith -Wshadow -Wuninitialized -Wunused -fdata-sections -ffunction-sections -fmessage-length=0 -fsigned-char -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -iprefixC:\Users\Max.platformio\packages\framework-arduinorenesas-uno @C:\Users\Max.platformio\packages\framework-arduinorenesas-uno\variants\MINIMA\includes.txt -w -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPLATFORMIO=60108 -DARDUINO_UNOR4_MINIMA -DLWIP_DNS=1 -DCFG_TUSB_MCU=OPT_MCU_RAXXX
-D_RA_CORE=CM4 -D_RENESAS_RA_ -DARDUINO=10810 -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -DF_CPU=48000000L -IC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\cores\arduino\tinyusb -IC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\cores\arduino -IC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\cores\arduino\api\deprecated -IC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\cores\arduino\api\deprecated-avr-comp -IC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\variants\MINIMA C:\Users\Max.platformio\packages\framework-arduinorenesas-uno\cores\arduino\api\Print.cpp

Example Arduino IDE invocation:

"C:\Users\Max\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -c -w -Os -g3 -fno-use-cxa-atexit -fno-rtti -fno-exceptions -MMD -nostdlib -DF_CPU=48000000 -DARDUINO_UNOR4_MINIMA -MMD -std=gnu++17 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsigned-char -ffunction-sections -fdata-sections -fmessage-length=0 -fno-builtin -DARDUINO=10819 "-DPROJECT_NAME="C:\Users\Max\AppData\Local\Temp\arduino_build_350766/Blink.ino"" -DARDUINO_MINIMA -DARDUINO_ARCH_RENESAS_UNO -DARDUINO_ARCH_RENESAS -DARDUINO_FSP -D_XOPEN_SOURCE -mthumb "@C:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\variants\MINIMA/defines.txt" -DCFG_TUSB_MCU=OPT_MCU_RAXXX "-IC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1/cores/arduino/tinyusb" "-IC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino/api/deprecated" "-IC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino/api/deprecated-avr-comp" "-IC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino" "-IC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\variants\MINIMA" "-iprefixC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1" "@C:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\variants\MINIMA/includes.txt" "C:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\cores\arduino\api\Print.cpp" -o "C:\Users\Max\AppData\Local\Temp\arduino_build_350766\core\api\Print.cpp.o"

What PlatformIO misses:
1: -Os (makes firmware *really big!)
2. -g3
3. -fno-use-cxa-atexit
4. -fno-rtti
5. -fno-exception
6. -nostdlib

What's wrong:

  1. -DLWIP_DNS=1 given for Minima. Only used with Uno R4 WiFi
  2. Different warning flags?

In the Linking phase, PlatformIO:

arm-none-eabi-g++ -o .pio\build\uno_r4_minima\firmware.elf -T C:\Users\Max.platformio\packages\framework-arduinorenesas-uno\variants\MINIMA\fsp.ld -mcpu=cortex-m4 -mthumb -Wl,--gc-sections --specs=nosys.specs -mfloat-abi=hard -mfpu=fpv4-sp-d16 .pio\build\uno_r4_minima\src\main.cpp.o -L.pio\build\uno_r4_minima -LC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\variants\MINIMA -LC:\Users\Max.platformio\packages\framework-arduinorenesas-uno\variants\MINIMA\libs -Wl,--start-group .pio\build\uno_r4_minima\libFrameworkArduinoVariant.a .pio\build\uno_r4_minima\libFrameworkArduino.a -lfsp -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group

Arduino IDE:

"C:\Users\Max\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++" -Wl,--gc-sections --specs=nosys.specs -w -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o "C:\Users\Max\AppData\Local\Temp\arduino_build_350766/Blink.ino.elf" "-LC:\Users\Max\AppData\Local\Temp\arduino_build_350766" "-LC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\variants\MINIMA" "-TC:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\variants\MINIMA/fsp.ld" "C:\Users\Max\AppData\Local\Temp\arduino_build_350766\sketch\Blink.ino.cpp.o" "C:\Users\Max\AppData\Local\Temp\arduino_build_350766\core\tmp_gen_c_files\common_data.c.o" "C:\Users\Max\AppData\Local\Temp\arduino_build_350766\core\tmp_gen_c_files\main.c.o" "C:\Users\Max\AppData\Local\Temp\arduino_build_350766\core\tmp_gen_c_files\pin_data.c.o" "C:\Users\Max\AppData\Local\Temp\arduino_build_350766\core\variant.cpp.o" -Wl,--start-group "C:\Users\Max\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.1\variants\MINIMA/libs/libfsp.a" "C:\Users\Max\AppData\Local\Temp\arduino_build_350766/core\core.a" --specs=nano.specs -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group "-Wl,-Map,C:\Users\Max\AppData\Local\Temp\arduino_build_350766/Blink.ino.map"

What's missing:

  • no .map file generation

In general:

  • Arduino IDE uses GCC 7.0.1, PlatformIO uses 10.3.1. May have subtle differences.

Debugging broke

[env:uno_r4_wifi]
platform = renesas-ra
board = uno_r4_wifi
framework = arduino

-->

> pio debug --interface=gdb -- -x .pioinit
KeyError: Traceback (most recent call last):
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\cli.py", line 85, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\debug\cli.py", line 104, in cli
    debug_config = _configure(*configure_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\debug\cli.py", line 113, in _configure
    debug_config = DebugConfigFactory.new(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\debug\config\factory.py", line 48, in new
    return config_cls(platform, project_config, env_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\debug\config\generic.py", line 38, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\debug\config\base.py", line 52, in __init__
    self.server = self._configure_server()
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\debug\config\base.py", line 182, in _configure_server
    self.platform.get_package_dir(server_package)
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\platform\_packages.py", line 32, in get_package_dir
    pkg = self.get_package(name)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\platform\_packages.py", line 29, in get_package
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Max\AppData\Roaming\Python\Python311\site-packages\platformio\platform\_packages.py", line 21, in get_package_spec
    owner=self.packages[name].get("owner"),
          ~~~~~~~~~~~~~^^^^^^
KeyError: 'tool-openocd'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

And that's after a clean reinstall of [email protected]. The platform.py logic might no be able to handle the case with the Arduino Uno R4 WiFi which needs tool-bossac to preload but at the same time tool-openocd to open the debug session.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.