I wonder if there is a way to load a C function with its data at runtime to the text segment of a running microcontroller system. After the function is placed in the text segment and the data is stored in data segment the function pointer to the new loaded function becomes invoked in the main application. The functionality would be similar to a boot loader except from loading a entire binary before start up. I know that you can use the scatter-loading functions of the linker to place the function pointer at a fixed address or alter the alignment in the sections. Does anyone know if this is possible and if not why?
Many thanks