Skip to content

Conversation

@JesseMcL
Copy link
Contributor

Add fix to no longer ignore GPIO pullup configurations in GPIO.setup by using ocp pinmux
Move PWM disable code for Kernel 4.1x to prevent segfault caused by writing to closed file handle

Added check in c_pinmux to handle bonescript format pin names eg P8_8, convert to P8_08 for ocp pinmux.

Call pinmux in py_setup_channel when setting up an input to allow configuration of pullup.

Add pinmux into GPIO compilation in setup.py

Moved the BBBVERSION41 section in pwm_disable to inside the loop checking for open pwm handles. Running stop without start resulted in a segfault from seeking/writing to a closed or non-existant enable_fd

Known Limitations
Tested only with Kernel 4.4 on bone-debian-8.4-iot build 2015-05-13
Changes were made with consideration of kernel < 4.1 but not tested

…bonescript uses eg, P8_6 instead of P8_06 which OCP needs)
Outside the list iteration loop it causes a seg fault from writing to a closed/invalid handle if PWM.stop is called when the PWM is not open
@pdp7
Copy link
Collaborator

pdp7 commented Oct 18, 2016

I've tested JesseMcL/adafruit-beaglebone-io-python [96d4065] OK for:

4.1.16-ti-rt-r44

  • Debian 8.3
  • Debian Image 2016-01-31
  • cape-universal enabled
root@beaglebone:~/pr/adafruit-beaglebone-io-python/test# py.test
platform linux2 -- Python 2.7.9, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /root/pr/adafruit-beaglebone-io-python, inifile: 
collected 57 items 
test_adc.py ......
test_gpio_input.py ..
test_gpio_output.py ......
test_gpio_setup.py ..........
test_led.py ..
test_pwm_setup.py ..........................
test_spi.py ..
test_uart.py ...
57 passed in 6.40 seconds

4.4.24-bone14

  • Image 2016-09-18
  • Debian 8.6
  • cape-universal enabled
root@beaglebone:~/pr/adafruit-beaglebone-io-python/test# py.test 
platform linux2 -- Python 2.7.9, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /root/pr/adafruit-beaglebone-io-python, inifile: 
collected 57 items 
test_adc.py ......
test_gpio_input.py ..
test_gpio_output.py ......
test_gpio_setup.py ..........
test_led.py ..
test_pwm_setup.py ..........................
test_spi.py ..
test_uart.py ...
57 passed in 4.59 seconds 

3.8.13-bone81

  • Image 2014-05-14
  • Debian 7.5
  • Disabled: BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
platform linux2 -- Python 2.7.3, pytest-3.0.1, py-1.4.31, pluggy-0.3.1
rootdir: /root/pr/adafruit-beaglebone-io-python, inifile: 
collected 57 items 

test_adc.py ......
test_gpio_input.py ..
test_gpio_output.py ......
test_gpio_setup.py ..........
test_led.py ..
test_pwm_setup.py ..........................
test_spi.py ..
test_uart.py ...

57 passed in 16.59 seconds

3.8.13-bone80

  • Debian 7.11
  • Image 2016-06-15
  • Disabled: BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
platform linux2 -- Python 2.7.3, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /root/pr/adafruit-beaglebone-io-python, inifile: 
collected 57 items 

test/test_adc.py ......
test/test_gpio_input.py ..
test/test_gpio_output.py ......
test/test_gpio_setup.py ..........
test/test_led.py ..
test/test_pwm_setup.py ..........................
test/test_spi.py ..
test/test_uart.py ...

@pdp7 pdp7 merged commit e7e987a into adafruit:master Oct 19, 2016
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.

2 participants