uart

device and drivers connections

最后都变了- 提交于 2019-12-11 15:05:45
问题 There is a device that is connected to the controller uart port (in Linux 2.6), and which generates an interrupt on gpio. I wrote the driver of the Space user to communicate with the device, but I want to move this driver into the kernel. Does anyone have a similar experience? There is a driver of uart port from freescale do not really understand how this driver connects to the device through function probe (). Not yet found where the structure of the device is created and at what point and

Why is my serial communication not working?

流过昼夜 提交于 2019-12-11 14:27:26
问题 I looked in the manual (page 177) for the DE2 and as far as I understand it should be possible to do serial communication for instance via putty and a usb-to-serial cable to the board, so I take the program from the manual: /* A simple program that recognizes the characters 't' and 'v' */ #include <stdio.h> #include <string.h> int main () { char* msg = "Detected the character 't'.\n"; FILE* fp; char prompt = 0; fp = fopen ("/dev/uart1", "r+"); //Open file for reading and writing if (fp) {

Device Tree for changing UART Mode and enabling GPIOs for iMX6ULL System-on-module

廉价感情. 提交于 2019-12-11 12:13:14
问题 I am using iMX6ULL system-on-module on my custom board. I am struggling with UART, GPIOs of my custom board. I have solved the SPI issue on my board but later I got to know about another issue with my board and that's why I thought to ask a new question. I am able to activate desired UART port and SPI port for my board. But I got to know that my peripheral sensors which are soldered on my custom board have TX and RX lines swapped. I was trying to swap tx rx pins of UART5 of the imx6ull soc

Receive a String

情到浓时终转凉″ 提交于 2019-12-11 08:08:53
问题 How to received string in uart. I am using avr studio 5 and brays terminal like this one Same as this picture I am using baudrate of 9600. Went I try to type "abcdef" , it only come out "abcf" . My code are like this ---> #include <avr/io.h> void serial_init(void) { UBRRH = 0x00; UBRRL = 95; //baudrate 9600 and F_CPU 14745600UL UCSRB = (1 << RXEN) | (1 << TXEN) | (1<<RXCIE); UCSRC = (1<<URSEL)|(1<<USBS)|(3<<UCSZ0)|(1 << UCSZ1); } unsigned long long Usart_Receive(void) { while((UCSRA & (1 <<

How do I open/write/read a uart device from a kernel module?

帅比萌擦擦* 提交于 2019-12-11 06:34:34
问题 The device is a scanner. I know uart5 is setup in the dtsi file and in userspace it is listed under /dev/ttymxc4. From userspace, I understand that I can manipulate the device by fd = open("/dev/ttymxc5", O_RDWR|O_NOCTTY|O_NONBLOCK); if (fd < 0) { fprintf (stderr,"Open error on %s: %s\n", SCANNER_UART, strerror(errno)); return nullptr; } And use termios to set all the settings like baudrate, write data using the write call etc. I am wanting to abstract a lot of the commands under sysfs. I've

ccTalk coin acceptor no reaction when coin inserted

霸气de小男生 提交于 2019-12-11 05:38:53
问题 I write Linux application that is supposed to handle coins insertations (let's say that for now I need to recognize in application what coin has been inserted). I use SCA1 Coin Acceptor (ICT). I need to make it work with polish coins (currency - polish zloty). I was able to get the communication between PC and Coin Acceptor to work, but I have some issues. Quick description of my setup: PC connected to Coin Acceptor via RS232 (+USB converter) over the ccTalk protocol. Switch Block 1: All OFF,

Android Things UART not receiving data (RPi3)

旧街凉风 提交于 2019-12-11 04:58:42
问题 I have a Raspberry Pi 3 with Android Things running on it, and I'm trying to write an application that makes use of UART serial. I used the sample code in Android Things documentation for sending data, and it worked perfectly, but the code supposed to receive data returns empty bytes. while ((count = uart.read(buffer, buffer.length)) > 0) { Log.d(TAG, "Read " + count + " bytes from peripheral"); } There's an interrupt for when the UART buffer gets some data in, and that gets triggered calling

Receiving data from 2 UARTs, STM32F4-Discovery, HAL drivers

一笑奈何 提交于 2019-12-11 03:22:44
问题 I want to receive data from 2 sensors connected to my STM32F4-Discovery via 2 UARTs. Transmitting data from STM32 to sensors works but receiving doesn´t. Guarantee it isn´t a hardware problem. I found tutorials for 1 connected UART but not for 2 at once. I would like to use new HAL drivers and DMA for receiving. Thanks for help. UART_HandleTypeDef huart4; UART_HandleTypeDef huart5; DMA_HandleTypeDef hdma_uart4_rx; DMA_HandleTypeDef hdma_uart5_rx; uint8_t rxBuffer4 = '\000'; uint8_t rxBuffer5

stm32f0 uart programming

笑着哭i 提交于 2019-12-11 01:38:37
问题 i'm trying to get the usart to work on my stm32f0-discovery but now i found out that the documentation about this kinda " lacks" so is there anyone who has an example of any usart working for the stm32f050? thanks. Bart Teunissen 回答1: Okay after two days of searching around on the internet. I found this little piece of code, and i managed to get it working: USART_InitTypeDef USART_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); RCC

Disabling interrupt in interrupt handler STM32F407

老子叫甜甜 提交于 2019-12-10 20:25:58
问题 I'm new here and I'm trying to solve my projects problem. I'm trying to send send data over UART from Raspberry Pi B+ to my STM32F407 and process that data in real-time. My problem is: How to actually synchronize main() thred and UART interruption handler not to stop for a long time my UART interruption. Data sent from Raspberry looks like (where n is number): nwnx Code: void UART4_IRQHandler(void) { if(USART_GetITStatus(UART4, USART_IT_RXNE)) { if(!flag) { processing = true; widthTemp[j] =