Help needed: Running RiscOS without any peripherals..
Mike Fearn (8270) 7 posts |
I have a program that needs to run in the boot sequence. It basically reads a file from the USB stick, determines what needs to be done, and then creates some new files by copying some stuff over from the SD card into RAM then processing some stuff, and then finally copying the resultant finalised file from RAM back onto the USB stick. It then finally deletes all the files in RAM and dismounts the USB stick. Now everything works when the RPI is plugged into a monitor via HDMI however, the moment I try to run the thing without a monitor, something stops the program completing so I never get me new file created on the USB stick. Doesn’t matter if I power the RPI from my apple laptop, a separate power adaptor or the monitor USB. Therefore doesn’t seem to be power related. It also runs correctly with just a monitor and no mouse or keyboard. Therefore, I am wondering the boot sequence checks to see if a monitor is connected via HDMI and perhaps stops / gives an error if there is no monitor. To get this to work would be great as it means I can plug the RPI directly into my laptop USB port anywhere I happen to be, and it will follow the instructions I put on the USB stick and create the new files directly. |
Tom Williamson (2844) 26 posts |
Hi Mike, very interesting one… Im going to have a guess that it might be the monitor edid thats causing you issue. Mount your SD card on a PC/MAC/Linux etc Open the cmdline.txt file in a text editor In this file add the line: disable_mode_changes disable_gamma Replace any other text so the file contains just this line Save the file and see if your Pi now boots without the monitor Best of Luck! |
John WILLIAMS (8368) 493 posts |
When Tom suggests this:
I’m guessing he really means to add these commands to any line already existing, as this file has all its commands concatenated onto a single line. Why, I know not, but I suspect that adding a line to any line already present won’t have the desired effect! Checking my own, I see that I just have only this as a single line after a comment thus:
where Jeffrey Lee explains what and why! So comment lines /are/ allowed! Just for clarity and future readers! |
David Pitt (3386) 1248 posts |
It is not just a RISC OS hazard, Raspberry Pi OS can be similarly gotcha’d.
To have the Pi output something more useful in case a monitor is connected later I use this. # start 1920 x 1200 hdmi_cvt=1920 1200 60 5 hdmi_group=2 hdmi_mode=87 hdmi_ignore_edid 0xa5000080 max_framebuffer_width=1920 max_framebuffer_height=1200 hdmi_pixel_freq_limit=400000000 end Adjust the height and width values to suit. HTH. |
Mike Fearn (8270) 7 posts |
Hi everyone, thank you very much for your replies. Tom, I made the change to the cmdline.txt file on my Mac, however adding “disable_mode_changes disable_gamma” did not fix the issue. RPI (Model 3b I think) still boots when connected to the monitor and runs the code, but not without the monitor! David, I added “hdmi_force_hotplug=1” at the end of the config/txt file inside the Loader folder of the !Boot folder. However, again this didn’t solve the issue. My config/txt file has the following: fake_vsync_isr=1 This is really odd. So the monitor does not need to be turned on for my code to execute, however, the HDMI cable must be connected into the monitor itself Therefore, suggests even with the monitor off, there is something e.g. able to ground one of the cables, which allows something in the RPI startup to run. I guess perhaps it either stops or is wating for a certain amount of time to check the HDMI is connected. Looks like I wrote some very complicated code which just seems to check the HDMI is plugged into a viable source! Also David: with your code: “# start 1920 × 1200 Was that also to go inside the config/txt file? I haven’t tried this as wasn’t 100% sure where to put it. |
Stuart Swales (8827) 1357 posts |
Mike, your computer provides power to the monitor’s EDID circuit over HDMI so that EDID can be read even when the monitor is switched off. |
David Pitt (3386) 1248 posts |
Yes. Both of these CONFIG/TXTs allow my RPi4 to start up with no monitor connected. hdmi_drive=2 hdmi_blanking=1 hdmi_force_hotplug=1 disable_overscan=1 fake_vsync_isr=1 init_emmc_clock=100000000 kernel=RISCOS.IMG framebuffer_swap=0 ramfsfile=CMOS ramfsaddr=0x508000 [pi4] enable_gic=1 # start 1920 x 1080 hdmi_cvt=1920 1080 60 5 hdmi_group=2 hdmi_mode=87 hdmi_ignore_edid 0xa5000080 max_framebuffer_width=1920 max_framebuffer_height=1080 hdmi_pixel_freq_limit=400000000# # end mode set hdmi_drive=2 hdmi_blanking=1 disable_overscan=1 fake_vsync_isr=1 init_emmc_clock=100000000 kernel=RISCOS.IMG framebuffer_swap=0 ramfsfile=CMOS ramfsaddr=0x508000 [pi4] enable_gic=1 The difference between them is the HDMI resolution as seen if a monitor is connected later, 640×480 for the first and as defined for the second. |
Mike Fearn (8270) 7 posts |
Thank you to everyone who replied to my question. All of you were kind for your time, knowledge and being super helpful. David, I want to thank you especially. I went with your second proposal for the Config file. That worked perfectly. Thank you so much for that, that’s super helpful. I can see potentially adding stuff in the boot sequence for some people potentially might lock you out of getting back into RiscOS. In my case I also made my code check the space bar, as well as to boot normally if it couldn’t find the file or USB stick. However, now when I just plug the USB power for the RPI into my car, my Mac etc. it now gives me the ability to create these files on the go anywhere. My Mac allows me to set the instructions on the USB stick as to what encoding and file I need building, then the RPI running Risc OS just builds the file in RAM and copies the finished and verified file back onto the same USB stick. Then I can plug the USB back into my Mac, or else install the newly created file back onto the hardware its designed for. Superb. Very happy now! |