Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

[Linux] No ttysWK device files

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75

【Linux】 No ttysWK device files

Posted at 7/7/2023 19:36:07      View:1303 | Replies:7        Print      Only Author   [Copy Link] 1#
  • Type: Self-Compiled Firmware
  • SDK Package Name: ??
  • Last Commit: 0000-00-00 00:00:00
  • Modification Content: ??
  • Log: log.zip
Problem description and steps to reproduce:
Last edited by EugenyB1 In 7/7/2023 23:27 Editor

Edit:

So we have two problems:
(1) my local bench assembles update.img without support of these sWK files - why? What should I do?
(2) I see nothing in the scope output when writing to any of these files with standard buildroot image running. Is device faulty?


More info:

I compiled this T-Firefly / rk3308-linux · GitLab (howver the source code was downloaded approximately a year ago) and I do not see RS485 device files in the list.

  1. RS485_1: /dev/ttysWK0
  2. RS485_2: /dev/ttysWK1
  3. RS485_3: /dev/ttysWK2
  4. RS232  : /dev/ttysWK3
Copy the code


How to identify which device file corresponds to each RS485 serial port?

  1. / # cat /proc/tty/driver/serial
  2. serinfo:1.0 driver revision:
  3. 0: uart:unknown port:00000000 irq:0
  4. 1: uart:unknown port:00000000 irq:0
  5. 2: uart:unknown port:00000000 irq:0
  6. 3: uart:unknown port:00000000 irq:0
  7. 4: uart:unknown port:00000000 irq:0
Copy the code
  1. / # echo "aaa" > /dev/ttyS0
  2. sh: write error: Input/output error
  3. / # echo "aaa" > /dev/ttyS1
  4. sh: write error: Input/output error
  5. / # echo "aaa" > /dev/ttyS2
  6. sh: write error: Input/output error
  7. / # echo "aaa" > /dev/ttyS3
  8. sh: write error: Input/output error
  9. / # echo "aaa" > /dev/ttyS4
  10. sh: write error: Input/output error
Copy the code

Executable file spi-wk2xxx has the following
  1. :con_wk2xxx_subport bad iobase %d
  2. 1: bad iobase %d
  3. wk2xxx-%d %s cannot create workqueue
  4. wk2xxxspi cannot allocate irq %d
  5. ttySWK ttysWK
Copy the code
but I do not see source for it.
  1. /proc/tty # cat drivers
  2. /dev/tty             /dev/tty        5       0 system:/dev/tty
  3. /dev/console         /dev/console    5       1 system:console
  4. /dev/ptmx            /dev/ptmx       5       2 system
  5. /dev/vc/0            /dev/vc/0       4       0 system:vtmaster
  6. rfcomm               /dev/rfcomm   216 0-255 serial
  7. usbserial            /dev/ttyUSB   188 0-511 serial
  8. serial               /dev/ttyS       4 64-68 serial
  9. pty_slave            /dev/pts      136 0-1048575 pty:slave
  10. pty_master           /dev/ptm      128 0-1048575 pty:master
  11. unknown              /dev/tty        4 1-63 console
  12. fiq-debugger         /dev/ttyFIQ   254       0 serial
Copy the code





Now I am comparing behavior of IHC3308GW-Buildroot-20211221.img (original) with mehavior of my compiled image:
original
  1. [    1.120580] pwm-regulator vdd-core: lookup for GPIO enable failed
  2. [    1.121418] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
  3. [    1.124688] [drm] Initialized drm 1.1.0 20060810
  4. [    1.124846] random: nonblocking pool is initialized
  5. [    1.127942] Unable to detect cache hierarchy for CPU 0
  6. [    1.135358] loop: module loaded
  7. [    1.135600] SCSI Media Changer driver v0.25
  8. *******************************************
  9. [    1.136809] rockchip-spi ff120000.spi: Failed to request TX DMA channel
  10. [    1.136851] rockchip-spi ff120000.spi: Failed to request RX DMA channel
  11. [    1.139473] 11wk2xxx_probe: setup mode 0, 8 bits/w, 10000000 Hz max
  12. [    1.139557] of_get_named_gpiod_flags: parsed 'power-gpio' property of node '/spi@ff120000/spi_wk2xxx@00[0]' - status (0)
  13. [    1.139629] of_get_named_gpiod_flags: parsed 'reset-gpio' property of node '/spi@ff120000/spi_wk2xxx@00[0]' - status (0)
  14. [    1.309710] of_get_named_gpiod_flags: parsed 'irq-gpio' property of node '/spi@ff120000/spi_wk2xxx@00[0]' - status (0)
  15. [    1.309760] of_get_named_gpiod_flags: parsed 'cs-gpio' property of node '/spi@ff120000/spi_wk2xxx@00[0]' - status (0)
  16. [    1.309957] wk2xxx_serial_init()
  17. [    1.309981] wk2xxx_request_port
  18. [    1.310001] ttysWK0 at I/O 0x1 (irq = 87, base_baud = 460800) is a wk2xxx
  19. [    1.310404] uart_add_one_port success for line i:= 0 with right 0
  20. [    1.310429] wk2xxx_request_port
  21. [    1.310445] ttysWK1 at I/O 0x2 (irq = 87, base_baud = 460800) is a wk2xxx
  22. [    1.310733] uart_add_one_port success for line i:= 1 with right 0
  23. [    1.310754] wk2xxx_request_port
  24. [    1.310770] ttysWK2 at I/O 0x3 (irq = 87, base_baud = 460800) is a wk2xxx
  25. [    1.311037] uart_add_one_port success for line i:= 2 with right 0
  26. [    1.311060] wk2xxx_request_port
  27. [    1.311076] ttysWK3 at I/O 0x4 (irq = 87, base_baud = 460800) is a wk2xxx
  28. [    1.311392] uart_add_one_port success for line i:= 3 with right 0
  29. [    1.311412] uart_add_one_port = 0x0
  30. *******************************************
  31. [    1.311468] register spi return v = :0
  32. [    1.311538] lora1276 register spi return v = :0
  33. [    1.311585] CAN device driver interface
  34. [    1.324486] rk_gmac-dwmac ff4e0000.ethernet: clock input or output? (input).
  35. [    1.324542] rk_gmac-dwmac ff4e0000.ethernet: Can not read property: tx_delay.
  36. [    1.324561] rk_gmac-dwmac ff4e0000.ethernet: set tx_delay to 0x30
  37. [    1.324577] rk_gmac-dwmac ff4e0000.ethernet: Can not read property: rx_delay.
  38. [    1.324594] rk_gmac-dwmac ff4e0000.ethernet: set rx_delay to 0x10
  39. [    1.324619] rk_gmac-dwmac ff4e0000.ethernet: integrated PHY? (no).
  40. [    1.324896] rk_gmac-dwmac ff4e0000.ethernet: clock input from PHY
  41. [    1.329934] rk_gmac-dwmac ff4e0000.ethernet: init for RMII
  42. [    1.330088] stmmac - user ID: 0x10, Synopsys ID: 0x35
Copy the code
my:
  1. [    1.115818] pwm-regulator vdd-core: lookup for GPIO enable failed
  2. [    1.116614] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
  3. [    1.119964] [drm] Initialized drm 1.1.0 20060810
  4. [    1.120073] random: nonblocking pool is initialized
  5. [    1.122757] Unable to detect cache hierarchy for CPU 0
  6. [    1.130107] loop: module loaded
  7. [    1.130362] SCSI Media Changer driver v0.25
  8. *******************************************
  9. [    1.131067] register spi return v = :0
  10. [    1.131143] lora1276 register spi return v = :0
  11. [    1.131196] CAN device driver interface
Copy the code



original
  1. / # find . | grep wk2xxx
  2. ./sys/bus/spi/drivers/wk2xxxspi
  3. ./sys/bus/spi/drivers/wk2xxxspi/bind
  4. ./sys/bus/spi/drivers/wk2xxxspi/spi0.0
  5. ./sys/bus/spi/drivers/wk2xxxspi/uevent
  6. ./sys/bus/spi/drivers/wk2xxxspi/unbind
  7. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00
  8. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/reg
  9. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/name
  10. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/cs-gpio
  11. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/power-gpio
  12. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/compatible
  13. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/spi-max-frequency
  14. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/irq-gpio
  15. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/reset-gpio
  16. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/status
  17. ./sys/firmware/devicetree/base/spi@ff120000/spi_wk2xxx@00/phandle
  18. ./sys/firmware/devicetree/base/__symbols__/spi_wk2xxx
Copy the code
my
  1. / # find . | grep wk2xxx
  2. find: ./proc/880: No such file or directory
  3. ./sys/bus/spi/drivers/wk2xxxspi
  4. ./sys/bus/spi/drivers/wk2xxxspi/bind
  5. ./sys/bus/spi/drivers/wk2xxxspi/uevent
  6. ./sys/bus/spi/drivers/wk2xxxspi/unbind
Copy the code
Therefore device driver is present in my build, but it totally refuses to see the hardware.

Before this driver initialization in the kernel log, there's something else missing in my build:
  1. [    0.455758] of_get_named_gpiod_flags: parsed 'gpio' property of node '/vcc3v3-4g-power-regulator[0]' - status (0)
  2. [    0.456329] of_get_named_gpiod_flags: parsed 'gpio' property of node '/vcc3v3-4g-reset-regulator[0]' - status (0)

Copy the code









log.zip

155 Bytes, Down times: 0

Reply

Use props Report

1637

Credits

0

Prestige

0

Contribution

administrator

Rank: 9Rank: 9Rank: 9

Credits
1637
Posted at 7/8/2023 09:36:08        Only Author  2#
So the device you're using is iHC-3308GW?
Reply

Use props Report

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 7/8/2023 13:42:36        Only Author  3#
Firefly Posted at 7/8/2023 09:36
So the device you're using is iHC-3308GW?

Yes, and I have built clear firmware using https://gitlab.com/TeeFirefly/rk3308-linux, and sWK files do not appear. I am now following instruction at here https://wiki.t-firefly.com/en/Core-3308Y/linux_compile.html. This instruction has several issues:
1. the following code assumes files were extracted in order 0 1 2 3 ...
  1. cat path/to/rk3308_linux_release_v1.5.0a_20221212_split_dir/*firefly_split* | tar -xzv
Copy the code

If they are not, execution fails.
2. The following must be performed within rk* directory, but there's no cd command in the instruction
  1. .repo/repo/repo sync -l
Copy the code
Reply

Use props Report

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 7/8/2023 14:12:58        Only Author  4#
Update: confirmed that compiling from this distribution with application of those instructions produce working image with sWK* files.
Now second issue remains: why
  1. echo "aaa" > /dev/ttyswK0
Copy the code

does not produce any waveform in the rs485_1 port.
Reply

Use props Report

26

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
26
Posted at 7/8/2023 16:50:50        Only Author  5#
Please send me log.

  1. cat /proc/version
Copy the code
Reply

Use props Report

26

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
26
Posted at 7/8/2023 17:33:24        Only Author  6#
The kernel I compiled using this configuration file is no problem. Do you have ttysWk with buildroot now?
  1. ll device/rockchip/.BoardConfig.mk
  2. device/rockchip/.BoardConfig.mk -> rk3308/ihc-3308gw-ubuntu.mk
Copy the code
Reply

Use props Report

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 7/9/2023 06:11:49        Only Author  7#
Last edited by EugenyB1 In 7/9/2023 06:44 Editor

Yes, I have these device files now.

But I have another problem.

./build.sh script does not compile and include my application. "make menuconfig" does not work from the project root, it works from buildroot/, and I compile my package using make in buildroot/, but ./build.sh anyway does not include the package.
I have put my package into buildroot/package/, and into external/ with no difference.

How to properly install the custom package into the compilation of your buildroot image?
Edit: found instructions here https://wiki.t-firefly.com/en/Firefly-Linux-Guide/manual_buildroot.html in 11.2.
Reply

Use props Report

26

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
26
Posted at 7/10/2023 10:36:40        Only Author  8#
The ./build.sh script will use this firefly_rk3308_release config, so your "make menuconfig" is invalid, you can modify firefly_rk3308_release config or "make menuconfig", and compile manually under buildroot.

  1. Linux/3308/device/rockchip/rk3308$ cat BoardConfig_RK3308B_firefly.mk | grep RK_CFG_BUILDROOT
  2. export RK_CFG_BUILDROOT=firefly_rk3308_release
Copy the code
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list