Skip to content

Simple Thread example fails with region overlap #243

@KurtE

Description

@KurtE

Describe the bug
Trying to figure out what Zephyr are useable within Sketch and Arduino Libraries.

Started off with trying to use event apis, but that fails to load, calls like
k_event_set(&fillrectcb_event, 0x001);But that failed to load with erros like:
<err> llext: Undefined symbol with no entry in symbol table...

I then tried a sketch that I believe @mjs513 did earlier that created threads, That one failed with the error

uart:~$
[00:00:00.564,000] <err> eth_stm32_hal: HAL_ETH_Init failed: 1
*** Booting Zephyr OS build v4.2.0-27-g09722075b043 ***
[00:00:00.580,000] <err> llext: Region 1 ELF file range (0x798-0x933) overlaps with 2 (0x7f8-0x91f)
[00:00:00.592,000] <err> llext: Failed to map ELF sections, ret -8
Failed to load sketch, rc -8

Target board + cli verbose compilation output
This was both with the UNO-Q as well as Portenta H7, using my own build, that was in sync
yesterday. Only change was to fix SPI object for Q.

Optional: attach the elf file

Optional: attach the sketch

K_MUTEX_DEFINE(my_mutex);

void thread1(void)
{
    while (1) {
        k_mutex_lock(&my_mutex, K_FOREVER);
        printk("Thread 1 is accessing the shared resource\n");
        k_sleep(K_MSEC(1000));
        k_mutex_unlock(&my_mutex);
        k_sleep(K_MSEC(1000));
    }
}

void thread2(void)
{
    while (1) {
        k_mutex_lock(&my_mutex, K_FOREVER);
        printk("Thread 2 is accessing the shared resource\n");
        k_sleep(K_MSEC(1000));
        k_mutex_unlock(&my_mutex);
        k_sleep(K_MSEC(1000));
    }
}

K_THREAD_DEFINE(thread1_id, 1024, thread1, NULL, NULL, NULL, 7, 0, 0);
K_THREAD_DEFINE(thread2_id, 1024, thread2, NULL, NULL, NULL, 7, 0, 0);


void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  k_msleep(1);
}

Additional context
Need to double check if we were able to use the K_THREAD_DEFINE before or not...
Probably related to the earlier issue:
#53

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions