Make the user's app root module of the firmware
Currently the root module of the firmware is core/start.zig. This has one upside and one downside. The upside is that we can export the startup logic without requiring the user to do anything. However this can be solved by requiring the user to call a function at comptime like this:
const microzig = @import("microzig");
comptime {
microzig.cpu.export_startup_logic(); // would export startup logic
}
pub fn main() {
}
The downside is that the user loses the ability to control the root module, which is often used to configure other dependencies (even std). This has been worked around for std but for other deps there is currently no solution that I am aware of.
If the user's module is the root module, then you can specify all the configuration you want directly, like you would do for a normal zig program.
What are some examples of other configurations this would allow the user to setup?
Most packages (that have any sort of configuration of course) in zig use this pattern to be configured:
// root_source_file.zig
pub const {package_name}_options = .{
...
};
Idk any specific example for embedded, but if the user wanted to use a package like this he would have no way to configure it.