You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for taking the time to look at my question. I'm new to this project and still learning, so I truly appreciate any guidance or help you can provide. If there's something I missed or could improve in my approach, please let me know—I'd be happy to learn and adjust.
Let's say I have a simple project structure like this:
src
main.c
lib-test
test.c
CMakeLists.txt
CMakeLists.txt
In the root CMakeLists.txt I will have something like this:
cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS$ENV{ZEPHYR_BASE})
project(app LANGUAGES C)
add_subdirectory(lib-test)
target_link_libraries(app PRIVATE test_lib)
target_sources(app PRIVATE src/main.c)
And the CMAkeLists.txt for lib-test will be like:
# Define a new Zephyr library
zephyr_library_named (test_lib)
# Add source files to the library
zephyr_library_sources (
test.c
)
# Specify the memory partition where all globals in the library should be placed.
zephyr_library_app_memory (test_partition)
My plan is to write the test.c like normal C source file would, don't have any Zephyr macro for memory partition for global variables:
#include<stdio.h>// Define a global integer variableinta=1;
// Function to print "Hello, World!" and the value of the global variable avoidprint_hello_world(void) {
printf("Hello, World!\n");
printf("The value of the global variable a is: %d\n", a);
}
I can get the project to compile and run on the qemu-x86_32 board, but the user mode thread didn't run correctly and hung. My log indicates the fail on spinlock assertion:
Thank you for taking the time to look at my question. I'm new to this project and still learning, so I truly appreciate any guidance or help you can provide. If there's something I missed or could improve in my approach, please let me know—I'd be happy to learn and adjust.
Let's say I have a simple project structure like this:
In the root CMakeLists.txt I will have something like this:
And the CMAkeLists.txt for lib-test will be like:
My plan is to write the test.c like normal C source file would, don't have any Zephyr macro for memory partition for global variables:
And I define the test_partition in main.c:
I can get the project to compile and run on the qemu-x86_32 board, but the user mode thread didn't run correctly and hung. My log indicates the fail on spinlock assertion:
Thank you in advance for your support!
The text was updated successfully, but these errors were encountered: