Skip to content

Commit 09a0517

Browse files
committed
2 parents 46b0b31 + eeabfc1 commit 09a0517

62 files changed

Lines changed: 4077 additions & 90 deletions

Some content is hidden

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

.github/workflows/Continuous-Integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
- name: Astyle check
3333
id: Astyle
3434
uses: stm32duino/actions/astyle-check@master
35+
with:
36+
astyle-definition: 'CI/astyle/.astylerc'
37+
ignore-path-list: 'CI/astyle/.astyleignore'
3538

3639
# Use the output from the `Astyle` step
3740
- name: Astyle Errors

.gitignore

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
1-
*.orig
2-
*.swp
3-
.DS_Store
1+
# Specific
42
astyle.out
53
boards.local.txt
64
platform.local.txt
7-
*.code-workspace
8-
.vscode
95
path_config.json
6+
7+
# Backup
8+
*.bak
9+
*.gho
10+
*.ori
11+
*.swp
12+
*.tmp
13+
14+
# macOS
15+
# General
16+
.DS_Store
17+
.AppleDouble
18+
.LSOverride
19+
20+
# Patch
21+
*.orig
22+
*.rej
23+
24+
# Python
25+
# Byte-compiled / optimized / DLL files
26+
__pycache__/
27+
*.py[cod]
28+
*$py.class
29+
30+
# VisualStudioCode
31+
.vscode/*
32+
!.vscode/settings.json
33+
!.vscode/tasks.json
34+
!.vscode/launch.json
35+
!.vscode/extensions.json
36+
*.code-workspace

CI/build/conf/cores_config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
{
1212
"name": "STEVAL_MKSBOX1V1",
1313
"options": "usb=CDCgen"
14+
},
15+
{
16+
"name": "STM32MP157A_DK1",
17+
"options": "virtio=enabled"
18+
},
19+
{
20+
"name": "STM32MP157C_DK2",
21+
"options": "virtio=generic"
1422
}
1523
],
1624
"sketches": [

CI/build/conf/cores_config_ci.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
{
1212
"name": "STEVAL_MKSBOX1V1",
1313
"options": "usb=CDCgen"
14+
},
15+
{
16+
"name": "STM32MP157A_DK1",
17+
"options": "virtio=enabled"
18+
},
19+
{
20+
"name": "STM32MP157C_DK2",
21+
"options": "virtio=generic"
1422
}
1523
],
1624
"sketches": [

CI/build/conf/cores_config_travis.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
{
88
"name": "NUCLEO_L031K6",
99
"options": "opt=oslto"
10+
},
11+
{
12+
"name": "STM32MP157A_DK1",
13+
"options": "virtio=enabled"
14+
},
15+
{
16+
"name": "STM32MP157C_DK2",
17+
"options": "virtio=generic"
1018
}
1119
],
1220
"sketches": [

CI/build/examples/BareMinimum/BareMinimum.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ SoftwareSerial swSerial(10, 11);
4242

4343
void setup() {
4444
// Serial HW & SW
45-
#if !defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)
45+
#if (!defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)) &&\
46+
(!defined(VIRTIOCON) && !defined(DISABLE_GENERIC_SERIALVIRTIO))
4647
Serial.setRx(PIN_SERIAL_RX);
4748
Serial.setTx(digitalPinToPinName(PIN_SERIAL_TX));
4849
#endif

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
9494
| :yellow_heart: | [STM32G0316-DISCO](https://www.st.com/en/evaluation-tools/stm32g0316-disco.html) | **1.9.0** | |
9595
| :green_heart: | [B-L072Z-LRWAN1](http://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html) | *1.1.0* | |
9696
| :green_heart: | [B-L475E-IOT01A](http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html) | *1.0.1* | |
97+
| :yellow_heart: | [32F413HDISCOVERY](https://www.st.com/en/evaluation-tools/32f413hdiscovery.html) | **1.9.0** | |
9798

9899
| Status | [Eval](https://www.st.com/en/evaluation-tools/stm32-eval-boards.html) | Release | Comment |
99100
| :---: | --- | :---: | :--- |
@@ -170,6 +171,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
170171
| :green_heart: | [RUMBA32](https://github.com/Aus3D/RUMBA32) | *1.5.0* | |
171172
| :green_heart: | [STEVAL-3DP001V1](https://www.st.com/en/evaluation-tools/steval-3dp001v1.html) | *1.6.0* | |
172173
| :green_heart: | [VAkE v1.0](https://www.facebook.com/pages/category/Product-Service/VAkE-Board-2290066274575218/) | *1.6.0* | |
174+
| :yellow_heart: | [FYSETC_S6](https://wiki.fysetc.com/FYSETC_S6/) | **1.9.0** | |
173175

174176
| Status | LoRa boards | Release | Comment |
175177
| :---: | --- | :---: | :--- |

boards.txt

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ menu.pnum=Board part number
55
menu.xserial=U(S)ART support
66
menu.usb=USB support (if available)
77
menu.xusb=USB speed (if available)
8+
menu.virtio=Virtual serial support
89

910
menu.opt=Optimize
1011
menu.rtlib=C Runtime Library
@@ -592,6 +593,19 @@ Disco.menu.pnum.DISCO_F407VG.build.product_line=STM32F407xx
592593
Disco.menu.pnum.DISCO_F407VG.build.variant=DISCO_F407VG
593594
Disco.menu.pnum.DISCO_F407VG.build.cmsis_lib_gcc=arm_cortexM4lf_math
594595

596+
# DISCO_F413ZH board
597+
Disco.menu.pnum.DISCO_F413ZH=STM32F413H-DISCO
598+
Disco.menu.pnum.DISCO_F413ZH.node=DIS_F413ZH
599+
Disco.menu.pnum.DISCO_F413ZH.upload.maximum_size=1572864
600+
Disco.menu.pnum.DISCO_F413ZH.upload.maximum_data_size=327680
601+
Disco.menu.pnum.DISCO_F413ZH.build.mcu=cortex-m4
602+
Disco.menu.pnum.DISCO_F413ZH.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
603+
Disco.menu.pnum.DISCO_F413ZH.build.board=DISCO_F413ZH
604+
Disco.menu.pnum.DISCO_F413ZH.build.series=STM32F4xx
605+
Disco.menu.pnum.DISCO_F413ZH.build.product_line=STM32F413xx
606+
Disco.menu.pnum.DISCO_F413ZH.build.variant=DISCO_F413ZH
607+
Disco.menu.pnum.DISCO_F413ZH.build.cmsis_lib_gcc=arm_cortexM4lf_math
608+
595609
# DISCO_F746NG board
596610
Disco.menu.pnum.DISCO_F746NG=STM32F746G-DISCOVERY
597611
Disco.menu.pnum.DISCO_F746NG.node=DIS_F746NG
@@ -707,7 +721,7 @@ STM32MP1.build.mcu=cortex-m4
707721
STM32MP1.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
708722
STM32MP1.build.series=STM32MP1xx
709723
STM32MP1.build.cmsis_lib_gcc=arm_cortexM4l_math
710-
STM32MP1.build.extra_flags=-DCORE_CM4 -DUSE_FULL_LL_DRIVER -D{build.product_line} {build.xSerial}
724+
STM32MP1.build.extra_flags=-DCORE_CM4 -DUSE_FULL_LL_DRIVER -D{build.product_line} {build.enable_virtio} {build.xSerial}
711725

712726
# STM32MP157A-DK1 board
713727
STM32MP1.menu.pnum.STM32MP157A_DK1=STM32MP157A-DK1
@@ -1576,8 +1590,8 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
15761590

15771591
# ARMED_V1 board
15781592
3dprinter.menu.pnum.ARMED_V1=Armed V1
1579-
3dprinter.menu.pnum.ARMED_V1.upload.maximum_size=1048576
1580-
3dprinter.menu.pnum.ARMED_V1.upload.maximum_data_size=196608
1593+
3dprinter.menu.pnum.ARMED_V1.upload.maximum_size=524288
1594+
3dprinter.menu.pnum.ARMED_V1.upload.maximum_data_size=131072
15811595
3dprinter.menu.pnum.ARMED_V1.build.mcu=cortex-m4
15821596
3dprinter.menu.pnum.ARMED_V1.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
15831597
3dprinter.menu.pnum.ARMED_V1.build.board=ARMED_V1
@@ -1711,6 +1725,20 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
17111725
3dprinter.menu.pnum.VAKE_F446VE.build.variant=VAKE_F446VE
17121726
3dprinter.menu.pnum.VAKE_F446VE.build.cmsis_lib_gcc=arm_cortexM4lf_math
17131727

1728+
# FYSETC_S6 board
1729+
3dprinter.menu.pnum.FYSETC_S6=FYSETC_S6
1730+
3dprinter.menu.pnum.FYSETC_S6.upload.maximum_size=458752
1731+
3dprinter.menu.pnum.FYSETC_S6.upload.maximum_data_size=131072
1732+
3dprinter.menu.pnum.FYSETC_S6.build.mcu=cortex-m4
1733+
3dprinter.menu.pnum.FYSETC_S6.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
1734+
3dprinter.menu.pnum.FYSETC_S6.build.board=FYSETC_S6
1735+
3dprinter.menu.pnum.FYSETC_S6.build.series=STM32F4xx
1736+
3dprinter.menu.pnum.FYSETC_S6.build.product_line=STM32F446xx
1737+
3dprinter.menu.pnum.FYSETC_S6.build.variant=FYSETC_S6
1738+
3dprinter.menu.pnum.FYSETC_S6.build.cmsis_lib_gcc=arm_cortexM4lf_math
1739+
3dprinter.menu.pnum.MALYANM300_F070CB.build.flash_offset=0x10000
1740+
3dprinter.menu.pnum.MALYANM200_F070CB.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} -DVECT_TAB_OFFSET={build.flash_offset}
1741+
17141742
# Upload menu
17151743
3dprinter.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
17161744
3dprinter.menu.upload_method.swdMethod.upload.protocol=0
@@ -1886,6 +1914,13 @@ Eval.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
18861914
Eval.menu.xserial.disabled=Disabled (no Serial support)
18871915
Eval.menu.xserial.disabled.build.xSerial=
18881916

1917+
STM32MP1.menu.virtio.disable=Disabled (no SerialVirtIO nor /dev/ttyRPMSG0 available)
1918+
STM32MP1.menu.virtio.disable.build.enable_virtio=
1919+
STM32MP1.menu.virtio.generic=SerialVirtIO (= generic 'Serial') <=> /dev/ttyRPMSG0
1920+
STM32MP1.menu.virtio.generic.build.enable_virtio={build.virtio_flags}
1921+
STM32MP1.menu.virtio.enabled=SerialVirtIO <=> /dev/ttyRPMSG0
1922+
STM32MP1.menu.virtio.enabled.build.enable_virtio={build.virtio_flags} -DDISABLE_GENERIC_SERIALVIRTIO
1923+
18891924
STM32MP1.menu.xserial.generic=UART only (generic 'Serial')
18901925
STM32MP1.menu.xserial.generic.build.xSerial=-DHAL_UART_MODULE_ENABLED
18911926
STM32MP1.menu.xserial.none=UART only (no generic 'Serial')

cores/arduino/Arduino.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#ifdef __cplusplus
4141
extern "C" {
4242
#endif // __cplusplus
43+
// Weak empty variant initialization function.
44+
// May be redefined by variant files.
45+
extern void initVariant() __attribute__((weak));
46+
4347
extern void setup(void) ;
4448
extern void loop(void) ;
4549

cores/arduino/Print.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
#include "Print.h"
3030

31+
#if defined (VIRTIO_LOG)
32+
#include "virtio_log.h"
33+
#endif
34+
3135
// Public Methods //////////////////////////////////////////////////////////////
3236

3337
/* default implementation: may be overridden */
@@ -203,10 +207,13 @@ extern "C" {
203207
switch (file) {
204208
case STDOUT_FILENO:
205209
case STDERR_FILENO:
206-
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
207210
/* Used for core_debug() */
211+
#if defined (VIRTIO_LOG)
212+
virtio_log((uint8_t *)ptr, (uint32_t)len);
213+
#elif defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
208214
uart_debug_write((uint8_t *)ptr, (uint32_t)len);
209215
#endif
216+
break;
210217
case STDIN_FILENO:
211218
break;
212219
default:

0 commit comments

Comments
 (0)