Giter Site home page Giter Site logo

soft_uart's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soft_uart's Issues

repeatable problem, when sending continous data with datasize greater than the TX-buffersize

Hi,

I found a repeatable problem, when sending continuous data with data size greater than the TX-buffer size (QUEUE_MAX_SIZE = 256 in queue.h).

summary

When continuous data larger than the buffer size is sent, the sending programs hangs.

  1. This issue is on an new installed RASPY 3B+.
  2. This issue is with different USB-serial converters at the PC.
  3. This is with low baud-rate e.g. 1200 baud, too.

illustrating example

To illustrate, that large text files get stucked when being sent, I changed the TX buffer-size QUEUE_MAX_SIZE in queue.h to the small testing value of 3.
results:
echo -n abc >/dev/ttySOFT0 is transmitting 3 chars to the PC.
echo -n abcd >/dev/tty/SOFT0 is transmitting only 3 chars an the echo program on the RASPI hangs. Pressing CTRL-C gets back to the shell and the 4 th. character is transmitted to the PC.

The same with minicom on both sides sending a file from the RASPI. If filesize is about less than the QUEUE_MAX_SIZE sending is possible. For filesize larger than the QUEUE_MAX_SIZE it produces errors. The testing with minicom ensures, that it is not a problem with stty-parameters. This behaviour is with the original value of QUEUE_MAX_SIZE as well.

I found this issue sending a 1k large file from the RASPI to PC with minicom at standard parameters. There are no problems sending continuous data from the PC to the RASPI.

workaround, to investigate the issue

Thanks you so much for your work adrianomarto, which inspired me (see offtopic in my post to issue #7 Multiple instances ). This is the reason, why i tried to figure out what happened and implemented several kernel logs in the code to see where the module hangs. Result: Nowhere! :-)

Inmodule.cin the writing procedure soft_uart_write() kernel messages were added telling the return-value and the queue_room (space left in queue).
Testing result showed, that the sending program hangs when the free space in the queue is 0.

The issue disappears with a wait until the queue has free space again using an added while / sleep statement.
I know, this is brute-force programming - a workaround, to help you find the real solution.

in modules.c:
static int soft_uart_write(struct tty_struct* tty, const unsigned char* buffer, int buffer_size)
{
  int temp = 0;
  temp = raspberry_soft_uart_send_string(buffer, buffer_size);
 
  printk(KERN_INFO "soft_uart: free space in queue before  %d", raspberry_soft_uart_get_tx_queue_room());  
  while (raspberry_soft_uart_get_tx_queue_room() < 2)
  {
    msleep(1);
  }
  printk(KERN_INFO "soft_uart: free space in queue after %d", raspberry_soft_uart_get_tx_queue_room());
  printk(KERN_INFO "soft_uart: return value  %d", temp);
  return temp;
}

With this workaround everything worked fine with me. However, the waiting time should depend on the baud-rate and more.
So this is not a real solution.
Hopefully this gives you a hint what to change in the code, to make the issue disappear. Maybe this is the reason for issue #10, too?

Thank a lot @adrianomarto

Not working on Orange Pi

Hi,
I recently experienced problems on Orange Pi with the following command :
sudo insmod soft_uart.ko gpio_tx=68 gpio_rx=71
Answering :

$ insmod: ERROR: could not insert module soft_uart.ko: Cannot allocate memory

I dug a bit and the dmesg command says:

[ 538.321662] soft_uart: Initializing module...
[ 538.321729] soft_uart: Failed initialize GPIO.

Also, it works well with sudo insmod soft_uart.ko gpio_tx=10 gpio_rx=20
I suspect a problem with the WiringOP (wiring Pi equivalent for Orange Pi), and maybe (I hope) just a pin number restriction ? But I could not find such trivial thing in the files

For the record, pin numbering is kind of special on Orange Pi, since when you tell "gpio_tx=10 gpio_rx=20", it will set PA10 and PA20 located on the 35 and 37's pin of the headerpin, and the equivalent wiring Pi is 23, 25. Pin Map for Orange Pi PC
However, SOFTUART seems to take GPIO reference and not WPi ones.

Config :
Orange Pi PC +
SoC : H3, 1 GB RAM
Distro : Armbian Buster
Kernel Headers installed through armbian-config

Any idea how I could make it work ?

Kind regards, Nicolas

Type in install instructions

There is a missing underscore in
sudo insmod softuart.ko gpio_tx=10 gpio_rx=11

It must be soft_uart.ko

Thanks

not working on fingerprint scanner

Hello.. I'm using raspbian stretch on Pi Zero. I installed this module correctly. I tested loop back on minicom and it is working fine. But when I use it for my fingerprint scanner (GT-511C3), it is not working. (I changed path to /dev/ttySOFT0 in fingerprint scanner's library). But the same fingerprint scanner is working fine with on-board UART. I also tried with /dev/ttyUSB0 by using 'FTDI F232R USB to TTL' and it is working fine. then what could be the problem here? why SOFT UART is not working ? I have not forgotten to start this software from terminal. ttySOFT0 is also listed when I use 'ls -l /dev' (I want to use GPS,Fingerprint, and GSM Internet dongle on Pi Zero. So I need to use this soft UART)

