Skip to content

Commit b702027

Browse files
committed
Merge remote-tracking branch 'origin/main' into debug_ide2
Former-commit-id: 36919ad
2 parents 01e793e + a7c5e9d commit b702027

File tree

73 files changed

+883
-2070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+883
-2070
lines changed

.github/workflows/compile-examples.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
# sketch paths to compile (recursive) for all boards
2727
UNIVERSAL_SKETCH_PATHS: |
2828
- libraries/AnalogWave
29-
- libraries/Arduino_CAN/CANRead
30-
- libraries/Arduino_CAN/CANWrite
29+
- libraries/Arduino_CAN/examples/CANRead
30+
- libraries/Arduino_CAN/examples/CANWrite
3131
- libraries/Arduino_FreeRTOS
3232
- libraries/EEPROM
3333
- libraries/RTC
@@ -38,15 +38,15 @@ jobs:
3838

3939
matrix:
4040
board: [
41-
{"fqbn": "arduino:renesas:portenta_c33"},
42-
{"fqbn": "arduino:renesas:minima"},
43-
{"fqbn": "arduino:renesas:unor4wifi"},
41+
{"fqbn": "arduino-git:renesas:portenta_c33"},
42+
{"fqbn": "arduino-git:renesas:minima"},
43+
{"fqbn": "arduino-git:renesas:unor4wifi"},
4444
]
4545

4646
# make board type-specific customizations to the matrix jobs
4747
include:
4848
- board:
49-
fqbn: "arduino:renesas:portenta_c33"
49+
fqbn: "arduino-git:renesas:portenta_c33"
5050
additional-sketch-paths: |
5151
- libraries/WiFi
5252
- libraries/UsbMsd
@@ -55,17 +55,21 @@ jobs:
5555
- libraries/SSLClient
5656
- libraries/SE05X
5757
- libraries/Ethernet
58-
- libraries/Arduino_CAN/CAN1Read
59-
- libraries/Arduino_CAN/CAN1Write
58+
- libraries/Arduino_CAN/examples/CAN1Read
59+
- libraries/Arduino_CAN/examples/CAN1Write
6060
- board:
61-
fqbn: "arduino:renesas:unor4wifi"
61+
fqbn: "arduino-git:renesas:unor4wifi"
6262
additional-sketch-paths: |
6363
- libraries/WiFiS3
6464
- libraries/Arduino_LED_Matrix
6565
6666
steps:
6767
- name: Checkout repository
6868
uses: actions/checkout@v2
69+
with:
70+
submodules: recursive
71+
token: ${{ secrets.PRIVATE_SUBMODULES_CLONE }}
72+
fetch-depth: 0
6973

7074
# The source files are in a subfolder of the ArduinoCore-API repository, so it's not possible to clone it directly to the final destination in the core
7175
- name: Checkout ArduinoCore-API
@@ -120,7 +124,7 @@ jobs:
120124
source-url: "https://downloads.arduino.cc/packages/package_renesas_secret_index.json"
121125
# Overwrite the Board Manager installation with the local platform
122126
- source-path: "./"
123-
name: "arduino:renesas"
127+
name: "arduino-git:renesas"
124128
sketch-paths: |
125129
${{ env.UNIVERSAL_SKETCH_PATHS }}
126130
${{ matrix.additional-sketch-paths }}

boards.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ minima.compiler.fsp.cxxflags=-mthumb "@{compiler.fsp.defines}"
7777
minima.compiler.tinyusb.cflags=-DCFG_TUSB_MCU=OPT_MCU_RAXXX
7878
minima.compiler.tinyusb.cxxflags=-DCFG_TUSB_MCU=OPT_MCU_RAXXX
7979
minima.compiler.fsp.includes={build.variant.path}/includes.txt
80-
minima.compiler.fsp.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
80+
minima.compiler.fsp.extra_ldflags=--specs=nano.specs -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
8181
minima.compiler.fsp="{build.variant.path}/libs/libfsp.a"
8282

