Skip to content

BusError(Nack) for stm32l475 #4

@tasosxak

Description

@tasosxak

Hi guys,
I tried to use this driver with RTFM for stm32l475 (the Discovery kit for IoT node, stm32l4) and i get BusError(Nack):

let scl = gpiob.pb10.into_open_drain_output(&mut gpiob.moder, &mut gpiob.otyper).into_af4(&mut gpiob.moder, &mut gpiob.afrh);
    let sda = gpiob.pb11.into_open_drain_output(&mut gpiob.moder, &mut gpiob.otyper).into_af4(&mut gpiob.moder, &mut gpiob.afrh);
       
    let i2c = I2c::i2c2(
           dp.I2C2,
           (scl,sda),
           400.khz(),
           rcc.cfgr.freeze(&mut flash.acr),
          &mut rcc.apb1r1
           );

    let mut dis  = VL53L0x::new(i2c);

    let diss : vl53l0x::VL53L0x<hal::i2c::I2c<hal::stm32::I2C2, 
    (hal::gpio::gpiob::PB10<hal::gpio::Alternate<hal::gpio::AF4, 
    hal::gpio::Output<hal::gpio::OpenDrain>>>, 
    hal::gpio::gpiob::PB11<hal::gpio::Alternate<hal::gpio::AF4,
    hal::gpio::Output<hal::gpio::OpenDrain>>>)>>;

    match dis {
      Err(e) => hprintln!("{:?}",e).unwrap(),
      Ok(o) => diss = o,
    }

openocd session:

...
xPSR: 0x61000000 pc: 0x20000050 msp: 0x20018000, semihosting
Warn : block write succeeded
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1362). Workaround: increase "set remotetimeout" in GDB
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
adapter speed: 480 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08017288 msp: 0x20018000, semihosting
BusError(Nack)

Any idea what is wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions