简体   繁体   中英

How to disable default Raspberry Pi 2 model B UART driver/module?

I'm writing a custom Raspberry Pi UART module for a school project and I think that my module is somehow conflicting with the default UART driver. Every time I write something into ttyAMA0 using fwrite, it returns a value equal to the length of the data I wrote, even though my module's write function always returns zero. Furthermore, when I make a new ttyAMA1 file using mknod and try writing into it, my module responds, but also returns the length of the data. So, my question would be how to disable the default RPI UART driver/module?

Module and test application code (transmit funcionality only): https://github.com/mixr26/sppurv-projekat

Any help would be much appreciated!

I found the solution to the problem. Disabling serial interface in raspi-config disables the Raspbian driver (AMBA-PL011), but it also disables UART pins (GPIO14 and GPIO15) and that's why my module didn't work. I had to manually set the function of UART pins by changing the GPFSEL register in my module. After that, I could safely call request_mem_region() and register_irq(), without any errors. – Mihailo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM