Skip to content

Make now is building out of the box.#2

Open
cbalint13 wants to merge 4 commits into
MathewKing:masterfrom
cbalint13:master
Open

Make now is building out of the box.#2
cbalint13 wants to merge 4 commits into
MathewKing:masterfrom
cbalint13:master

Conversation

@cbalint13
Copy link
Copy Markdown

@cbalint13 cbalint13 commented Aug 29, 2020

Hi Mathew !

This PR address:

  • clean up all spurious end-line trailing spaces.
  • make build out of the box on any distro also recent kernels.
  • use chips internal SPI parameters in all transactions.
  • add optional debug module parameter.

For best review PR is composed of 4 consecutive commits.


On Fedora 33

[cbalint@yoda ~]$ rpm -qa kernel-devel
kernel-devel-5.8.1-300.fc33.x86_64

Bulding requires a simple make:

[root@yoda mcp2210-linux]# make
make -C /lib/modules/5.8.1-300.fc33.x86_64/build M=/home/cbalint/work/mcp2210-kernel/mcp2210-linux modules
make[1]: Entering directory '/usr/src/kernels/5.8.1-300.fc33.x86_64'
  CC [M]  /home/cbalint/work/EHV/usb-stick/mcp2210-kernel/mcp2210-linux/mcp2210-core.o
  CC [M]  /home/cbalint/work/EHV/usb-stick/mcp2210-kernel/mcp2210-linux/mcp2210-spi.o
  LD [M]  /home/cbalint/work/EHV/usb-stick/mcp2210-kernel/mcp2210-linux/mcp2210.o
  MODPOST /home/cbalint/work/EHV/usb-stick/mcp2210-kernel/mcp2210-linux/Module.symvers
  CC [M]  /home/cbalint/work/EHV/usb-stick/mcp2210-kernel/mcp2210-linux/mcp2210.mod.o
  LD [M]  /home/cbalint/work/EHV/usb-stick/mcp2210-kernel/mcp2210-linux/mcp2210.ko
make[1]: Leaving directory '/usr/src/kernels/5.8.1-300.fc33.x86_64'

Kernel outputs:

[root@yoda mcp2210-linux]# dmesg 
[ 4628.057328] hid-generic 0003:04D8:00DE.0002: hiddev96,hidraw1: USB HID v1.11 Device [DeepWorks LoRA] on usb-0000:03:00.0-2/input0
[ 4630.024283] mcp2210 0003:04D8:00DE.0002: hiddev96,hidraw1: USB HID v1.11 Device [DeepWorks LoRA] on usb-0000:03:00.0-2/input0
[ 4630.075661] mcp2210 0003:04D8:00DE.0002: controller is unqueued, this is deprecated
[ 4630.075663] mcp2210 spi master registered bus number 0
[ 4630.077794] MCP2210 SPI settings: bitrate=100000(bit/s) idle_cs=001000000 active_cs=110111111 cs_ds_delay=500(us) cs_ls_delay=500(us) byte_delay=0(us) byte_per_spi=2 spi_mode=0x00

The kernel SPI dev is ready to be consumed (e.g. python spidev or favorite way):

[root@yoda mcp2210-linux]# ls -l /dev/spidev0.0 
crw------- 1 root root 153, 0 Aug 29 20:11 /dev/spidev0.0

I am using https://github.com/lkundrak/mcp2210 tool to manipulate chip internals.
Tested on https://workspace.circuitmaker.com/Projects/Details/Cristian-Balint/USB-LoRa

@cbalint13 cbalint13 changed the title Make now is building of the box. Make now is building out of the box. Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant