uart

linux compile for enable uart2

眉间皱痕 提交于 2019-12-08 03:30:05
问题 I am using openwrt, initially, under /dev, there is only ttyO0 with is serial port for console. and I am using it to connect the board(siamilar to beaglebone black). Now, I am wire a gps to uart2. but I think somehow the openwrt is not enable it by default. I checked the device tree, am335x-bone.dts(I am using bone for my board, cause my board is not BBB). I not too much setting in it. most of config is from am33xx.dtst and am335x-bone-common.dtsi. I check the am33xx dtsi, there are some code

Set 16550A UART Hardware FIFO interrupt level from Linux Userspace

泄露秘密 提交于 2019-12-07 16:05:21
问题 I am currently using a 16550-compatible UART, and I want to be able to change the FIFO interrupt trigger level (I am dropping bytes under high UART loads and I want to reduce the threshold - it's an underpowered embedded system). Of course, I can change it in the 8250_port.c driver if I want: [PORT_NS16550A] = { .name = "NS16550A", .fifo_size = 16, .tx_loadsz = 16, .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO | UART_NATSEMI, }, But it would be far more convenient

C# Serial Port reading HEX data

 ̄綄美尐妖づ 提交于 2019-12-06 14:15:55
I am writing a C# application to read from several serial COM ports at the same time to analyze the data communication of an IPOD. The data being sent needs to be interpreted as HEX bytes. For example, 0xFF 0x55 0x01 0x00 0x04 0xC3 0xFF 0x55 ... I want to be able to read this and display it in a rich textbox, for example 0xFF 0x55 0x01 0x00 0x04 0xC3 0xFF 0x55 ... The start of a command includes a header (0xFF 0x55) and the rest is is the command + parameters + checksum. What is the best way to go about this? I currently have: private delegate void SetTextDeleg(string text); void sp

9 bit protocol on UART in embedded Linux

一笑奈何 提交于 2019-12-06 12:18:34
I am trying to force a 9-bit protocol on a UART in embedded Linux. Currently I am testing this out on the am335x_evm board. I am planning on doing this using stick parity. Ideally I was hoping I would not need to actually modify any of the code for the omap-serial.c driver. The reason for the 9-bit protocol is to support some legacy hardware that uses it. The parity bit needs to be 1 for the address portion of the message, 0 for the data portion, then 1 again for the termination byte. I was planning on having a process running in user space that would interface with the UART through standard

9 bits uart emulation with /dev/tty*

不问归期 提交于 2019-12-06 10:50:41
I have a uncommon protocol, which requires 9600 baud, 9 bits and one stop bit. I can't find any driver, which can implement this sending/receiving. Can I send something to /dev/tty* for emulating these queries? What should I send? How can I emulate a 9600 baud rate? You can use sticky parity, which is also called MARK and SPACE parity. termios.h supports this. However, you need to change the parity settings before sending address or data bytes accordingly and depending on the hardware, this may introduce undesired delays between two types of bytes. I have experienced delays from 0.4 ms to 10

Bluetooth Low Energy Notification Interval

本秂侑毒 提交于 2019-12-06 10:26:18
问题 I have a question regarding the bluetooth LE protocol. I have an Android Device and a peripheral device. Looking at the transmission with a sniffer and wireshark there is +/- every 40ms an empty PDU message. As I understood the protocol this means the connection interval those device chose is 40ms. For testing I am using a simple "UART" application where the android device enables the notification on an antribute of the peripheral device and gets notified whenever the attribute changes. Now,

Virtual ESC POS printer

我的未来我决定 提交于 2019-12-06 07:44:44
I searched little bit for emulation of ESC/POS printer, but didn't found any thing more, then data parsers like this . In few words, I have Linux, I have device connected to my PC via UART/RS-232 port. I need some soft, that will listen to specific COM port, and visualize data sent to be printed to this port (in example saves it as PDF). I don't think there is an out of box solution, but if you can capture the data (and it is a simple enough subset of esc/pos) you could then feed it to a tool like esc2html + wkhtmltopdf. https://github.com/receipt-print-hq/escpos-tools https://wkhtmltopdf.org/

STM32CubeMX+串口通信控制led

拜拜、爱过 提交于 2019-12-06 06:59:19
基础配置见 : https://www.cnblogs.com/jsit-dj-it/p/11967153.html 一、配置USART外设的工作参数 二、生成代码 在main.c编写业务逻辑代码 /* USER CODE BEGIN 4 */ void USER_UART_IRQHandler(UART_HandleTypeDef *huart) { /*__HAL_UART_GET_FLAG 获取 SR 寄存器标志位状态 UART_FLAG_RXNE 接受数据寄存器非空标志位 UART_FLAG_RXNE (0x1UL << USART_SR_RXNE_Pos) /*!< 0x00000020 */ UART_RX_STATE_READY=0x00自定义 */ //接收数据 if ((__HAL_UART_GET_FLAG(&huart1, UART_FLAG_RXNE) != RESET)) { //接收到一帧中的第一个字节 if (uart1RxState == UART_RX_STATE_READY) { uart1RxState = UART_RX_STATE_START; __HAL_UART_ENABLE_IT(&huart1, UART_IT_IDLE); uart1RxCounter = 0; uart1RxBuf[uart1RxCounter] =

RS232 (UART) on STM32F4-Discovery (STM32F429ZIT6) with HAL library?

主宰稳场 提交于 2019-12-06 05:23:14
问题 Background Here is some of my background so that your guy could know what related knowledge I have or I don't have. I'm totally a newbie of this kind of embedded system. And I don't really know anything about electronics, I'm a pure software guy. My only experience of embedded system is Raspberry Pi, which is quite different from STM32F4 Discovery. I could implement a UART read / write programming by using standard Linux C library on Raspberry Pi, which is connected to a PC with an USB-to

Set 16550A UART Hardware FIFO interrupt level from Linux Userspace

左心房为你撑大大i 提交于 2019-12-06 03:34:16
I am currently using a 16550-compatible UART, and I want to be able to change the FIFO interrupt trigger level (I am dropping bytes under high UART loads and I want to reduce the threshold - it's an underpowered embedded system). Of course, I can change it in the 8250_port.c driver if I want: [PORT_NS16550A] = { .name = "NS16550A", .fifo_size = 16, .tx_loadsz = 16, .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO | UART_NATSEMI, }, But it would be far more convenient to change it from userspace without having to recompile a kernel. I am hoping that the following