Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
e2af8c5
Initial structure
jorgesg82 Nov 30, 2025
3eec305
no need to have an id for instance
jorgesg82 Nov 30, 2025
fa3498b
erased no longer needed code
jorgesg82 Dec 1, 2025
c92a738
Added DigitalInput and DigitalOutput Services, and added support for …
jorgesg82 Dec 2, 2025
9dc516b
Replaced throw by undefined function
jorgesg82 Dec 8, 2025
d9263fe
Implemented alternate functions
jorgesg82 Dec 8, 2025
4cd2796
Added linker script and startup code, and fixed using hal template conf
jorgesg82 Dec 8, 2025
c4748dd
Added initial GPIO mock
jorgesg82 Dec 9, 2025
c440540
feat(MPU): Initial structure && design of the API
FoniksFox Dec 10, 2025
3286140
fix(MPU): Bug fixing (MPU subregion calculation, throws and alignment…
FoniksFox Dec 10, 2025
755fd4b
fix(MPU): Minor bug fixes (missing std::, incorrect subregion mask)
FoniksFox Dec 10, 2025
1b5c8fe
feat(MPU): Initial implementation of MPUManager refactor
FoniksFox Dec 12, 2025
ed0a65a
feat(MPU)!: Bug fixing and changes on the infrastructure to allow pro…
FoniksFox Dec 12, 2025
aa7dddc
reafactor(MPU): Support legacy MPUManager without conflicts
FoniksFox Dec 12, 2025
3f826bd
fix(MPU): Remove MPUManager start call from HALAL init
FoniksFox Dec 12, 2025
6c28294
feat(MPU): Modify linker scripts for MPU configuration
FoniksFox Dec 12, 2025
4352de3
fix(MPU): Remove legacy things
FoniksFox Dec 12, 2025
5d0dbd0
fix(MPU): Fix legacy MPUManager
FoniksFox Dec 12, 2025
a365558
fix(MPU): Fix no buffer array of size zero issue
FoniksFox Dec 12, 2025
d40a213
fix(MPU): Fix ST-LIB so that it accepts templated objects for MPU buf…
FoniksFox Dec 12, 2025
6e8eac8
feat(MPU): Add concepts and safer interface
FoniksFox Dec 13, 2025
f0f99ec
feat(MPU): Make construct method return a reference instead of pointer
FoniksFox Dec 13, 2025
6410c72
fix(MPU): Relax constraints on MPU buffers to allow trivially destruc…
FoniksFox Dec 13, 2025
2a291dc
style(MPU): Better wording and documentation
FoniksFox Dec 13, 2025
846d52d
feat(MPU): Make MPU ultra restrictive, should check that there's no r…
FoniksFox Dec 13, 2025
ae01749
feat(Sd): Initial implementation of the infrastructure for Sd
FoniksFox Dec 14, 2025
965d704
fix(Sd): Fix syntax errors
FoniksFox Dec 14, 2025
a0b09be
feat(Sd): Add Sd to ST-LIB
FoniksFox Dec 14, 2025
efb806d
feat(Sd): Receive CD and WP pin active states
FoniksFox Dec 14, 2025
f2845c1
feat(Sd): Full implementation of the class
FoniksFox Dec 14, 2025
a66a886
fix(Sd): Sd buffers use D1 memory
FoniksFox Dec 14, 2025
a78d46a
fix(Sd): Configure card speed
FoniksFox Dec 14, 2025
44e9a23
feat(Sd): Add debug mode
FoniksFox Dec 14, 2025
e6d9715
fix(Sd): Configure cd and wp pins in init
FoniksFox Dec 14, 2025
448649c
fix(Sd): Ensure
FoniksFox Dec 14, 2025
fddd13c
fix(Sd): Mismatched pointer and handle
FoniksFox Dec 14, 2025
aaedb24
fix(Sd): General small fixes
FoniksFox Dec 14, 2025
628f998
fix(Sd): General bugfixing
FoniksFox Dec 14, 2025
4879967
fix(Sd): Minor fixes
FoniksFox Dec 14, 2025
20d2b63
Merge branch 'development' into refactor/MPUManager
FoniksFox Dec 15, 2025
72f4ff0
fix(Sd): Change throw to compile_error for better compile-time checks
FoniksFox Dec 16, 2025
a80582e
fix(Sd): Private accesibility things
FoniksFox Dec 16, 2025
ea5344d
fix(Sd): Fix inline issue and add dependencies to CMakeLists.txt
FoniksFox Dec 16, 2025
19ae0ff
fix(Sd): Fix GPIO configuration for SD card
FoniksFox Dec 16, 2025
55cb1b4
fix(Sd): General bug fixing
FoniksFox Dec 16, 2025
40fc216
fix(Sd): Move things to cpp and circular dependency fix
FoniksFox Dec 16, 2025
c1be258
fix(Sd): General bugfixing, now works
FoniksFox Dec 16, 2025
17a92ba
fix(Sd): The Sd is too finicky, it needs it's freaking time
FoniksFox Dec 16, 2025
ad4bda0
fixed getting wrong instance
jorgesg82 Dec 16, 2025
328cca0
marked indexs as mutable
jorgesg82 Dec 16, 2025
285ee2c
Merge remote-tracking branch 'origin/fix/compile-infrastructure' into…
FoniksFox Dec 17, 2025
804e7b9
fix(MPU): Implemente st-lib fix
FoniksFox Dec 17, 2025
3385235
Merge branch 'refactor/MPUManager' into feat/Sd
FoniksFox Dec 17, 2025
a58ffdb
fix(Sd): Implemenent st-lib fix
FoniksFox Dec 17, 2025
e74ed39
fix(Sd): Validate pin selection for SDMMC1
FoniksFox Dec 17, 2025
3edf7d5
style(Sd): Move things to .cpp and small style fixes
FoniksFox Dec 17, 2025
f47c0ba
feat(Sd): Don't use a timeout but just return false if sd not ready
FoniksFox Dec 17, 2025
616d579
fix(Sd): Check that not too many blocks are being requested for write…
FoniksFox Dec 17, 2025
13589f1
fix(Sd): Typo
FoniksFox Dec 17, 2025
c768655
fix(Sd): Check limit of blocks
FoniksFox Dec 17, 2025
25f1ba8
fix(Sd): Unnecesary operation
FoniksFox Dec 17, 2025
f27035c
Fixed instance_of method. Now add interface needs the Device
jorgesg82 Dec 17, 2025
7250221
Merge branch 'fix/compile-infrastructure' into refactor/MPUManager
FoniksFox Dec 18, 2025
ae95584
fix(MPU): Apply the fix of the fix
FoniksFox Dec 18, 2025
7cdea70
fix(Sd): Use correct callbacks
FoniksFox Dec 18, 2025
9be539b
Merge branch 'refactor/MPUManager' into feat/Sd
FoniksFox Dec 18, 2025
91ca16f
fix(Sd): Fix the fix of the st-lib
FoniksFox Dec 18, 2025
33bb954
fix(MPU): Make the MPUManager take it's buffer pointer from a linker …
FoniksFox Dec 25, 2025
c95ba10
Merge branch 'refactor/MPUManager' into feat/Sd
FoniksFox Dec 25, 2025
4716014
fix(Sd): Fix pin validation logic
FoniksFox Dec 25, 2025
f6852b5
fix(Sd): Fix incorrect error message
FoniksFox Dec 25, 2025
ba51d6a
style(Sd): Better wording
FoniksFox Dec 25, 2025
42a3b99
style(MPU): Remove comment
FoniksFox Dec 25, 2025
1f833af
Merge branch 'refactor/MPUManager' into feat/Sd
FoniksFox Dec 25, 2025
ea97e13
Merge branch 'development' into feat/Sd
FoniksFox Jan 22, 2026
8be22d3
feat(Sd): Minor update
FoniksFox Jan 22, 2026
a983f13
fix(Sd): Fix DomainsCtx and reorder MPUDomain things in ST-LIB.hpp
FoniksFox Jan 23, 2026
dc91400
fix(Sd): Fix small things
FoniksFox Jan 23, 2026
f0d7689
fix(Sd): Remove duplicated global variables in Sd.cpp
FoniksFox Jan 23, 2026
2926df3
Merge remote-tracking branch 'origin/development' into feat/Sd
FoniksFox Jan 23, 2026
f600a43
fix(MPU): Reorder includes
FoniksFox Jan 23, 2026
2e2cda9
fix(Sd): Correct SDMMC clock divider calculation and enable hardware …
FoniksFox Jan 24, 2026
d2dca9a
Merge remote-tracking branch 'origin/development' into feat/Sd
FoniksFox Jan 26, 2026
141df9f
fix(Sd): Use inscribe for MPU buffers
FoniksFox Jan 27, 2026
479d242
fix(Sd): Delete artifact file
FoniksFox Jan 27, 2026
b877df4
fix(Sd): Remove artifact of merge
FoniksFox Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ if(CMAKE_CROSSCOMPILING)
# SD
${HAL_DRIVER_SRC_DIR}/stm32h7xx_hal_sd.c
${HAL_DRIVER_SRC_DIR}/stm32h7xx_hal_sd_ex.c
${HAL_DRIVER_SRC_DIR}/stm32h7xx_ll_sdmmc.c

# CAN / FDCAN
${HAL_DRIVER_SRC_DIR}/stm32h7xx_hal_fdcan.c
Expand Down
23 changes: 16 additions & 7 deletions Inc/ST-LIB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ template <typename... Domains> struct BuildCtx {

using DomainsCtx = BuildCtx<MPUDomain, GPIODomain, TimerDomain,
DigitalOutputDomain,
DigitalInputDomain /*, ADCDomain, PWMDomain, ...*/>;
DigitalInputDomain,
SdDomain /*, ADCDomain, PWMDomain, ...*/>;

template <auto &...devs> struct Board {
static consteval auto build_ctx() {
Expand All @@ -101,23 +102,27 @@ template <auto &...devs> struct Board {
}

static consteval auto build() {
constexpr std::size_t mpuN = domain_size<MPUDomain>();
constexpr std::size_t gpioN = domain_size<GPIODomain>();
constexpr std::size_t timN = domain_size<TimerDomain>();
constexpr std::size_t doutN = domain_size<DigitalOutputDomain>();
constexpr std::size_t dinN = domain_size<DigitalInputDomain>();
constexpr std::size_t mpuN = domain_size<MPUDomain>();
constexpr std::size_t sdN = domain_size<SdDomain>();
// ...

struct ConfigBundle {
std::array<MPUDomain::Config, mpuN> mpu_cfgs;
std::array<GPIODomain::Config, gpioN> gpio_cfgs;
std::array<TimerDomain::Config, timN> tim_cfgs;
std::array<DigitalOutputDomain::Config, doutN> dout_cfgs;
std::array<DigitalInputDomain::Config, dinN> din_cfgs;
std::array<MPUDomain::Config, mpuN> mpu_cfgs;
std::array<SdDomain::Config, sdN> sd_cfgs;
// ...
};

return ConfigBundle{
.mpu_cfgs = MPUDomain::template build<mpuN>(
ctx.template span<MPUDomain>()),
.gpio_cfgs =
GPIODomain::template build<gpioN>(ctx.template span<GPIODomain>()),
.tim_cfgs =
Expand All @@ -126,29 +131,33 @@ template <auto &...devs> struct Board {
ctx.template span<DigitalOutputDomain>()),
.din_cfgs = DigitalInputDomain::template build<dinN>(
ctx.template span<DigitalInputDomain>()),
.mpu_cfgs = MPUDomain::template build<mpuN>(
ctx.template span<MPUDomain>())
.sd_cfgs = SdDomain::template build<sdN>(
ctx.template span<SdDomain>()),
// ...
};
}

static constexpr auto cfg = build();

static void init() {
constexpr std::size_t mpuN = domain_size<MPUDomain>();
constexpr std::size_t gpioN = domain_size<GPIODomain>();
constexpr std::size_t timN = domain_size<TimerDomain>();
constexpr std::size_t doutN = domain_size<DigitalOutputDomain>();
constexpr std::size_t dinN = domain_size<DigitalInputDomain>();
constexpr std::size_t mpuN = domain_size<MPUDomain>();
constexpr std::size_t sdN = domain_size<SdDomain>();
// ...

MPUDomain::Init<mpuN, cfg.mpu_cfgs>::init();
GPIODomain::Init<gpioN>::init(cfg.gpio_cfgs);
TimerDomain::Init<timN>::init(cfg.tim_cfgs);
DigitalOutputDomain::Init<doutN>::init(cfg.dout_cfgs,
GPIODomain::Init<gpioN>::instances);
DigitalInputDomain::Init<dinN>::init(cfg.din_cfgs,
GPIODomain::Init<gpioN>::instances);
MPUDomain::Init<mpuN, cfg.mpu_cfgs>::init();
SdDomain::Init<sdN>::init(cfg.sd_cfgs,
MPUDomain::Init<mpuN, cfg.mpu_cfgs>::instances,
DigitalInputDomain::Init<dinN>::instances);
// ...
}

Expand Down
2 changes: 2 additions & 0 deletions Inc/ST-LIB_LOW/ST-LIB_LOW.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "ST-LIB_LOW/DigitalOutput2.hpp"
#include "ST-LIB_LOW/DigitalInput2.hpp"

#include "ST-LIB_LOW/Sd/Sd.hpp"

#include "Clocks/Counter.hpp"
#include "Clocks/Stopwatch.hpp"
#include "Sensors/LinearSensor/LinearSensor.hpp"
Expand Down
Loading