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

Flashed my UNO Rev4 Wifi on pio run && pio run --target upload? Never uploaded the code? #23

Open
CodeByAidan opened this issue Apr 2, 2024 · 0 comments

Comments

@CodeByAidan
Copy link

Hello. I have an Arduino UNO Rev4 WiFi currently, and here is some verbose info:

Background Info:

Py. + PIO Vers.:

PS C:\Users\aidan\Documents\LED_Matrix_Blink_LED> python --version
Python 3.12.2
PS C:\Users\aidan\Documents\LED_Matrix_Blink_LED> pio --version
PlatformIO Core, version 6.1.14

File Tree/Structure:

image

PS C:\Users\aidan\Documents\LED_Matrix_Blink_LED> tree . /F /a
Folder PATH listing
Volume serial number is 6C87-67F4
C:\USERS\AIDAN\DOCUMENTS\LED_MATRIX_BLINK_LED
|   .gitignore
|   get-platformio.py
|   platformio.ini
|
+---.pio
| ....
| 
+---.vscode
|       c_cpp_properties.json
|       extensions.json
|       launch.json
|       settings.json
|
+---include
|       README
|
+---lib
|       README
|
+---src
|       animation.h
|       main.cpp
|
+---test
\       README

Platform.ini:

; platform.ini:
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter, extra scripting
;   Upload options: custom port, speed and extra flags
;   Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env]
platform = renesas-ra
framework = arduino

[env:uno_r4_wifi]
board = uno_r4_wifi
upload_protocol = sam-ba

src/animation.h:

#include <stdint.h>
const uint32_t animation[][4] = {
	{
		0x30c20,
		0x43fc3fc2,
		0x430c000,
		66
	},
	{
		0x30c29,
		0x436c36c2,
		0x9430c000,
		66
	},
	{
		0x30c2f,
		0x430c30c2,
		0xf430c000,
		66
	},
	{
		0x36c29,
		0x41081082,
		0x9436c000,
		66
	},
	{
		0x3fc30,
		0xc1081083,
		0xc3fc000,
		66
	},
	{
		0x3fc20,
		0x42042042,
		0x43fc000,
		66
	},
	{
		0x3f,
		0xc2042043,
		0xfc000000,
		66
	},
	{
		0x0,
		0x3fc3fc0,
		0x0,
		66
	},
	{
		0x0,
		0x1f81f80,
		0x0,
		66
	},
	{
		0x0,
		0xf00f00,
		0x0,
		66
	},
	{
		0x0,
		0x600600,
		0x0,
		66
	},
	{
		0x0,
		0x0,
		0x0,
		66
	}
};

src/main.cpp:

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

ArduinoLEDMatrix matrix;

void setup() {
  Serial.begin(115200);
  // you can also load frames at runtime, without stopping the refresh
  matrix.loadSequence(animation);
  matrix.begin();
  // turn on autoscroll to avoid calling next() to show the next frame; the paramenter is in milliseconds
  // matrix.autoscroll(300);
  matrix.play(true);
}

void loop() {
  delay(500);
  Serial.println(millis());
}

.vscode/settings.json

{}

.vscode/launch.json

// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
//
// PlatformIO Debugging Solution
//
// Documentation: https://docs.platformio.org/en/latest/plus/debugging.html
// Configuration: https://docs.platformio.org/en/latest/projectconf/sections/env/options/debug/index.html

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug",
            "executable": "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/.pio/build/uno_r4_wifi/firmware.elf",
            "projectEnvName": "uno_r4_wifi",
            "toolchainBinDir": "C:/Users/aidan/.platformio/packages/toolchain-gccarmnoneeabi/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "svdPath": "C:/Users/aidan/.platformio/platforms/renesas-ra/misc/svd/R7FA4M1AB.svd",
            "preLaunchTask": {
                "type": "PlatformIO",
                "task": "Pre-Debug"
            }
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (skip Pre-Debug)",
            "executable": "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/.pio/build/uno_r4_wifi/firmware.elf",
            "projectEnvName": "uno_r4_wifi",
            "toolchainBinDir": "C:/Users/aidan/.platformio/packages/toolchain-gccarmnoneeabi/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "svdPath": "C:/Users/aidan/.platformio/platforms/renesas-ra/misc/svd/R7FA4M1AB.svd"
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (without uploading)",
            "executable": "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/.pio/build/uno_r4_wifi/firmware.elf",
            "projectEnvName": "uno_r4_wifi",
            "toolchainBinDir": "C:/Users/aidan/.platformio/packages/toolchain-gccarmnoneeabi/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "svdPath": "C:/Users/aidan/.platformio/platforms/renesas-ra/misc/svd/R7FA4M1AB.svd",
            "loadMode": "manual"
        }
    ]
}

.vscode/extensions.json

{
    // See http://go.microsoft.com/fwlink/?LinkId=827846
    // for the documentation about the extensions.json format
    "recommendations": [
        "platformio.platformio-ide"
    ],
    "unwantedRecommendations": [
        "ms-vscode.cpptools-extension-pack"
    ]
}

.vscode/c_cpp_properties.json

