This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BEAGL-BONE-BLACK: Pulldown on GPIO Pinmux not working

Part Number: BEAGL-BONE-BLACK


Tool/software:

HI there,

I'm currently developing a bare metal operating system in rust on the beaglebone as my final highschool project. I successfully booted the controller and also managed to read and write to the GPIO pins.

I then tried to set a pulldown behaviour for the gpio pins through the pinmuxing, which I sucessfully achieved on the pin gpio1_28. But when trying to set the same for the pins gpio1_6 and gpio1_16 which correspond to the pins gpmc_ad6 and gpmc_a0 respectively, they behave the same as before.

I also tried to ask the deepseek ai about this, and it thought that it may be a lock on the pins, which isn't documented but was used by some things, but unfortunately I couldn't find anything regarding to that, so that could also just be false.

Felix

  • const CONTROL_MODULE_BASE: u32 = 0x44E10000;
    
    enum Offset {
        Lock = 0x20C,
        GpmcBen1 = 0x878, // GPIO1_28
        GpmcAd6 = 0x818,  // GPIO1_6
        GpmcA0 = 0x840,   // GPIO1_16
    }
    
    pub fn configure() {
        set_pin_mode(Offset::GpmcBen1, 7, true, PullResistor::PullUp);
        set_pin_mode(Offset::GpmcAd6, 7, true, PullResistor::PullDown);
        set_pin_mode(Offset::GpmcA0, 7, true, PullResistor::PullDown);
    }
    
    fn set_pin_mode(offset: Offset, mode: u32, input_enable: bool, pull_resistor: PullResistor) {
        write_addr(CONTROL_MODULE_BASE + Offset::Lock as u32, 0xAAAA);
        let control_module = CONTROL_MODULE_BASE + offset as u32;
    
        write_addr(
            control_module,
            (mode & 7) | pull_resistor.to_mask() | ((input_enable as u32) << 5),
        );
    }
    
    pub enum PullResistor {
        None,
        PullDown,
        PullUp,
    }
    
    impl PullResistor {
        pub fn to_mask(self) -> u32 {
            match self {
                PullResistor::PullDown => 0b00 << 3,
                PullResistor::PullUp => 0b10 << 3,
                PullResistor::None => 0b01 << 3,
            }
        }
    }
    
    This is the code to set the control module. Although it is rust which many won't be too familiar, I hope one can understand the code

  • Hi,

    Could you please check with the beagle community: https://www.ourbeagleworld.com/forums/

    Regards,
    Krunal