Skip to content

Commit 1261299

Browse files
committed
2 parents 8499f96 + 80faaf8 commit 1261299

File tree

24 files changed

+596
-88
lines changed

24 files changed

+596
-88
lines changed

.github/workflows/compile-examples.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- libraries/RTC/examples/RTC_PeriodicExample
3838
- libraries/RTC/examples/Test_RTC
3939
- libraries/SoftwareSerial
40+
- libraries/WDT
4041
4142
strategy:
4243
fail-fast: false
@@ -133,26 +134,22 @@ jobs:
133134
- name: LiquidCrystal
134135
- name: CapacitiveSensor
135136
- name: Ethernet
136-
- name: ArduinoBearSSL
137137
- name: ArduinoHttpClient
138138
- name: NTPClient
139139
- name: ArduinoMqttClient
140140
- name: Stepper
141141
- name: SD
142142
- name: Arduino_JSON
143-
- name: Arduino_HTS221
143+
- name: ArduinoBLE
144144
- name: Firmata
145145
- name: ArduinoModbus
146146
- name: ArduinoDMX
147147
- name: ArduinoRS485
148-
- name: WiFi
149148
- name: ArduinoIoTCloud
150149
platforms: |
151-
# Use Board Manager to install the latest release of Arduino SAMD Boards to get the toolchain
150+
# Use Board Manager to install the latest release of Arduino Renesas Boards to get the toolchain
152151
- name: "arduino:renesas_uno"
153-
source-url: "https://downloads.arduino.cc/packages/package_renesas_release_index.json"
154152
- name: "arduino:renesas_portenta"
155-
source-url: "https://downloads.arduino.cc/packages/package_renesas_release_index.json"
156153
# Overwrite the Board Manager installation with the local platform
157154
- source-path: "./"
158155
name: "arduino-git:renesas"

bootloaders/SANTIAGO/README.md renamed to bootloaders/UNO_R4/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:floppy_disk: `bootloaders/SANTIAGO`
1+
:floppy_disk: `bootloaders/UNO_R4`
22
====================================
33
Sources for Uno R4 WIFi at [email protected]:bcmi-labs/tinyusb.git , commit 185ae31ff15a1013a5a890455220a29bad1ed209
44

@@ -21,7 +21,7 @@ Prerequisite: install esp-idf v5.0.0 (or newer) and run
2121
```
2222
. $esp-idf-path/export.sh
2323
24-
cd extras/santiago-leven-usb-bridge
24+
cd extras/uno-r4-wifi-usb-bridge
2525
```
2626

2727
Restart the board in ESP download mode by shorting ESP_DOWNLOAD with GND, then power via USB
@@ -45,7 +45,7 @@ stty -F $portname 2400
4545

4646
Then flash the bootloader with [`rfp-cli`](https://www.renesas.com/us/en/software-tool/renesas-flash-programmer-programming-gui#download)
4747
```
48-
rfp-cli -device ra -port $portname -p dfu_leven.hex
48+
rfp-cli -device ra -port $portname -p dfu_wifi.hex
4949
```
5050

5151
:rocket: `How to load bootloader (UNO R4 Minima)`
File renamed without changes.

cores/arduino/Serial.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,12 @@ void UART::begin(unsigned long baudrate, uint16_t config) {
272272

273273
fsp_err_t err;
274274
const bool bit_mod = true;
275-
const uint32_t err_rate = 5;
275+
const uint32_t err_rate = 3000; //means 3%
276276

277277
err = R_SCI_UART_BaudCalculate(baudrate, bit_mod, err_rate, &uart_baud);
278+
if (uart_baud.mddr == 0) {
279+
err = R_SCI_UART_BaudCalculate(baudrate, false, err_rate, &uart_baud);
280+
}
278281
err = R_SCI_UART_Open (&uart_ctrl, &uart_cfg);
279282
if(err != FSP_SUCCESS) while(1);
280283
err = R_SCI_UART_BaudSet(&uart_ctrl, (void *) &uart_baud);

libraries/Arduino_CAN/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
`Arduino_CAN`
2+
=============
3+
### How-to-`SocketCAN`
4+
* Connect your [SocketCAN](https://en.wikipedia.org/wiki/SocketCAN) capable CAN/USB dongle to the PC and configure it.
5+
```bash
6+
sudo ip link set can0 type can bitrate 250000
7+
sudo ip link set up can0
8+
```
9+
* Install can-utils for cansend/candump:
10+
```bash
11+
sudo apt-get install can-utils
12+
```
13+
* Transmit CAN frames via [`cansend`](https://manpages.ubuntu.com/manpages/lunar/man1/cansend.1.html):
14+
```bash
15+
cansend can0 1F334455#1122334455667788
16+
```
17+
* Display received CAN frames via [`candump`](https://manpages.ubuntu.com/manpages/lunar/man1/candump.1.html):
18+
```bash
19+
candump can0
20+
```

libraries/Storage/examples/.portenta_only

Whitespace-only changes.

libraries/UsbMsd/.portenta_only

Whitespace-only changes.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
Watchdog Refresh
3+
4+
This sketch shows how to enable the watchdog and
5+
refresh the timer to avoid resets
6+
7+
Watchdog intervals are limited to 7 timeout periods
8+
the library will select the best clock divisor and timeout
9+
according to the selected wdtInterval.
10+
11+
UNO R4 min wdtInterval 1ms / max wdtInterval 5592ms
12+
Comment out Serial.print() in the setup to make it work with
13+
small intervals
14+
15+
Portenta C33 min wdtInterval 1ms / max wdtInterval 2684ms
16+
17+
Circuit:
18+
- Portenta C33
19+
- UNO R4
20+
*/
21+
22+
#include <WDT.h>
23+
24+
const long ledInterval = 1000;
25+
unsigned long ledMillis = 0;
26+
bool ledState = true;
27+
const long wdtInterval = 2684;
28+
unsigned long wdtMillis = 0;
29+
30+
void setup() {
31+
Serial.begin(9600);
32+
while (!Serial);
33+
34+
pinMode(LED_BUILTIN, OUTPUT);
35+
36+
if(wdtInterval < 1) {
37+
Serial.println("Invalid watchdog interval");
38+
while(1){}
39+
}
40+
41+
if(WDT.begin(wdtInterval)) {
42+
Serial.print("WDT interval: ");
43+
WDT.refresh();
44+
Serial.print(WDT.getTimeout());
45+
WDT.refresh();
46+
Serial.println(" ms");
47+
WDT.refresh();
48+
} else {
49+
Serial.println("Error initializing watchdog");
50+
while(1){}
51+
}
52+
}
53+
54+
void loop() {
55+
if(millis() - ledMillis >= ledInterval) {
56+
digitalWrite(LED_BUILTIN, ledState);
57+
ledState = !ledState;
58+
ledMillis = millis();
59+
}
60+
61+
if(millis() - wdtMillis >= wdtInterval - 1) {
62+
WDT.refresh(); // Comment this line to stop refreshing the watchdog
63+
wdtMillis = millis();
64+
}
65+
66+
}

0 commit comments

Comments
 (0)