//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
    "configurations": [
        {
            "name": "PlatformIO",
            "includePath": [
                "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/include",
                "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Arduino_LED_Matrix/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino/tinyusb",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino/api/deprecated",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino/api/deprecated-avr-comp",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/AnalogWave",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Arduino_CAN/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Arduino_FreeRTOS/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/BlockDevices",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/EEPROM/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/FATFilesystem",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/HID",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/LittleFilesystem",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/OTAUpdate/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/RTC/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/SDU/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/SPI",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/SoftwareSerial/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Storage",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/WDT/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/WiFiS3/src",
                "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Wire",
                ""
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": true,
                "path": [
                    "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/include",
                    "C:/Users/aidan/Documents/LED_Matrix_Blink_LED/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Arduino_LED_Matrix/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino/tinyusb",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino/api/deprecated",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/cores/arduino/api/deprecated-avr-comp",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/AnalogWave",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Arduino_CAN/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Arduino_FreeRTOS/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/BlockDevices",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/EEPROM/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/FATFilesystem",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/HID",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/LittleFilesystem",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/OTAUpdate/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/RTC/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/SDU/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/SPI",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/SoftwareSerial/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Storage",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/WDT/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/WiFiS3/src",
                    "C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/libraries/Wire",
                    ""
                ]
            },
            "defines": [
                "PLATFORMIO=60114",
                "ARDUINO_UNOWIFIR4",
                "ARDUINO_ARCH_RENESAS_UNO",
                "ARDUINO_UNOR4_WIFI",
                "NO_USB",
                "BACKTRACE_SUPPORT",
                "LWIP_DNS=1",
                "CFG_TUSB_MCU=OPT_MCU_RAXXX",
                "_RA_CORE=CM4",
                "_RENESAS_RA_",
                "ARDUINO=10810",
                "ARDUINO_ARCH_RENESAS",
                "ARDUINO_FSP",
                "_XOPEN_SOURCE=700",
                "F_CPU=48000000L",
                ""
            ],
            "cStandard": "gnu11",
            "cppStandard": "gnu++17",
            "compilerPath": "C:/Users/aidan/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe",
            "compilerArgs": [
                "-mcpu=cortex-m4",
                "-mfloat-abi=hard",
                "-mfpu=fpv4-sp-d16",
                "-mthumb",
                "-iprefixC:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno",
                "@C:/Users/aidan/.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4/includes.txt",
                ""
            ]
        }
    ],
    "version": 4
}

Everything is the same as the arduino-uno-r4-led-animation example.

Problem:

Upon running the usual: pio run && pio run --target upload, it looks like everything uploaded successfully. but it just flashes (removes all the current code running (sorry if I'm not using the right terminology, I'm a computer science major and I'm trying to learn electrical engineering just for fun, as a hobby)). And I'm running what I think is right, and this is the output:

PS C:\Users\aidan\Documents\LED_Matrix_Blink_LED> pio run && pio run --target upload
Processing uno_r4_wifi (board: uno_r4_wifi; platform: renesas-ra; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/renesas-ra/uno_r4_wifi.html
PLATFORM: Renesas RA (1.2.0) > Arduino Uno R4 WiFi
HARDWARE: RA4M1 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink)
PACKAGES: 
 - framework-arduinorenesas-uno @ 1.0.4 
 - tool-bossac @ 1.10901.0 (1.9.1) 
 - toolchain-gccarmnoneeabi @ 1.100301.220327 (10.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 18 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LED_Matrix @ 1.0.0
Building in release mode
Compiling .pio\build\uno_r4_wifi\src\main.cpp.o
Checking size .pio\build\uno_r4_wifi\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.7% (used 2520 bytes from 32768 bytes)
Flash: [=         ]  13.8% (used 36119 bytes from 262144 bytes)
====================================================================================== [SUCCESS] Took 1.15 seconds ======================================================================================
Processing uno_r4_wifi (board: uno_r4_wifi; platform: renesas-ra; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/renesas-ra/uno_r4_wifi.html
PLATFORM: Renesas RA (1.2.0) > Arduino Uno R4 WiFi
HARDWARE: RA4M1 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink)
PACKAGES:
 - framework-arduinorenesas-uno @ 1.0.4
 - tool-bossac @ 1.10901.0 (1.9.1)
 - tool-jlink @ 1.78811.0 (7.88.11)
 - tool-openocd @ 3.1200.0 (12.0)
 - toolchain-gccarmnoneeabi @ 1.100301.220327 (10.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 18 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LED_Matrix @ 1.0.0
Building in release mode
Checking size .pio\build\uno_r4_wifi\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.7% (used 2520 bytes from 32768 bytes)
Flash: [=         ]  13.8% (used 36119 bytes from 262144 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, sam-ba
CURRENT: upload_protocol = sam-ba
Looking for upload port...
Auto-detected: COM5
Forcing reset using 1200bps open/close on port COM5
Uploading .pio\build\uno_r4_wifi\firmware.bin
Erase flash

Done in 0.001 seconds
Write 36120 bytes to flash (9 pages)

[                              ] 0% (0/9 pages)
[===                           ] 11% (1/9 pages)
[======                        ] 22% (2/9 pages)
[==========                    ] 33% (3/9 pages)
[=============                 ] 44% (4/9 pages)
[================              ] 55% (5/9 pages)
[====================          ] 66% (6/9 pages)
[=======================       ] 77% (7/9 pages)
[==========================    ] 88% (8/9 pages)
[==============================] 100% (9/9 pages)
Done in 2.277 seconds
====================================================================================== [SUCCESS] Took 4.37 seconds ======================================================================================
PS C:\Users\aidan\Documents\LED_Matrix_Blink_LED> 

0 lights come on, nothing happens, even if I do a Serial.println("test"); in loop() or setup(), it doesn't do anything after checking serial monitor?

Expected:

For literally output or any changes other then flashing? I'm confused?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant