First of all ... if it's just updating the field, you donโt need to rely on the kernel interrupt vector table for the application , I think that parts of the ARM M0 always have the ability to move them. I know this can be done for some (all?) STM32Fx stuff, but I believe this is an ARM Mx thing, not an ST thing. Take a look at this before deciding to make your ISR applications all of which are hooks called from the kernel.
If you plan to interact a lot with your kernel (by the way, I always call a piece that self-updates the โbootloaderโ on the MCU), here is an alternative suggestion:
Do you pass the Core pointer a pointer to a structure / table of functions describing its capabilities to the App entry point?
This will completely separate the code for the application and the kernel, with the exception of a common header (provided that your ABI does not change) and prevent name conflicts.
It also provides a reasonable way to prevent GCC from optimizing any functions that you could only call from within the application without breaking the optimization settings or freezing with pragmas.
core.h:
struct core_functions { int (*pcore_func1)(int a, int b); void (*pcore_func2)(void); };
core.c:
int core_func1(int a, int b){ return a + b; } void core_func2(void){
app.c
void app_main(const struct core_functions * core) { int res; res = core->pcore_func1(20, 30); }
The disadvantage / cost is a small part of the execution time and the amount of memory and more code.
source share