Skip to content

CS ptimization and linux port#69

Closed
kr-t wants to merge 9 commits intomainfrom
features/optimization-and-linux
Closed

CS ptimization and linux port#69
kr-t wants to merge 9 commits intomainfrom
features/optimization-and-linux

Conversation

@kr-t
Copy link
Collaborator

@kr-t kr-t commented Jul 17, 2025

Description

Add POSIX and Zephyr platform support for Ocre runtime

  • Introduced core internal headers and source files for both POSIX and Zephyr platforms, including memory management, threading, mutexes, message queues, timers, and miscellaneous utilities.

  • Implemented core functions for memory allocation and deallocation using malloc and free for POSIX, and k_malloc and k_free for Zephyr.

  • Developed message queue functionalities with initialization, sending, and receiving capabilities for both platforms.

  • Created thread management functions to handle thread creation, destruction, and execution for both environments.

  • Added timer functionalities to support periodic and one-shot timers in the Ocre runtime.

  • Implemented filesystem operations for Zephyr, including file opening, reading, and directory listing.

  • Configured CMake build scripts for both platforms, ensuring proper linking and compilation of the Ocre runtime components.

  • Integrated WAMR (WebAssembly Micro Runtime) support for both platforms, allowing for enhanced execution of WebAssembly modules.
    Also, please list any issue that this PR is intended to fix.

  • Fixes issue ocre on linux - objectives, concerns - discussion #35

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Code cleanup/refactoring
  • This change requires a documentation update

How Has This Been Tested?

Tested on Zephyr's native_sim and u585, and Linux x86_64

Test Configuration (required):

  • Host OS type, version, and arch: Ubuntu
  • Developer Board make & model: STM32 U585

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Knox Lively and others added 9 commits May 21, 2025 11:46
Bumped container version to Ubuntu 24.04
* fix for discover mechinism

* changed sensor discover mechanism

* added dynamicaly access sensors from DT

* fix for gpio toggle pin

* fix for Timer API container aware module inst

* fix for timer crash

* messaging updates, save module_inst for each publisher

* fix for container_monitor_thread

* Fix for GPUI API container aware module inst

* TIMER_STACK_SIZE change

* Updated GPIO method names

* increase stack size for thread and send each argument separately

* update GPIO_STACK_SIZE

* cleanup messaging feature

* first version of cleanup cs_sm_impl

* add cleanup for messaging

* refactor messaging to subscribe to the first available slot

* PSRAM support for b_u585i_iot02a

* add local variable for container_ID in function create_container

* add sensors access by name

* Add guards to prevent build failure when messaging is not used

Signed-off-by: Krisztian <34309983+kr-t@users.noreply.github.com>

* add ifdef for messaging_register_module function

* Api's refactoring and optimization

* API's refactoring and optimization

* Update for SW ISR

* update for SW ISR (bus fault)

* Fix for SW ISR callback method

* Fix for SW ISR callback method

* ocre shell merge

* cleaned-up refactored and documented the ocre_common

* Fix for Module Register/Unregister

* Change request fixes

* change request fixes

* fix for CR and running Ocre as standalone application

* memory allocation fix

* modified allocation and free to user space from kernel space

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Co-authored-by: SorinOlari <sorin.olari2@gmail.com>
Co-authored-by: Stephen Berard <stephen.berard@outlook.com>
Co-authored-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
* Fix board build and run issues
* delete exec_env and call main function with wasm_application_execute_main()

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Co-authored-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Optimize ocre sensor's logic to wait for devices that need more time to initialize

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Co-authored-by: Sorin <117654840+SorinOlari@users.noreply.github.com>
Co-authored-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
…#40)

Add Linux as a second Ocre platform with initial CMake config
Integrate c-smf and Wasm submodule
Refactor and restructure platform, filesystem, timers, threads, mutex, memory, and messaging layers for POSIX and Zephyr
Add platform abstraction layers for threads, mutexes, timers, memory, and messaging
Optimize and separate CMake files for Linux and POSIX
Update build scripts and configs
Fix multiple build, dependency, and merge issues
General code cleanup and documentation updates

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
- Improve SMF
- Improve Posix FS platform abstraction layer
- Improve Posix timer platform abstraction layer

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
…-and-linux

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
@kr-t kr-t self-assigned this Jul 17, 2025
@kr-t kr-t closed this Jul 17, 2025
@kr-t kr-t deleted the features/optimization-and-linux branch July 17, 2025 06:33
kr-t added a commit that referenced this pull request Aug 28, 2025
* Update WAMR submodule's hash
* Update wamr's branch to main

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants