Comments (6)
Hey, thank you!
Indeed, that's a duplicate line! I'll check the 0xc6 issue too, because documentation not always up-to-date, and sometimes real hardware works differently. I'll look into that! Thanks again for noticing!
bzt
from raspi3-tutorial.
Ok, checked, it turned out everything is correct.
About 0xC6 in IIR, 6 stands for 2+4, so bits 1 and 2. Accoring to the docs, writing those bits in IIR should clear both the receiver and transmitter FIFO queues. So if you use 0xC0, your code will probably work most of the time (provided you've just turned on your Pi), but could act sometimes "strange" if certain conditions met (when there are leftover bytes in one of the queues, which could happen after a reset through a PM call). The best practice is to clear data registers (FIFO queues in this case) during initialization regardless their state, just to be on the safe side.
Also those IER lines really look like duplicates, but actually they are not. :-) The beauty of low level programming. The first clears the baud rate, the second disables the FIFO interrupts. We change the MMIO / AUX register mapping in line 53 by clearing DLAB bit in LCR when we set 8 bit data mode.
Cheers,
bzt
from raspi3-tutorial.
Awww I incorrectly read datasheet. Now I see, it was about read not a write condition.
Hmm DLAB bit in LCR shouldn't be reset state if we not set it somewhere before? If DLAB is set somewhere and we write 0 to IER register that mean we only clear MS 8bits from 16bit baudrate register isn't it?
Low level programing is as good as SoC documentation is good :D
from raspi3-tutorial.
Yes you are right about the DLAB bit. The code only clears MS 8bits after a turn on, after a PM reset DLAB should be 0, and I haven't set it explicitly before the first line. So it is a duplicated line after all :-) We can remove the first one probably, but I'll give it a test just to be sure. (Thankfully it doesn't matter because the code sets the baud rate register by using a different MMIO address too.)
Cheers,
bzt
from raspi3-tutorial.
If I find some other bug or something that look for me strange, do you want me to report it?
BTW, nice tutorial. It is really helped me a lot :)
from raspi3-tutorial.
Yes, but of course! Thank you very much, and I'm glad my tutorials were useful! :-)
Cheers,
bzt
from raspi3-tutorial.
Related Issues (20)
- Reference document to understand code and commands in 0B_readsector HOT 1
- 0x1C2 no longer has 0xE or 0xC partition type HOT 2
- 0B ReadSector - Stable clock troubleshooting HOT 8
- Typos - bareminimum readme HOT 3
- Using sd_readblock() for reading directories HOT 9
- 0A PCScreenFont only works in QEMU HOT 7
- 0B_readsector stuck after EMMC: Sending command 33220010 arg 00000000 HOT 1
- Segmentation fault on execution of 09_framebuffer and 0A_pcscreenfont HOT 6
- Using U-boot to boot kernel8.img HOT 2
- about the uart HOT 4
- Emulating the raspi 3 on jetson nano failed with a black screen. HOT 1
- Explanation for mailboxes HOT 4
- How to tune the booting parameters of Lineage 16 for Raspi 3 to boot it with qemu / kvm on the Jetson nano... HOT 1
- 14_raspbooin64 HOT 5
- Please help to understand the load address 0x800000 in the linker file HOT 2
- uart0 tutorial issue HOT 1
- Why *EMMC_INTERRUPT=*EMMC_INTERRUPT; in sd.c? HOT 1
- How do you debugger with gdb-multiarch? HOT 6
- Why ptr+=4 or ptr+=3? HOT 7
- qemu emulation not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspi3-tutorial.