8383
minima.upload.tool=dfu-util
@@ -125,7 +125,7 @@ unor4wifi.compiler.fsp.cxxflags=-mthumb "@{compiler.fsp.defines}"
125125
unor4wifi.compiler.tinyusb.cflags=-DCFG_TUSB_MCU=OPT_MCU_RAXXX
126126
unor4wifi.compiler.tinyusb.cxxflags=-DCFG_TUSB_MCU=OPT_MCU_RAXXX
127127
unor4wifi.compiler.fsp.includes={build.variant.path}/includes.txt
128-
unor4wifi.compiler.fsp.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
128+
unor4wifi.compiler.fsp.extra_ldflags=--specs=nano.specs -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
129129
unor4wifi.compiler.fsp="{build.variant.path}/libs/libfsp.a"
130130

131131
unor4wifi.upload.tool=bossac
@@ -171,7 +171,7 @@ muxto.compiler.fsp.cxxflags=-mthumb -D_RA_CORE=CM23 -D_RENESAS_RA_
171171
muxto.compiler.tinyusb.cflags=-DCFG_TUSB_MCU=OPT_MCU_RAXXX
172172
muxto.compiler.tinyusb.cxxflags=-DCFG_TUSB_MCU=OPT_MCU_RAXXX
173173
muxto.compiler.fsp.includes={build.variant.path}/includes.txt
174-
muxto.compiler.fsp.extra_ldflags=-lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
174+
muxto.compiler.fsp.extra_ldflags=--specs=nano.specs -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
175175
muxto.compiler.fsp="{build.variant.path}/libs/libfsp.a"
176176

177177
muxto.upload.tool=dfu-util

cores/arduino/Serial.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ void UART::WrapperCallback(uart_callback_args_t *p_args) {
8282
}
8383

8484

85-
/* -------------------------------------------------------------------------- */
86-
UART::UART(int _pin_tx, int _pin_rx) :
85+
UART::UART(int _pin_tx, int _pin_rx, int _pin_rts, int _pin_cts):
8786
tx_pin(_pin_tx),
8887
rx_pin(_pin_rx),
88+
rts_pin(_pin_rts),
89+
cts_pin(_pin_cts),
8990
init_ok(false) {
9091
/* -------------------------------------------------------------------------- */
9192
uart_cfg.txi_irq = FSP_INVALID_VECTOR;
@@ -94,9 +95,6 @@ UART::UART(int _pin_tx, int _pin_rx) :
9495
uart_cfg.eri_irq = FSP_INVALID_VECTOR;
9596
}
9697

97-
98-
99-
10098
/* -------------------------------------------------------------------------- */
10199
bool UART::setUpUartIrqs(uart_cfg_t &cfg) {
102100
/* -------------------------------------------------------------------------- */
@@ -181,9 +179,14 @@ bool UART::cfg_pins(int max_index) {
181179
/* actually configuring PIN function */
182180
ioport_peripheral_t ioport_tx = USE_SCI_EVEN_CFG(cfg_tx) ? IOPORT_PERIPHERAL_SCI0_2_4_6_8 : IOPORT_PERIPHERAL_SCI1_3_5_7_9;
183181
ioport_peripheral_t ioport_rx = USE_SCI_EVEN_CFG(cfg_rx) ? IOPORT_PERIPHERAL_SCI0_2_4_6_8 : IOPORT_PERIPHERAL_SCI1_3_5_7_9;
184-
182+
185183
R_IOPORT_PinCfg(&g_ioport_ctrl, g_pin_cfg[tx_pin].pin, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | ioport_tx));
186184
R_IOPORT_PinCfg(&g_ioport_ctrl, g_pin_cfg[rx_pin].pin, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | ioport_rx));
185+
if (rts_pin != -1 && cts_pin != -1) {
186+
// hopefully people using flow control have read the datasheet so let's avoid the double check
187+
R_IOPORT_PinCfg(&g_ioport_ctrl, g_pin_cfg[rts_pin].pin, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | ioport_rx));
188+
R_IOPORT_PinCfg(&g_ioport_ctrl, g_pin_cfg[cts_pin].pin, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | ioport_rx));
189+
}
187190