Cannot allocate memory

Hi, While running below command
sudo insmod soft_uart.ko

I am getting error like:
insmod: ERROR: could not insert module soft_uart.ko: Cannot allocate memory

This is in Debian buster latest raspbian.

keeps hanging up and not responding

hi,

I have it connected to gsm ga6 module running at 2400b and it keeps on hanging, after executing few AT commands... how does one debug this?

Bit error when in AR9331

I compile and install this kmod in AR9331(400MHZ Mips Soc). It works. I can use the ttySOFT0 to transmit and recieve. But it always encounters some bit error. I modified some of the code, now it works well.

1: Change the RX trigger from "IRQF_TRIGGER_FALLING" to "IRQF_TRIGGER_LOW".
2: In handle_rx_start(), after start the timer, disable the RX_IRQ
if (rx_bit_index == -1) { hrtimer_start(&timer_rx, ktime_set(0, 0), HRTIMER_MODE_REL); } disable_irq_nosync(gpio_to_irq(gpio_rx)); return (irq_handler_t) IRQ_HANDLED;
3: After has recieved a byte, enable the RX_IRQ.
receive_character(character); rx_bit_index = -1; enable_irq(gpio_to_irq(gpio_rx));

It reduce the bit error when RX receive bits significantly. I haven't test it in Raspberry pi. You can test it. Maybe it will improve the baud rate.

BUG: scheduling while atomic: ksoftirqd/0/3/0x00010102

[2021/07/05, 13:43:52.334] BUG: scheduling while atomic: ksoftirqd/0/3/0x00010102
[2021/07/05, 13:43:52.339] Modules linked in: drv_ms_cus_sc401ai_MIPI(PO) hiNand(O) dev_clouddeck(O) soft_uart(O) Vz_gpio(O) mi_ai(PO) mi_divp(PO) mi_venc(PO) mi_vif(PO) mi_shadow(PO) mi_vpe(PO) mi_rgn(PO) mi_ao(PO) mi_sensor(PO) mi_sys(PO) mi_common(PO) mhal(PO) nls_utf8
[2021/07/05, 13:43:52.361] CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: P O 4.9.84 #25
[2021/07/05, 13:43:52.368] Hardware name: SStar Soc (Flattened Device Tree)
[2021/07/05, 13:43:52.371] [] (unwind_backtrace) from [] (show_stack+0xb/0xc)
[2021/07/05, 13:43:52.380] [] (show_stack) from [] (__schedule_bug+0x3f/0x60)
[2021/07/05, 13:43:52.385] [] (__schedule_bug) from [] (__schedule+0x29/0x284)
[2021/07/05, 13:43:52.390] [] (__schedule) from [] (schedule+0x57/0x64)
[2021/07/05, 13:43:52.398] [] (schedule) from [] (schedule_preempt_disabled+0x19/0x2a)
[2021/07/05, 13:43:52.403] [] (schedule_preempt_disabled) from [] (__mutex_lock_slowpath+0xe3/0x1f4)
[2021/07/05, 13:43:52.414] [] (__mutex_lock_slowpath) from [] (mutex_lock+0x9/0x18)
[2021/07/05, 13:43:52.419] [] (mutex_lock) from [] (handle_rx+0x70/0xd8 [soft_uart])
[2021/07/05, 13:43:52.430] [] (handle_rx [soft_uart]) from [] (__hrtimer_run_queues.constprop.4+0x75/0xf0)
[2021/07/05, 13:43:52.435] [] (__hrtimer_run_queues.constprop.4) from [] (hrtimer_interrupt+0x73/0x168)
[2021/07/05, 13:43:52.448] [] (hrtimer_interrupt) from [] (arch_timer_handler_virt+0x1f/0x26)
[2021/07/05, 13:43:52.451] [] (arch_timer_handler_virt) from [] (handle_percpu_devid_irq+0x31/0x88)
[2021/07/05, 13:43:52.458] [] (handle_percpu_devid_irq) from [] (generic_handle_irq+0xd/0x16)
[2021/07/05, 13:43:52.468] [] (generic_handle_irq) from [] (__handle_domain_irq+0x4d/0x68)
[2021/07/05, 13:43:52.473] [] (__handle_domain_irq) from [] (gic_handle_irq+0x33/0x48)
[2021/07/05, 13:43:52.486] [] (gic_handle_irq) from [] (__irq_svc+0x65/0xac)
[2021/07/05, 13:43:52.487] Exception stack(0xc3c61e58 to 0xc3c61ea0)
[2021/07/05, 13:43:52.490] 1e40: c03bdaf4 20000013
[2021/07/05, 13:43:52.504] 1e60: c3c50980 00000001 20000013 c03bd988 c03bd988 c03bd988 c3c60000 20000013
[2021/07/05, 13:43:52.506] 1e80: 00000001 00000000 0000000b c3c61ea8 c0246cc1 c0246cc4 20000033 ffffffff
[2021/07/05, 13:43:52.513] [] (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0xc/0x2e)
[2021/07/05, 13:43:52.524] [] (_raw_spin_unlock_irqrestore) from [] (rcu_process_callbacks+0xcb/0x2b0)
[2021/07/05, 13:43:52.526] [] (rcu_process_callbacks) from [] (__do_softirq+0x81/0x158)
[2021/07/05, 13:43:52.533] [] (__do_softirq) from [] (run_ksoftirqd+0xf/0x20)
[2021/07/05, 13:43:52.542] [] (run_ksoftirqd) from [] (smpboot_thread_fn+0x11f/0x12c)
[2021/07/05, 13:43:52.547] [] (smpboot_thread_fn) from [] (kthread+0xa1/0xb4)
[2021/07/05, 13:43:52.557] [] (kthread) from [] (ret_from_fork+0x11/0x30)
[2021/07/05, 13:43:52.563] ------------[ cut here ]------------
[2021/07/05, 13:43:52.566] WARNING: CPU: 0 PID: 3 at kernel/events/core.c:3420 perf_event_task_tick+0x19/0x186
[2021/07/05, 13:43:52.575] Modules linked in: drv_ms_cus_sc401ai_MIPI(PO) hiNand(O) dev_clouddeck(O) soft_uart(O) Vz_gpio(O) mi_ai(PO) mi_divp(PO) mi_venc(PO) mi_vif(PO) mi_shadow(PO) mi_vpe(PO) mi_rgn(PO) mi_ao(PO) mi_sensor(PO) mi_sys(PO) mi_common(PO) mhal(PO) nls_utf8
[2021/07/05, 13:43:52.596] CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: P W O 4.9.84 #25
[2021/07/05, 13:43:52.602] Hardware name: SStar Soc (Flattened Device Tree)
[2021/07/05, 13:43:52.608] [] (unwind_backtrace) from [] (show_stack+0xb/0xc)
[2021/07/05, 13:43:52.612] [] (show_stack) from [] (__warn+0x89/0xb0)
[2021/07/05, 13:43:52.618] [] (__warn) from [] (warn_slowpath_null+0x11/0x16)
[2021/07/05, 13:43:52.626] [] (warn_slowpath_null) from [] (perf_event_task_tick+0x19/0x186)
[2021/07/05, 13:43:52.631] [] (perf_event_task_tick) from [] (update_process_times+0x3d/0x48)
[2021/07/05, 13:43:52.644] [] (update_process_times) from [] (tick_sched_timer+0x27/0x52)
[2021/07/05, 13:43:52.646] [] (tick_sched_timer) from [] (__hrtimer_run_queues.constprop.4+0x75/0xf0)
[2021/07/05, 13:43:52.655] [] (__hrtimer_run_queues.constprop.4) from [] (hrtimer_interrupt+0x73/0x168)
[2021/07/05, 13:43:52.663] [] (hrtimer_interrupt) from [] (arch_timer_handler_virt+0x1f/0x26)
[2021/07/05, 13:43:52.671] [] (arch_timer_handler_virt) from [] (handle_percpu_devid_irq+0x31/0x88)
[2021/07/05, 13:43:52.681] [] (handle_percpu_devid_irq) from [] (generic_handle_irq+0xd/0x16)
[2021/07/05, 13:43:52.687] [] (generic_handle_irq) from [] (__handle_domain_irq+0x4d/0x68)
[2021/07/05, 13:43:52.698] [] (__handle_domain_irq) from [] (gic_handle_irq+0x33/0x48)
[2021/07/05, 13:43:52.702] [] (gic_handle_irq) from [] (__irq_svc+0x65/0xac)
[2021/07/05, 13:43:52.707] Exception stack(0xc3c61e58 to 0xc3c61ea0)
[2021/07/05, 13:43:52.719] 1e40: c03bdaf4 20000013
[2021/07/05, 13:43:52.720] 1e60: c3c50980 00000001 20000013 c03bd988 c03bd988 c03bd988 c3c60000 20000013
[2021/07/05, 13:43:52.725] 1e80: 00000001 00000000 0000000b c3c61ea8 c0246cc1 c0246cc4 20000033 ffffffff
[2021/07/05, 13:43:52.737] [] (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0xc/0x2e)
[2021/07/05, 13:43:52.739] [] (_raw_spin_unlock_irqrestore) from [] (rcu_process_callbacks+0xcb/0x2b0)
[2021/07/05, 13:43:52.753] [] (rcu_process_callbacks) from [] (__do_softirq+0x81/0x158)
[2021/07/05, 13:43:52.755] [] (__do_softirq) from [] (run_ksoftirqd+0xf/0x20)
[2021/07/05, 13:43:52.761] [] (run_ksoftirqd) from [] (smpboot_thread_fn+0x11f/0x12c)
[2021/07/05, 13:43:52.774] [] (smpboot_thread_fn) from [] (kthread+0xa1/0xb4)
[2021/07/05, 13:43:52.775] [] (kthread) from [] (ret_from_fork+0x11/0x30)
[2021/07/05, 13:43:52.781] ---[ end trace bb1682130f957d1c ]---
[2021/07/05, 13:43:52.783] ------------[ cut here ]------------
[2021/07/05, 13:43:52.791] WARNING: CPU: 0 PID: 3 at kernel/time/posix-cpu-timers.c:1162 run_posix_cpu_timers+0x31/0x336
[2021/07/05, 13:43:52.795] Modules linked in: drv_ms_cus_sc401ai_MIPI(PO) hiNand(O) dev_clouddeck(O) soft_uart(O) Vz_gpio(O) mi_ai(PO) mi_divp(PO) mi_venc(PO) mi_vif(PO) mi_shadow(PO) mi_vpe(PO) mi_rgn(PO) mi_ao(PO) mi_sensor(PO) mi_sys(PO) mi_common(PO) mhal(PO) nls_utf8
[2021/07/05, 13:43:52.816] CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: P W O 4.9.84 #25
[2021/07/05, 13:43:52.822] Hardware name: SStar Soc (Flattened Device Tree)
[2021/07/05, 13:43:52.827] [] (unwind_backtrace) from [] (show_stack+0xb/0xc)
[2021/07/05, 13:43:52.841] [] (show_stack) from [] (__warn+0x89/0xb0)
[2021/07/05, 13:43:52.842] [] (__warn) from [] (warn_slowpath_null+0x11/0x16)
[2021/07/05, 13:43:52.846] [] (warn_slowpath_null) from [] (run_posix_cpu_timers+0x31/0x336)
[2021/07/05, 13:43:52.858] [] (run_posix_cpu_timers) from [] (tick_sched_timer+0x27/0x52)
[2021/07/05, 13:43:52.860] [] (tick_sched_timer) from [] (__hrtimer_run_queues.constprop.4+0x75/0xf0)
[2021/07/05, 13:43:52.869] [] (__hrtimer_run_queues.constprop.4) from [] (hrtimer_interrupt+0x73/0x168)
[2021/07/05, 13:43:52.884] [] (hrtimer_interrupt) from [] (arch_timer_handler_virt+0x1f/0x26)
[2021/07/05, 13:43:52.884] [] (arch_timer_handler_virt) from [] (handle_percpu_devid_irq+0x31/0x88)
[2021/07/05, 13:43:52.905] [] (handle_percpu_devid_irq) from [] (generic_handle_irq+0xd/0x16)
[2021/07/05, 13:43:52.905] [] (generic_handle_irq) from [] (__handle_domain_irq+0x4d/0x68)
[2021/07/05, 13:43:52.908] [] (__handle_domain_irq) from [] (gic_handle_irq+0x33/0x48)
[2021/07/05, 13:43:52.915] [] (gic_handle_irq) from [] (__irq_svc+0x65/0xac)
[2021/07/05, 13:43:52.927] Exception stack(0xc3c61e58 to 0xc3c61ea0)
[2021/07/05, 13:43:52.929] 1e40: c03bdaf4 20000013
[2021/07/05, 13:43:52.931] 1e60: c3c50980 00000001 20000013 c03bd988 c03bd988 c03bd988 c3c60000 20000013
[2021/07/05, 13:43:52.947] 1e80: 00000001 00000000 0000000b c3c61ea8 c0246cc1 c0246cc4 20000033 ffffffff
[2021/07/05, 13:43:52.947] [] (__irq_svc) from [] (_raw_spin_unlock_irqrestore+0xc/0x2e)
[2021/07/05, 13:43:52.960] [] (_raw_spin_unlock_irqrestore) from [] (rcu_process_callbacks+0xcb/0x2b0)
[2021/07/05, 13:43:52.962] [] (rcu_process_callbacks) from [] (__do_softirq+0x81/0x158)
[2021/07/05, 13:43:52.978] [] (__do_softirq) from [] (run_ksoftirqd+0xf/0x20)
[2021/07/05, 13:43:52.980] [] (run_ksoftirqd) from [] (smpboot_thread_fn+0x11f/0x12c)
[2021/07/05, 13:43:52.981] [] (smpboot_thread_fn) from [] (kthread+0xa1/0xb4)
[2021/07/05, 13:43:52.997] [] (kthread) from [] (ret_from_fork+0x11/0x30)
[2021/07/05, 13:43:53.002] ---[ end trace bb1682130f957d1d ]---

Pi Zero data corruption on RX, can you add a RX Buffer?

I've got an application where I have no choice but to use 9600 baud, I'm initializing a radio tranceiver module (DRA818) I have to send a short series of commands over the soft_uart and then read the response to ensure that the command executed correctly.

on the Pi Zero this seems to be more than a challenge for the hardware at 9600 baud. As such, I'm getting data corruption when I receive the response (i.e. instead of receiving '+DMOCONNECT:0' from the device, I may get '+DMOCONN4CT:0
'
I see that you opted to not use a receive buffer, unlike the 256 byte receive buffer implemented by https://github.com/themrleon/RpiSoft-UART

I honestly don't understand enough about the code looking at it, but do you think adding a receive buffer would help in this circumstance? I'm presuming there was a reason you opted not to implement the RX Buffer, and unfortunately, I'm not knowledgeable enough with C to add one in to try it.

soft_uart Transmission ends marking OR spacing

I am trying to transmit 110 baud to an actual 20mA current loop Teletype using GPIO-2 (SDA) as the Tx line. I can see the data on an oscilloscope but the transmission often ends in a spacing state (0= no current) instead of marking (1=20mA).
Since finding this on the original I loaded soft_uart_hippy but with similar results except when I tried changing the baud to 2400 the inversion appears to have taken over. At 300 baud the final state is random again.
Test line: echo "U" > /dev/ttySOFT0
Raspbian 9.8 stretch
kernel 4.14.98+
model B Rev 2
firmware Feb 12 2019 10:42:42
stty -F /dev/ttySOFT0 110 cs8
sudo insmod soft_uart.ko gpio_tx=2 gpio_rx=3

Compilation error on RPI 4 (incompatible-pointer-types)

Any idea on how to fix this compilation error on a RPI4?

pi@raspberrypi:~/soft_uart $ make
make -C /usr/src/linux-headers-6.6.20+rpt-rpi-v8 M=/home/pi/soft_uart modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.20+rpt-rpi-v8'
CC [M] /home/pi/soft_uart/module.o
/home/pi/soft_uart/module.c:47:22: error: initialization of ‘ssize_t (*)(struct tty_struct *, const u8 , size_t)’ {aka ‘long int ()(struct tty_struct *, const unsigned char , long unsigned int)’} from incompatible pointer type ‘int ()(struct tty_struct *, const unsigned char , int)’ [-Werror=incompatible-pointer-types]
47 | .write = soft_uart_write,
| ^~~~~~~~~~~~~~~
/home/pi/soft_uart/module.c:47:22: note: (near initialization for ‘soft_uart_operations.write’)
/home/pi/soft_uart/module.c:52:22: error: initialization of ‘void (
)(struct tty_struct *, const struct ktermios )’ from incompatible pointer type ‘void ()(struct tty_struct *, struct ktermios *)’ [-Werror=incompatible-pointer-types]
52 | .set_termios = soft_uart_set_termios,
| ^~~~~~~~~~~~~~~~~~~~~
/home/pi/soft_uart/module.c:52:22: note: (near initialization for ‘soft_uart_operations.set_termios’)
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-6.6.20+rpt-common-rpi/scripts/Makefile.build:248: /home/pi/soft_uart/module.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.6.20+rpt-common-rpi/Makefile:1938: /home/pi/soft_uart] Error 2
make[1]: *** [/usr/src/linux-headers-6.6.20+rpt-common-rpi/Makefile:246: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.6.20+rpt-rpi-v8'
make: *** [Makefile:9: all] Error 2
pi@raspberrypi:~/soft_uart $

Multiple instances

Hi
I need more than one soft uart on my Raspberry pi. How can i do that?
Tried to rename file and tty before compilation with no luck.

Is it possible to have several of these devices concurrently?

Hi,
Great idea you had. I'ts just what I need. I have an application that needs two Serial ports. I can go with the one on the Pi and use your software for the other, the app is not required to go beyond 4800 baud,
Is there a possibility of supporting two sets of GPIO pins with this ? or only one is allowed ?
Thanks,
Regards

Linux headers not found

Dear all,
I encountered an issue while simply using the make function. but as I searched quite a lot of internet pages I didn't clearly found the solution.
here is the message while trying the make function :
make -C /usr/src/linux-headers-4.14.79-v7+ M=/home/pi/soft_uart modules
make[1]: *** /usr/src/linux-headers-4.14.79-v7+ : Aucun fichier ou dossier de ce type. Arrêt.
Makefile:9 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

mu pi is on Raspbian GNU/LINUX 9.6.
the available headers are
linux-headers-3.10-3-all linux-headers-3.6-trunk-rpi
linux-headers-3.10-3-all-armhf linux-headers-4.4.0-1-all
linux-headers-3.10-3-common linux-headers-4.4.0-1-all-armhf
linux-headers-3.10-3-rpi linux-headers-4.4.0-1-common
linux-headers-3.16.0-4-all linux-headers-4.4.0-1-rpi
linux-headers-3.16.0-4-all-armhf linux-headers-4.4.0-1-rpi2
linux-headers-3.16.0-4-common linux-headers-4.9.0-6-all
linux-headers-3.16.0-4-rpi linux-headers-4.9.0-6-all-armhf
linux-headers-3.18.0-trunk-all linux-headers-4.9.0-6-common
linux-headers-3.18.0-trunk-all-armhf linux-headers-4.9.0-6-common-rt
linux-headers-3.18.0-trunk-common linux-headers-4.9.0-6-rpi
linux-headers-3.18.0-trunk-rpi linux-headers-4.9.0-6-rpi2
linux-headers-3.18.0-trunk-rpi2 linux-headers-rpi
linux-headers-3.6-trunk-all linux-headers-rpi2
linux-headers-3.6-trunk-all-armhf linux-headers-rpi2-rpfv
linux-headers-3.6-trunk-common linux-headers-rpi-rpfv

there is not the required one and I didn't any way with update action to fix it...
I really need to get extra Tx/RX pins. the existing one are already used...
please, any idea ??
many thank
xavier

Compile time error "invalid operands to binary / "

During make on Raspberry Pi 3, kernel 4.9.35-v7+, gcc (Raspbian 4.9.2-10+deb8u2) 4.9.2, I've encountered following error:
make -C /usr/src/linux-headers-4.9.35-v7+ M=/home/pi/soft_uart modules make[1]: Entering directory '/usr/src/linux-headers-4.9.35-v7+' CC [M] /home/pi/soft_uart/raspberry_soft_uart.o /home/pi/soft_uart/raspberry_soft_uart.c: In function ‘handle_rx_start’: /home/pi/soft_uart/raspberry_soft_uart.c:185:50: error: invalid operands to binary / (have ‘ktime_t’ and ‘int’) hrtimer_start(&timer_rx, ktime_set(0, period / 2), HRTIMER_MODE_REL); ^ scripts/Makefile.build:293: recipe for target '/home/pi/soft_uart/raspberry_soft_uart.o' failed

Issue is caused by line 185:
hrtimer_start(&timer_rx, ktime_set(0, period / 2), HRTIMER_MODE_REL);

I've fixed this with ktime_to_ns function:
hrtimer_start(&timer_rx, ktime_set(0, ktime_to_ns(period) / 2), HRTIMER_MODE_REL);

Hope that helps if anyone faces the same issue.

Can it work with Raspberry Pi 4 ?

Hi,

I am trying to get it to work with a raspberry PI 4, but for my setup I am not getting any results.
I open the serial port (I can see the open log in /var/log/messages), but when I write to it nothing happens.
For now I don't need to read anything, just write.
Can you direct me to some debugging strategies so I can figure out what's wrong with my setup ?
I sort of new to programming serial ports. On a side note, in this application I am developing I am successfully writing to the hardware serial port on the PI. The code for the soft UART is similat.

Thanks,
Regards

Invalid module format

There is a error while using "insmod soft_uart.ko" command on Raspberry PI 3

ERROR
insmod: ERROR: could not insert module soft_uart.ko: Invalid module format

OS Detials
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian

so can you help me solve this error
Thanks,

Where is raspberry_gpio.c ?

Hello,
Related to that title, i want to ask where is raspberry_gpio.c file ? I can't find that.
Can you help me ? thx.

Readme

Please correct the Readme, (or correct me if I am wrong).

This serial UART will NOT behave and be detected as a real available serial port.
It is listed with ls /dev/tty*, usable with minicom (as Linux pseudo tty ports are)
It is NOT listed as an active device by ls /sys/class/tty/tty*

/sys/class/tty/ttyAMA0:
close_delay   custom_divisor  device  iomem_base       io_type  line  power      type     uevent
closing_wait  dev             flags   iomem_reg_shift  irq      port  subsystem  uartclk  xmit_fifo_size

/sys/class/tty/ttyprintk:
dev  power  subsystem  uevent

/sys/class/tty/ttyS0:
close_delay   custom_divisor  device  hci0        iomem_reg_shift  irq   port   subsystem  uartclk  xmit_fifo_size
closing_wait  dev             flags   iomem_base  io_type          line  power  type       uevent

/sys/class/tty/ttySOFT0:
dev  power  subsystem  uevent

It will e.g. NOT work with ser2net and not be found as available ports by many applications detecting active serial ports like the Arduino IDE.

To be working exactly like a hardware-based serial port it should have been listed within ls /sys/class/tty/*/device/driver as having a device driver.

Thank you for considering this subtle difference.

lunix headers not found

Dear all,
I encountered an issue while simply using the make function. but as I searched quite a lot of internet pages I didn't clearly found the solution.
here is the message while trying the make function :
make -C /usr/src/linux-headers-4.14.79-v7+ M=/home/pi/soft_uart modules
make[1]: *** /usr/src/linux-headers-4.14.79-v7+ : Aucun fichier ou dossier de ce type. Arrêt.
Makefile:9 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

mu pi is on Raspbian GNU/LINUX 9.6.
the available headers are
linux-headers-3.10-3-all linux-headers-3.6-trunk-rpi
linux-headers-3.10-3-all-armhf linux-headers-4.4.0-1-all
linux-headers-3.10-3-common linux-headers-4.4.0-1-all-armhf
linux-headers-3.10-3-rpi linux-headers-4.4.0-1-common
linux-headers-3.16.0-4-all linux-headers-4.4.0-1-rpi
linux-headers-3.16.0-4-all-armhf linux-headers-4.4.0-1-rpi2
linux-headers-3.16.0-4-common linux-headers-4.9.0-6-all
linux-headers-3.16.0-4-rpi linux-headers-4.9.0-6-all-armhf
linux-headers-3.18.0-trunk-all linux-headers-4.9.0-6-common
linux-headers-3.18.0-trunk-all-armhf linux-headers-4.9.0-6-common-rt
linux-headers-3.18.0-trunk-common linux-headers-4.9.0-6-rpi
linux-headers-3.18.0-trunk-rpi linux-headers-4.9.0-6-rpi2
linux-headers-3.18.0-trunk-rpi2 linux-headers-rpi
linux-headers-3.6-trunk-all linux-headers-rpi2
linux-headers-3.6-trunk-all-armhf linux-headers-rpi2-rpfv
linux-headers-3.6-trunk-common linux-headers-rpi-rpfv

there is not the required one and I didn't any way with update action to fix it...
I really need to get extra Tx/RX pins. the existing one are already used...
please, any idea ??
many thank
xavier

Make error please help.

$(shell uname -r) = 5.10.103-v7+,
This is raspberry pi Zero 2W.

command -> sudo make
console text ->
make -C /usr/src/linux-headers-5.10.103-v7+ M= modules
make[1]: Enter directory '/usr/src/linux-headers-5.10.103-v7+'
make[2]: *** No rule to create required target 'arch/arm/tools/syscall.tbl' in 'arch/arm/include/generated/uapi/asm/unistd-common.h'. stoppage.
make[1]: *** [arch/arm/Makefile:307: archheaders] error 2
make[1]: Exit directory '/usr/src/linux-headers-5.10.103-v7+'
make: *** [Makefile:9: all] error 2

command -> sudo make clean
console text ->
make -C /usr/src/linux-headers-5.10.103-v7+ M= clean
make[1]: Enter directory '/usr/src/linux-headers-5.10.103-v7+'
arch/arm/Makefile:57: *** The recursive 'KBUILD_CFLAGS' variable is (eventually) referencing itself. stoppage.
make[1]: *** [Makefile:1832: _clean_arch/arm] error 2
make[1]: Exit directory '/usr/src/linux-headers-5.10.103-v7+'

Looking at other issues, it seems that the kernel version is 4.x. Should I lower my kernel version?

Please fix the error,,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.