Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
ci-format:
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-24.04]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

Expand All @@ -23,12 +23,14 @@ jobs:
with:
submodules: false # LVGL makefile manually installs the submodule
- name: ci-format
env:
TOCK_SUPPRESS_CC_VERSION_CHECK: "true"
run: pushd examples; ./format_all.sh || exit; popd

ci-build:
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-24.04]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

Expand All @@ -37,11 +39,18 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive

- uses: carlosperate/arm-none-eabi-gcc-action@v1
- run: arm-none-eabi-gcc --version
- name: setup-riscv-toolchain
run: sudo apt-get install -y gcc-riscv64-unknown-elf

- name: Disable wget progress output
run: |
echo "verbose = off" >> $HOME/.wgetrc

- name: ci-build
run: pushd examples; ./build_all.sh || exit; popd

- name: ci-debug-build
run: pushd examples/blink; make debug RAM_START=0x20004000 FLASH_INIT=0x30051 || exit; popd
23 changes: 23 additions & 0 deletions Configuration.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ CONFIGURATION_MAKEFILE = 1
MAKEFLAGS += -r
MAKEFLAGS += -R

# Enforce a minimum complier version
MINIMUM_GCC_MAJOR := 13

# Toolchain programs.
AR := -ar
AS := -as
Expand Down Expand Up @@ -260,6 +263,16 @@ ifneq ($(findstring rv32i,$(TOCK_ARCH_FAMILIES)),)
CC_rv32_version_major := $(shell echo $(CC_rv32_version) | cut -f1 -d.)
endif

# Validate the the toolchain is new enough
ifeq ($(TOCK_SUPPRESS_CC_VERSION_CHECK),)
ifneq ($(CC_rv32_version),)
ifneq (1,$(shell [ $(CC_rv32_version_major) -ge $(MINIMUM_GCC_MAJOR) ] && echo "1"))
$(info $(TOOLCHAIN_rv32)$(CC_rv32) -dumpfullversion: $(CC_rv32_version))
$(error Your compiler is too old. Need gcc version >= $(MINIMUM_GCC_MAJOR))
endif
endif
endif

# Match compiler version to support libtock-newlib versions.
ifeq ($(CC_rv32_version_major),10)
NEWLIB_VERSION_rv32 := 4.2.0.20211231
Expand Down Expand Up @@ -406,6 +419,16 @@ ifneq ($(findstring cortex-m,$(TOCK_ARCH_FAMILIES)),)
CC_cortex-m_version_major := $(shell echo $(CC_cortex-m_version) | cut -f1 -d.)
endif

# Validate the the toolchain is new enough
ifeq ($(TOCK_SUPPRESS_CC_VERSION_CHECK),)
ifneq ($(CC_cortex-m_version),)
ifneq (1,$(shell [ $(CC_cortex-m_version_major) -ge $(MINIMUM_GCC_MAJOR) ] && echo "1"))
$(info $(TOOLCHAIN_cortex-m)$(CC_cortex-m) -dumpfullversion: $(CC_cortex-m_version))
$(error Your compiler is too old. Need gcc version >= $(MINIMUM_GCC_MAJOR))
endif
endif
endif

# Match compiler version to support libtock-newlib versions.
ifeq ($(CC_cortex-m_version_major),10)
NEWLIB_VERSION_cortex-m := 4.2.0.20211231
Expand Down
20 changes: 0 additions & 20 deletions Helpers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,6 @@ ifdef TOCK_USERLAND_BASE_DIR
endif
endif

# # Validate the the toolchain is new enough (known not to work for gcc <= 5.1)
# CC_VERSION_MAJOR := $(shell $(CC) -dumpversion | cut -d '.' -f1)
# ifeq (1,$(shell expr $(CC_VERSION_MAJOR) \>= 6))
# # Opportunistically turn on gcc 6.0+ warnings since we're already version checking:
# override CPPFLAGS += -Wduplicated-cond # if (p->q != NULL) { ... } else if (p->q != NULL) { ... }
# override CPPFLAGS += -Wnull-dereference # deref of NULL (thought default if -fdelete-null-pointer-checks, in -Os, but no?)
# else
# ifneq (5,$(CC_VERSION_MAJOR))
# $(info CC=$(CC))
# $(info $$(CC) -dumpversion: $(shell $(CC) -dumpversion))
# $(error Your compiler is too old. Need gcc version > 5.1)
# endif
# CC_VERSION_MINOR := $(shell $(CC) -dumpversion | cut -d '.' -f2)
# ifneq (1,$(shell expr $(CC_VERSION_MINOR) \> 1))
# $(info CC=$(CC))
# $(info $$(CC) -dumpversion: $(shell $(CC) -dumpversion))
# $(error Your compiler is too old. Need gcc version > 5.1)
# endif
# endif


# Format check rule
.PHONY: _format_check_unstaged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void sensor_callback(__attribute__ ((unused)) int pid,
__attribute__ ((unused)) int arg2,
__attribute__ ((unused)) void* ud) {
// update measured temperature
measured_temperature = *((int*) &temperature_buffer[0]);
memcpy(&measured_temperature, temperature_buffer, sizeof(measured_temperature));

// Indicate that we have received a callback.
callback_event = true;
Expand All @@ -99,7 +99,7 @@ static void openthread_callback(__attribute__ ((unused)) int pid,
network_up = true;

// update setpoint temperature
global_temperature_setpoint = *((int*) &openthread_buffer[0]);
memcpy(&global_temperature_setpoint, openthread_buffer, sizeof(global_temperature_setpoint));

// Indicate that we have received a callback.
callback_event = true;
Expand Down
10 changes: 5 additions & 5 deletions libtock/tock.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,25 +194,25 @@ yield_waitfor_return_t yield_wait_for(uint32_t driver, uint32_t subscribe);
void tock_exit(uint32_t completion_code) __attribute__ ((noreturn));
void tock_restart(uint32_t completion_code) __attribute__ ((noreturn));

__attribute__ ((warn_unused_result))
[[ nodiscard ]]
syscall_return_t command(uint32_t driver, uint32_t command, int arg1, int arg2);

// Pass this to the subscribe syscall as a function pointer to
// be the Null Upcall.
#define TOCK_NULL_UPCALL 0

__attribute__ ((warn_unused_result))
[[ nodiscard ]]
subscribe_return_t subscribe(uint32_t driver, uint32_t subscribe, subscribe_upcall uc, void* userdata);

__attribute__ ((warn_unused_result))
[[ nodiscard ]]
allow_rw_return_t allow_readwrite(uint32_t driver, uint32_t allow, void* ptr, size_t size);

__attribute__ ((warn_unused_result))
[[ nodiscard ]]
allow_userspace_r_return_t allow_userspace_read(uint32_t driver,
uint32_t allow, void* ptr,
size_t size);

__attribute__ ((warn_unused_result))
[[ nodiscard ]]
allow_ro_return_t allow_readonly(uint32_t driver, uint32_t allow, const void* ptr, size_t size);

// Call the memop syscall.
Expand Down