0

On my BeagleBone Black, when I run this script:

#!/usr/bin/node

var b = require('bonescript');

b.getPlatform(printData);
function printData(x) {
    console.log('name = ' + x.name);
    console.log('version = ' + x.version);
    console.log('serialNumber = ' + x.serialNumber);
    console.log('bonescript = ' + x.bonescript);
    console.log();
}

b.pinMode("P9_11", b.OUTPUT, 7, 'pullup', 'slow');
b.pinMode("P9_13", b.OUTPUT, 7, 'pullup', 'slow');
b.pinMode("P9_15", b.OUTPUT, 7, 'pullup', 'slow');
b.pinMode("P9_17", b.OUTPUT, 7, 'pullup', 'slow');

b.getPinMode("P9_11", printPinMux);
b.getPinMode("P9_13", printPinMux);
b.getPinMode("P9_15", printPinMux);
b.getPinMode("P9_17", printPinMux);

function printPinMux(x) {
    console.log('mux = ' + x.mux);
    console.log('pullup = ' + x.pullup);
    console.log('slew = ' + x.slew);
    if(x.options) {
        console.log('options = ' + x.options.join(','));
    }
    console.log('pin = ' + x.pin);
    console.log('name = ' + x.name);
    console.log('err = ' + x.err);
    console.log();
}

I get this output:

name = BeagleBone Black
version = 0A5A
serialNumber = 1813BBBK7710
bonescript = 0.2

mux = 7
pullup = pullup
slew = fast
options = gpmc_wait0,mii2_crs,NA,rmii2_crs_dv,mmc1_sdcd,NA,NA,gpio0_30
pin = P9_11
name = UART4_RXD
err = undefined

mux = 7
pullup = pullup
slew = fast
options = gpmc_wpn,mii2_rxerr,NA,rmii2_rxerr,mmc2_sdcd,NA,NA,gpio0_31
pin = P9_13
name = UART4_TXD
err = undefined

mux = 2
pullup = pulldown
slew = slow
options = spi0_cs0,mmc2_sdwp,i2c1_scl,NA,NA,NA,NA,gpio0_5
pin = P9_17
name = I2C1_SCL
err = undefined

mux = 0
pullup = pulldown
slew = fast
options = mii1_rxd3,NA,rgmii1_rd3,mmc0_dat5,mmc1_dat2,NA,mcasp0_axr0,gpio2_18
pin = P9_15
name = GPIO1_16
err = undefined

It looks like b.pinMode() isn't setting the pins' modes. Why?

Don Branson
  • 13,631
  • 10
  • 59
  • 101
  • What I've found out so far from G+ is that pins identified in the documentation as available for use by the user may not actually be useable. Certain pins are grabbed by the Linux kernel at boot time and are not available. As far as I've been able to find out, the list of pins that are truly available is not documented. Frankly, I'm annoyed that the pins are documented as available when they're really not, and that getting at the truth is like pulling teeth. I'm second-guessing my board choice. Is it like this with other boards? – Don Branson Jul 07 '13 at 19:24
  • Looks like kernel/devtree learning curve - the cicruitco/bonescript folks are helping out with this, and I'll post an update when I have something more. – Don Branson Jul 08 '13 at 02:34
  • Don Branson do you have any updates? – Vartan Arabyan Jul 25 '13 at 23:48
  • I did, but not with Node.js/bonescript. Jason is working like crazy to update bonescript for the new kernel, which depends on device trees for device management. It's the new, generic approach. In the meantime, I watched a video about device trees, read about them. Check this question, my response and the others, and I think that will help you: http://stackoverflow.com/questions/16872763/configuring-pins-mode-beaglebone. – Don Branson Jul 26 '13 at 00:59
  • @DonBranson Nice to run into someone with the same pain. And, good to hear that somone is aware of the issue and actually working on it. I dont know how you contacted Jason, and where he is at regarding the issue. I have begged him over chat, github, and the forums to simply take 2 minutes and explain to me where things are at. To no avail, not so much as as an acknowledgment that he even aware of the issue. If you hear anything please keep me in the loop. https://github.com/jadonk/bonescript/issues/50 https://github.com/jadonk/bonescript/issues/44 – Anthony Webb Aug 10 '13 at 15:23
  • @AnthonyWebb Join the BeagleBone Black community on Google+. I've pestered him unmercifully there (laying off lately) and he's responded when he's able. – Don Branson Aug 10 '13 at 15:38
  • @AnthonyWebb Also, see my answer here, which has info on how to do it with a DeviceTree overlay: http://stackoverflow.com/questions/16872763/configuring-pins-mode-beaglebone/16975301#16975301 – Don Branson Aug 10 '13 at 15:42
  • @DonBranson thanks for the link, I've been looking over the DeviceTreeOverlay stuff today. Pretty sure I can make it happen that way. Would be ideal for the users of my upcoming cape to simply pull and run the node script instead of having to manage overlays. So I am still optimistic there will be a solution for bonescript. – Anthony Webb Aug 10 '13 at 17:07
  • @AnthonyWebb - Good to see you on G+. I think there will be something in Bonescript, but it's probably a fair amount of work for Jason, so it may take a little time. – Don Branson Aug 10 '13 at 17:59
  • @DonBranson I know there are a lot of us in the community who are willing to help him in those efforts. Just need some direction from him on how he would like to accomplish it. Node can call all the command line calls that would be needed to accomplish the overlay, just not sure that is the most effective way. – Anthony Webb Aug 10 '13 at 18:15
  • We have forked bone script and created new, improved and bug free version of the same named octalbonescript. You can get it here: https://www.npmjs.org/package/octalbonescript Let me know if the issue still persists. – adityap Sep 11 '14 at 20:49

0 Answers0