Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/workflows/Arduino-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
steps:
# First of all, clone the repo using the checkout action.
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@main
with:
submodules: true

- name: Compilation
id: Compile
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/Cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@main
with:
submodules: true

- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/PIO-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
# First of all, clone the repo using the checkout action.
- name: Checkout
uses: actions/checkout@main
with:
submodules: true

- name: PlatformIO
id: Compile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/astyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
# First of all, clone the repo using the checkout action.
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Astyle check
id: Astyle
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "cores/arduino/api"]
path = cores/arduino/api
url = https://github.com/stm32duino/ArduinoCore-API.git
branch = main
3 changes: 2 additions & 1 deletion CI/astyle/.astyleignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.git
BUILD
CI
system
system
cores/arduino/api
110 changes: 10 additions & 100 deletions CI/build/examples/BareMinimum/BareMinimum.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,9 @@
* and can not be executed.
*/

#include <EEPROM.h>
#ifndef STM32MP1xx
#include <IWatchdog.h>
#endif
#ifdef TIMER_SERVO
#include <Servo.h>
#endif
#include <SPI.h>
#include <SoftwareSerial.h>
#include <Wire.h>

#include <CMSIS_DSP.h>
/* ----------------------------------------------------------------------
Defines each of the tests performed
------------------------------------------------------------------- */
#define MAX_BLOCKSIZE 2
#define DELTA (0.0001f)
/* ----------------------------------------------------------------------
Test input data for Floating point sin_cos example for 32-blockSize
Generated by the MATLAB randn() function
------------------------------------------------------------------- */
const float32_t testInput_f32[MAX_BLOCKSIZE] = {
-1.244916875853235400, -4.793533929171324800
};
const float32_t testRefOutput_f32 = 1.000000000;
/* ----------------------------------------------------------------------
Declare Global variables
------------------------------------------------------------------- */
uint32_t blockSize = 2;
float32_t testOutput;
float32_t cosOutput;
float32_t sinOutput;
float32_t cosSquareOutput;
float32_t sinSquareOutput;
/* ----------------------------------------------------------------------
Max magnitude FFT Bin test
------------------------------------------------------------------- */
arm_status status;
/* CMSIS_DSP */

#ifndef USER_BTN
#define USER_BTN 2
#endif
Expand All @@ -64,9 +27,6 @@ arm_status status;
HardwareSerial Serial(PIN_SERIAL_RX, PIN_SERIAL_TX);
#endif

#ifdef TIMER_SERVO
Servo servo;
#endif
SoftwareSerial swSerial(10, 11);

void setup() {
Expand All @@ -78,49 +38,18 @@ void setup() {
Serial.begin(9600); // start serial for output
while (!Serial) {};

// Test SoftwareSerial
swSerial.begin(4800);
swSerial.write("x");
if (!swSerial.isListening()) {
swSerial.listen();
if (swSerial.available()) {
swSerial.read();
}
swSerial.println("X");
delay(20);
while (swSerial.available()) {
int c = swSerial.read();
Serial.print("swSerial read: ");
Serial.println((char)c);
}
swSerial.end();

// EEPROM
byte value = EEPROM.read(0x01);
EEPROM.write(EEPROM.length() - 1, value);

#ifndef STM32MP1xx
// IWDG
if (!IWatchdog.isReset(true)) {
IWatchdog.begin(10000000);
IWatchdog.isEnabled();
}
IWatchdog.reload();
#endif

#ifdef TIMER_SERVO
// Servo
servo.attach(3, 900, 2100);
servo.write(1500);
servo.detach();
#endif

// SPI
SPISettings settings(SPI_SPEED_CLOCK_DEFAULT, MSBFIRST, SPI_MODE0);
SPI.setMISO(PIN_SPI_MISO);
SPI.setMOSI(PIN_SPI_MOSI);
SPI.setSCLK(PIN_SPI_SCK);
SPI.setSSEL(digitalPinToPinName(PIN_SPI_SS));
SPI.begin();
SPI.beginTransaction(settings);
SPI.endTransaction();
SPI.transfer(1);
SPI.end();

// Wire
// Wire
Wire.setSCL(PIN_WIRE_SCL);
Wire.setSDA(digitalPinToPinName(PIN_WIRE_SDA));
Wire.setClock(400000);
Expand All @@ -132,27 +61,6 @@ void setup() {
Wire.requestFrom(2, 1);
Wire.end();

// CMSIS DSP
float32_t diff;
for (uint32_t i = 0; i < blockSize; i++) {
cosOutput = arm_cos_f32(testInput_f32[i]);
sinOutput = arm_sin_f32(testInput_f32[i]);
arm_mult_f32(&cosOutput, &cosOutput, &cosSquareOutput, 1);
arm_mult_f32(&sinOutput, &sinOutput, &sinSquareOutput, 1);
arm_add_f32(&cosSquareOutput, &sinSquareOutput, &testOutput, 1);
/* absolute value of difference between ref and test */
diff = fabsf(testRefOutput_f32 - testOutput);
/* Comparison of sin_cos value with reference */
status = (diff > DELTA) ? ARM_MATH_TEST_FAILURE : ARM_MATH_SUCCESS;
if (status == ARM_MATH_TEST_FAILURE) {
break;
}
}
if (status != ARM_MATH_SUCCESS) {
Serial.printf("FAILURE\n");
} else {
Serial.printf("SUCCESS\n");
}
}

void loop() {
Expand All @@ -171,3 +79,5 @@ void receiveEvent(int) {
void requestEvent() {
Wire.write("x");
}


11 changes: 6 additions & 5 deletions CI/build/examples/BareMinimum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.21)
# STEP 1: set up bases of environment
# -----------------------------------------------------------------------------


file(REAL_PATH "../../../../" CORE_PATH EXPAND_TILDE)
file(TO_CMAKE_PATH "${CORE_PATH}" CORE_PATH)

Expand Down Expand Up @@ -41,11 +42,11 @@ build_sketch(TARGET "BareMinimum"
SOURCES
BareMinimum.ino
DEPENDS
CMSIS_DSP
EEPROM
IWatchdog
Servo
# CMSIS_DSP
# EEPROM
# IWatchdog
# Servo
SoftwareSerial
SPI
# SPI
Wire
)
2 changes: 1 addition & 1 deletion CI/codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[codespell]
check-filenames =
check-hidden =
skip = ./.git,./CI,./system/Drivers,./system/Middlewares
skip = ./.git,./CI,./system/Drivers,./system/Middlewares,./cores/arduino/api
ignore-words = ./CI/codespell/.codespellignore
Loading