Skip to content

Job launch order on STM32 in relation to jes_dispatch #83

@jake-is-ESD-protected

Description

@jake-is-ESD-protected

I am confused as to why this didn't happen before. When a job is registered and launched before jes_dispatch(), which is typical for starting loops, the "launch" part of the command silently fails, because the core, which is not yet running in FreeRTOS context, can't receive notifications yet due to the missing scheduler. The notification never arrives, causing the job to be registered but not launched. I subconsciously navigated around that in the STM32 tests:

int main(void) {
    xTaskCreate(test_all, "dispatch", 2048, NULL, 1, &pdispatch);
    jes_dispatch();
    return 0;
}

This code, which is only needed for platforms which provide the basic entry point (instead of something abstracted like Arduino setup()), just directly calls xTaskCreate(), which is compatible with a scheduler that is only activated later. A possible fix would be to track if the scheduler activation occurred and then branch the job launching process into the notification approach (scheduler is running) vs the direct call (scheduler is not yet running). The direct call was the method used in old jescore versions before the logging feature was implemented.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions