I'm looking at a MilkV-Duo, which among other things has "large" and "small" RISC-V cores running Linux and either FreeRTOS or Arduino code respectively.
The Serial instance appears to not be initialised, but Serial0...Serial4 are.
In order to avoid changing the assumed output device in an existing diagnostic file which among other things outputs the main file name and date/time etc., is it possible to "forcibly initialise" (the variable representing?) the standard serial instance from e.g. Serial0?
But that would still mean modifying the file containing the diagnostic code (plus of course any pre-existing examples): I'd rather avoid that if possible.
The link in my OP shows how an intermediate variable can be used for the job, and I've previously been guided to something similar when I asked about changing the port assignment at runtime. But in the current case I'm asking specifically about modifying the content of the Serial instance, exported (but not fully initialised) by the Arduino libraries.
Not if you put the define stuff in the calling code before the diagnostic code is included. Assuming that the diagnostic code is some kind of header file that's being included. I don't know, of course, because I can only work with what you've told.
Perhaps it works better if you give some more specific information about the diagnostic code and how it works, and maybe provide one or two brief/minimal examples of your specific application(s) that you're trying to get to work. Also include clear requirements including what you do(n't) want to modify so that people can offer solutions that actually fit your purpose.
At present I've got a definition for USART in the .h which corresponds to the .cpp being linked in and am using that in lieu of Serial, so that could probably go into platform.local.txt which I'm already using to make board names etc. accessible.
As an experiment I tried
Serial = HardwareSerial(0, PIN_UART0_RX, PIN_UART0_TX);
which compiled but crashed badly, I wasn't able to see Serial in .bss so suspect that nonsensical code was being generated.