Nios V Command Shell/juart-terminal input for std::cin
Cyclone 10 GX, programmed with a jic with a factory and two application images, using the GSFI bootloader method. Given that programming takes several minutes, for development I want to be able to input values through juart-terminal to choose configuration settings and behaviour after programming - e.g. choosing which application to switch to by inputting the start address, whether to use a watchdog, etc.
I have been using std::cout/cin, which worked at first. However at some point I made a change to an application image and when a particular std::cin line was reached, it no longer took input. The program is then stuck and I can only power cycle or wait for the watchdog to timeout to return to factory.
Importantly, the line where this happens is always the same for a given program, but if I make an unrelated change - even as small as changing an int i = 0; to int i = 1; - then the line might change. If I remove the new code and return to the working program I had originally, that still works. So the issue is inconsistent but not random.
Is there a fix for this, or if not what other options do I have to provide input after programming?