Search found 6 matches

by Arjontje220
Wed Feb 26, 2020 3:10 pm
Forum: ChibiOS/RT
Topic: Multi-threading not working
Replies: 9
Views: 8871

Re: Multi-threading not working

So the function chSysTimerHandlerI() never gets called, this means that the running threads quantum never gets expired so context switch never happens. Why does this function never gets called, because it should be, right?

Arjon
by Arjontje220
Wed Feb 26, 2020 2:51 pm
Forum: ChibiOS/RT
Topic: Multi-threading not working
Replies: 9
Views: 8871

Re: Multi-threading not working

Hi,

Thread 1 is created and being executed, threat 2 is created but not being executed...


static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *p) {
while (1) {
//code
}
chThdExit(0);
return 0;
}

static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *p) {
while (1 ...
by Arjontje220
Wed Feb 26, 2020 8:37 am
Forum: ChibiOS/RT
Topic: Multi-threading not working
Replies: 9
Views: 8871

Re: Multi-threading not working

Hi Giovanni,

Thank you for your quick response.

So to sum up, there are two different cases:
Case 1: both threads are lower than NORMALPRIO -> both threads are NOT being executed, instead it is stuck when creating the second thread (see code). When I debug the code and step over that line, it ...
by Arjontje220
Tue Feb 25, 2020 4:02 pm
Forum: ChibiOS/RT
Topic: Multi-threading not working
Replies: 9
Views: 8871

Re: Multi-threading not working

Hi Giovanni,

Thank you for your response.

These are my settings (for RR-preemption):

#define CH_CFG_ST_FREQUENCY 1000
#define CH_CFG_ST_TIMEDELTA 0
#define CH_CFG_TIME_QUANTUM 20


I understand what you are saying about priorities, but for some reason, it doesn't matter what priority I give ...
by Arjontje220
Tue Feb 25, 2020 11:00 am
Forum: ChibiOS/RT
Topic: Multi-threading not working
Replies: 9
Views: 8871

Re: Multi-threading not working

So, if I add the function "chSchDoReschedule()" in each thread it works.

This is not ideal, is there a function that does this automatically? For instance, FreeRTOS has "vTaskStartScheduler()" to do this, is there a similar function available for ChibiOS?

Thanks,

Arjon
by Arjontje220
Tue Feb 25, 2020 8:55 am
Forum: ChibiOS/RT
Topic: Multi-threading not working
Replies: 9
Views: 8871

Multi-threading not working

Hi,

I recently discovered ChibiOS/RT and so far I like it, but there is one problem. If I want to run the code down below, it forever stays in the while loop of thread 1 and never executes the code of thread 2. Am I doing something wrong? I am using a ARM Cortex-M33

I am using this code:
m ...