188191
return true;
189192
}
@@ -213,6 +216,9 @@ void UART::begin(unsigned long baudrate, uint16_t config) {
213216
uart_cfg_extend.p_baud_setting = &uart_baud;
214217
uart_cfg_extend.flow_control = SCI_UART_FLOW_CONTROL_RTS;
215218
uart_cfg_extend.flow_control_pin = (bsp_io_port_pin_t) UINT16_MAX;
219+
if (rts_pin != -1 && cts_pin != -1) {
220+
uart_cfg_extend.flow_control = SCI_UART_FLOW_CONTROL_HARDWARE_CTSRTS;
221+
}
216222
uart_cfg_extend.rs485_setting.enable = SCI_UART_RS485_DISABLE;
217223
uart_cfg_extend.rs485_setting.polarity = SCI_UART_RS485_DE_POLARITY_HIGH;
218224
uart_cfg_extend.rs485_setting.de_control_pin = (bsp_io_port_pin_t) UINT16_MAX;

cores/arduino/Serial.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class UART : public arduino::HardwareSerial {
5252
public:
5353
static UART *g_uarts[MAX_UARTS];
5454
static void WrapperCallback(uart_callback_args_t *p_args);
55-
56-
UART(int _pin_tx, int _pin_rx);
55+
56+
UART(int _pin_tx, int _pin_rx, int pin_rts = -1, int pin_cts = -1);
5757
void begin(unsigned long);
5858
void begin(unsigned long, uint16_t config);
5959
void end();
@@ -70,6 +70,8 @@ class UART : public arduino::HardwareSerial {
7070
private:
7171
int tx_pin;
7272
int rx_pin;
73+
int rts_pin = -1;
74+
int cts_pin = -1;
7375
bool cfg_pins(int max_index);
7476

7577
int channel;

cores/arduino/SerialObj3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ UART _UART4_(UART4_TX_PIN, UART4_RX_PIN);
99
#endif
1010

1111
#if SERIAL_HOWMANY > 4
12-
UART _UART5_(UART5_TX_PIN, UART5_RX_PIN);
12+
UART _UART5_(UART5_TX_PIN, UART5_RX_PIN, UART5_RTS_PIN, UART5_CTS_PIN);
1313
#endif

cores/arduino/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,12 @@ extern "C" {
134134

135135
//Declared weak in Arduino.h to allow user redefinitions.
136136
int atexit(void (*func)()) { return 0; }
137+
138+
namespace __gnu_cxx {
139+
void __verbose_terminate_handler() { }
140+
}
141+
extern "C" __attribute__((weak)) void __cxa_pure_virtual(void);
142+
extern "C" __attribute__((weak)) void __cxa_pure_virtual(void)
143+
{
144+
exit(1);
145+
}

extras/e2studioProjects/portenta_h33_lib/configuration.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@
900900
</config>
901901
<config id="config.driver.flash_hp">
902902
<property id="config.driver.flash_hp.param_checking_enable" value="config.flash_hp.param_checking_enable.bsp"/>
903-
<property id="config.driver.flash_hp.param_code_flash_programming_enable" value="config.driver.flash_hp.param_code_flash_programming_enable.disabled"/>
903+
<property id="config.driver.flash_hp.param_code_flash_programming_enable" value="config.driver.flash_hp.param_code_flash_programming_enable.enabled"/>
904904
<property id="config.driver.flash_hp.param_data_flash_programming_enable" value="config.driver.flash_hp.param_data_flash_programming_enable.enabled"/>
905905
</config>
906906
<config id="config.driver.lpm">

extras/net/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ make
1717

1818
### Move libraries inside SSLClient
1919
```bash
20-
cp liblwIP.a ../../libraries/Ethernet/src/cortex-m33/
20+
cp liblwIP.a ../../libraries/lwIpWrapper/src/cortex-m33/
2121
```

extras/net/lwipopts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
* already use it.
112112
*/
113113
#ifndef MEM_LIBC_MALLOC
114-
#define MEM_LIBC_MALLOC 1
114+
#define MEM_LIBC_MALLOC 0
115115
#endif
116116

117117
/**

extras/package.sh

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,26 @@
33
if [ ! -f platform.txt ]; then
44
echo Launch this script from the root core folder as ./extras/package.sh
55
exit 2
6-
fi
6+
fi
77

88
VERSION=`cat platform.txt | grep "version=" | cut -f2 -d"="`
99
echo $VERSION
1010

11-
FILENAME=ArduinoCore-renesas-$VERSION.tar.bz2
11+
#portenta
12+
13+
VARIANT=portenta
14+
EXCLUDE_TAGS=--exclude-tag-all=.unor4_only
15+
16+
FILENAME=ArduinoCore-renesas_$VARIANT-$VERSION.tar.bz2
17+
18+
git checkout boards.txt
19+
echo minima.hide=true >> boards.txt
20+
echo unor4wifi.hide=true >> boards.txt
21+
echo muxto.hide=true >> boards.txt
1222

1323
CORE_BASE=`basename $PWD`
1424
cd ..
15-
tar --exclude='*.vscode*' --exclude='*.git*' --exclude='*e2studio*' --exclude='*extras*' -cjhvf $FILENAME $CORE_BASE
25+
tar $EXCLUDE_TAGS --exclude='*.vscode*' --exclude='*.tar.*' --exclude='*.json*' --exclude='*.git*' --exclude='*e2studio*' --exclude='*extras*' -cjhvf $FILENAME $CORE_BASE
1626
cd -
1727

1828
mv ../$FILENAME .
@@ -24,8 +34,37 @@ cat extras/package_index.json.template |
2434
# sed "s/%%BUILD_NUMBER%%/${BUILD_NUMBER}/" |
2535
# sed "s/%%CURR_TIME%%/${CURR_TIME_SED}/" |
2636
sed "s/%%VERSION%%/${VERSION}/" |
27-
sed "s/%%FILENAME%%/${FILENAME}/" |
28-
sed "s/%%CHECKSUM%%/${CHKSUM}/" |
29-
sed "s/%%SIZE%%/${SIZE}/" > package_renesas_${VERSION}_index.json
37+
sed "s/%%FILENAME_PORTENTA%%/${FILENAME}/" |
38+
sed "s/%%CHECKSUM_PORTENTA%%/${CHKSUM}/" |
39+
sed "s/%%SIZE_PORTENTA%%/${SIZE}/" > package_renesas_${VERSION}_index.json.tmp
40+
41+
#uno r4
42+
43+
VARIANT=uno
44+
EXCLUDE_TAGS=--exclude-tag-all=.portenta_only
45+
46+
FILENAME=ArduinoCore-renesas_$VARIANT-$VERSION.tar.bz2
47+
48+
git checkout boards.txt
49+
echo portenta_c33.hide=true >> boards.txt
50+
echo muxto.hide=true >> boards.txt
51+
52+
CORE_BASE=`basename $PWD`
53+
cd ..
54+
tar $EXCLUDE_TAGS --exclude='*.vscode*' --exclude='*.tar.*' --exclude='*.json*' --exclude='*.git*' --exclude='*e2studio*' --exclude='*extras*' -cjhvf $FILENAME $CORE_BASE
55+
cd -
56+
57+
mv ../$FILENAME .
58+
59+
CHKSUM=`sha256sum $FILENAME | awk '{ print $1 }'`
60+
SIZE=`wc -c $FILENAME | awk '{ print $1 }'`
61+
62+
cat package_renesas_${VERSION}_index.json.tmp |
63+
# sed "s/%%BUILD_NUMBER%%/${BUILD_NUMBER}/" |
64+
# sed "s/%%CURR_TIME%%/${CURR_TIME_SED}/" |
65+
sed "s/%%VERSION%%/${VERSION}/" |
66+
sed "s/%%FILENAME_UNO%%/${FILENAME}/" |
67+
sed "s/%%CHECKSUM_UNO%%/${CHKSUM}/" |
68+
sed "s/%%SIZE_UNO%%/${SIZE}/" > package_renesas_${VERSION}_index.json
3069

31-
cat package_renesas_${VERSION}_index.json
70+
cat package_renesas_${VERSION}_index.json

0 commit comments

Comments
 (0)