babbleberry / rpi4-osdev

Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4
https://www.rpi4os.com
Creative Commons Zero v1.0 Universal
3.43k stars 255 forks source link

no data on UART with raspi 400 #22

Closed dodecahedral-champion closed 2 years ago

dodecahedral-champion commented 2 years ago

Hello,

I was having trouble getting UART1 to respond on my raspi 400, so I tried your code to check if I was missing something obvious; but there is still no output. :-(

Some things I checked:

It's possible that there is some other obscure difference between the raspi 4 and raspi 400, so I am considering splashing out on a raspi 4B to test with....

I wonder if you have any ideas?

dodecahedral-champion commented 2 years ago

That diagram seems to be using wiringpi's pin numbering scheme (http://wiringpi.com/pins/), which is similar-yet-different to the Broadcom one. On https://pi4j.com/1.4/pins/rpi-4b.html, they list the same pinout for the 4B model. Very confusing, but at least the pinouts are the same.

I will have another think today and then decide whether to buy a 4B for testing.

dodecahedral-champion commented 2 years ago

Well I had a strange experience with the raspi4B. At first I seemed to have gone backwards: the same card I used to successfully test your part5 example on the raspi400 refused to work (in addition to the uart not working). I reimaged the card from scratch and walked through baby steps, again starting with raspbian to be sure that at least somebody was able to talk on the uart. In the end the 4B could successfully run your part4 example on the 4B, and... [drum roll] ...the same card also works on the raspi400!

I tried working backwards to determine if there was some obscure difference between the two configurations, but I've just finished using the exact same config.txt and it still works.

So I guess we can chalk this one up to "mysterious gremlins" and close the issue. 😩

babbleberry commented 2 years ago

That is very strange indeed. I also find the "mysterious gremlins" answer somewhat unsatisfying. It does happen though! I'm happy for you to close the issue - do keep in touch with how you get on with the RPi400.

All the best, Adam

dodecahedral-champion commented 2 years ago

I suspect the gremlins are in the SD card, I've just had another error that was magically corrected by redoing from start. I'll try another card brand maybe. Anyway I can get UART input & output on the 400, plus framebuffer output, so everything looks OK so far.