Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for STM32 #302

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6de22f6
initial test for support for STM32
naichenzhao Nov 7, 2023
256abcc
Point to lingua-franca stm32 branch
lhstrh Nov 7, 2023
92fcfbe
fixed typo
naichenzhao Nov 11, 2023
dca5be8
please merge
naichenzhao Nov 11, 2023
89986a9
hard coded STM32 support
naichenzhao Nov 11, 2023
436b36b
we dont need STM_main anymore
naichenzhao Nov 19, 2023
bcbbf43
updated files to move stuff out of core cmake
naichenzhao Nov 22, 2023
48be057
fixed printing
naichenzhao Dec 7, 2023
31d62b2
changed naming
naichenzhao Dec 18, 2023
73aea2e
updated sleep functions
naichenzhao Jul 15, 2024
7899e6b
updated delay functions
naichenzhao Jul 15, 2024
d11f3ff
rebased in main
naichenzhao Aug 5, 2024
58d2323
change
naichenzhao Aug 5, 2024
5ae3be6
fixed typo
naichenzhao Nov 11, 2023
4bb9231
bruh
naichenzhao Aug 5, 2024
9527537
we dont need STM_main anymore
naichenzhao Nov 19, 2023
8a97bcd
changes
naichenzhao Aug 5, 2024
c46fbcc
fixed printing
naichenzhao Dec 7, 2023
b3097a8
changed naming
naichenzhao Dec 18, 2023
f92307f
updated sleep functions
naichenzhao Jul 15, 2024
f2554dd
updated delay functions
naichenzhao Jul 15, 2024
03124a5
merge
naichenzhao Aug 5, 2024
6d2964c
Merge branch 'stm32' of github.com:lf-lang/reactor-c into stm32
naichenzhao Aug 5, 2024
13ca0d8
Merge branch 'main' of github.com:lf-lang/reactor-c into stm32
naichenzhao Aug 31, 2024
cd0c9c1
quick commit
naichenzhao Aug 31, 2024
6d8d4db
Suppress unused parameter error
edwardalee Aug 9, 2024
bb75db6
Suppress unused parameter error
edwardalee Aug 9, 2024
6a66f47
deleted artifact from rebase
naichenzhao Aug 31, 2024
a285e52
works with newest version
naichenzhao Aug 31, 2024
6ba0f42
did formatting
naichenzhao Sep 7, 2024
a22a4fd
Update low_level_platform/api/platform/lf_STM32f4_support.h
naichenzhao Sep 16, 2024
42fc271
Update low_level_platform/api/platform/lf_STM32f4_support.h
naichenzhao Sep 16, 2024
895a8fb
Update low_level_platform/impl/src/lf_STM32f4_support.c
naichenzhao Sep 16, 2024
0d3af6d
Update low_level_platform/api/platform/lf_STM32f4_support.h
naichenzhao Sep 16, 2024
50603d7
Update low_level_platform/impl/src/lf_STM32f4_support.c
naichenzhao Sep 16, 2024
cba9193
resolved some more comments
naichenzhao Sep 17, 2024
cf36f59
changed macro
naichenzhao Sep 24, 2024
6e9e3c7
Merge branch 'main' into stm32
naichenzhao Oct 4, 2024
6974d8e
Merge branch 'main' into stm32
naichenzhao Oct 5, 2024
a2e1e4b
Merge branch 'stm32' of https://github.com/lf-lang/reactor-c into stm32
naichenzhao Oct 5, 2024
68ec2d7
Run clang-format
erlingrj Oct 5, 2024
2d23659
Update lf-ref to the new lf branch
erlingrj Oct 5, 2024
128e9a4
Merge branch 'main' into stm32
erlingrj Oct 29, 2024
22b871d
Refactor comments
erlingrj Oct 29, 2024
68bd26a
Dont rely on hardcoded relative path to the "STM_SDK"
erlingrj Oct 29, 2024
335d52b
Remove all the STM32 cmake setup from reactor-c. This happens outside
erlingrj Nov 5, 2024
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
Prev Previous commit
Next Next commit
resolved some more comments
naichenzhao committed Sep 17, 2024
commit cba919356d55bf0a36b3a94b56da2bacb5f41dae
25 changes: 8 additions & 17 deletions low_level_platform/impl/src/lf_STM32f4_support.c
Original file line number Diff line number Diff line change
@@ -102,20 +102,6 @@ int lf_sleep(interval_t sleep_duration) {
return 0;
}

/**
* Make the STM32 sleep for set nanoseconds
* Based on the lf_nrf52 support implementation
*/
static void lf_busy_wait_until(instant_t wakeup_time) {
instant_t current_time;
_lf_clock_gettime(&current_time);

// We repurpose the lf_sleep function here, just to better streamline the code
interval_t sleep_duration = wakeup_time - current_time;
lf_sleep(sleep_duration);
}

// I am pretty sure this function doesnt work
/* sleep until wakeup time but wake up if there is an async event
*/
int _lf_interruptable_sleep_until_locked(environment_t* env, instant_t wakeup_time) {
@@ -128,7 +114,12 @@ int _lf_interruptable_sleep_until_locked(environment_t* env, instant_t wakeup_ti
if (duration <= 0) {
return 0;
} else if (duration < LF_MIN_SLEEP_NS) {
lf_busy_wait_until(wakeup_time);
instant_t current_time;
_lf_clock_gettime(&current_time);

// We repurpose the lf_sleep function here, just to better streamline the code
interval_t sleep_duration = wakeup_time - current_time;
lf_sleep(sleep_duration);
return 0;
}

@@ -167,7 +158,7 @@ int lf_disable_interrupts_nested() {
return 0;
}

// enables the IRQ (checks if other programs still want it disabled first)
// enables the IRQ (checks if other processes still want it disabled first)
int lf_enable_interrupts_nested() {
// Left the critical section more often than it was entered.

@@ -178,7 +169,7 @@ int lf_enable_interrupts_nested() {
// update the depth of disabling interrupts
_lf_num_nested_crit_sec--;

// If we have exited all important programs, we can enable them again
// We enable interrupts again
if (_lf_num_nested_crit_sec == 0) {
__enable_irq();
}

Unchanged files with check annotations Beta

ARG BASEIMAGE=alpine:latest
FROM ${BASEIMAGE} as builder

Check warning on line 2 in core/federated/RTI/rti.Dockerfile

GitHub Actions / build-rti / docker-build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
COPY . /lingua-franca
WORKDIR /lingua-franca/core/federated/RTI
RUN set -ex && apk add --no-cache gcc musl-dev cmake make && \
WORKDIR /lingua-franca
# application stage
FROM ${BASEIMAGE} as app

Check warning on line 15 in core/federated/RTI/rti.Dockerfile

GitHub Actions / build-rti / docker-build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
LABEL maintainer="lf-lang"
LABEL source="https://github.com/lf-lang/reactor-c/tree/main/core/federated/RTI"
COPY --from=builder /usr/local/bin/RTI /usr/local/bin/RTI