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/Aymane-ST/ArduinoCore-API.git
branch = dev
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
162 changes: 0 additions & 162 deletions CI/build/examples/BareMinimum/BareMinimum.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,171 +3,9 @@
* It allows to test build of built-in libraries
* 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

#ifndef LED_BUILTIN
#define LED_BUILTIN 13
#endif

#ifndef PIN_SERIAL_RX
#define PIN_SERIAL_RX 0
#endif

#ifndef PIN_SERIAL_TX
#define PIN_SERIAL_TX 1
#endif

#ifndef Serial
HardwareSerial Serial(PIN_SERIAL_RX, PIN_SERIAL_TX);
#endif

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

void setup() {
// Serial HW & SW
#if (!defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)) && (!defined(VIRTIOCON) && !defined(DISABLE_GENERIC_SERIALVIRTIO))
Serial.setRx(PIN_SERIAL_RX);
Serial.setTx(digitalPinToPinName(PIN_SERIAL_TX));
#endif
Serial.begin(9600); // start serial for output
while (!Serial) {};

swSerial.begin(4800);
swSerial.write("x");
if (!swSerial.isListening()) {
swSerial.listen();
if (swSerial.available()) {
swSerial.read();
}
}
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.setSCL(PIN_WIRE_SCL);
Wire.setSDA(digitalPinToPinName(PIN_WIRE_SDA));
Wire.setClock(400000);
Wire.begin(4);
Wire.onRequest(requestEvent);
Wire.onReceive(receiveEvent);
Wire.beginTransmission(4);
Wire.endTransmission();
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() {
}

// Wire
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int) {
while (1 < Wire.available()) {
Wire.read();
}
}
// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
Wire.write("x");
}
18 changes: 10 additions & 8 deletions CI/build/examples/BareMinimum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cmake_minimum_required(VERSION 3.21)
# STEP 1: set up bases of environment
# -----------------------------------------------------------------------------

add_definitions(-DEXTENDED_PIN_MODE)

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

Expand Down Expand Up @@ -40,12 +42,12 @@ include(build_sketch)
build_sketch(TARGET "BareMinimum"
SOURCES
BareMinimum.ino
DEPENDS
CMSIS_DSP
EEPROM
IWatchdog
Servo
SoftwareSerial
SPI
Wire
# DEPENDS
# CMSIS_DSP
# EEPROM
# IWatchdog
# Servo
# SoftwareSerial
# 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