-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BusError(Nack) for stm32l475 #4
Comments
Nobody answered on a bus. I've read the documentation and it seems that they configured i2c address differently (from 7.15 I2C addresses of modules used on MB1297). Try to change it here: https://github.com/copterust/vl53l0x/blob/master/src/lib.rs#L21 |
But the manual says that the read address is 0x52 and the write one is 0x53 which comes down to |
True, can you use any other device on that i2c? |
Yes magnetometer , but no hts221 (nack error) |
Another idea -- they have VL53L0X_XSHUT connected, maybe it is pulled to off? |
Xshutdown pin, Active LOW -- so try to output high on the corresponding pin. |
According to this: PC6 -- GPIO_Output -- VL53L0X_XSHUT. So configure it as an output and set to high. |
Also add the delay for 1.2ms after pin rise (it's the boot time of vl.) |
Because rtfm takes ownership of SySTick , i add a for loop for the delay. |
I wonder if it compiles or that loop just got optimized out? |
the message however does appear after some seconds |
@tasosxak you can also use |
@tasosxak Let’s check if it is a driver problem or something else. Can you try something like:
|
Compiler error:
|
openocd output:
|
Docs of asmdelay should be updated, I guess. AsmDelay uses bitrate crate, so you should do Alternatevely, you could use just |
@tasosxak so it looks like a problem on a bus. I'm still 98% sure that an empty for loop will be removed by the compiler so please try reading who_am_i register after the delay implemented via AsmDelay, or cortex_m::asm::delay. |
I really i dont know why i get this error |
I tried "cortex_m::asm::delay;" so now :
openocd:
|
Are C examples for vl53 work on your board? |
I didn't try with C. As I said magnetometer which uses i2c works fine. |
To sum up:
So it is either:
Running official C VL53 example for this board would either confirm, or disprove hardware problem. |
BTW: I’ve found the schematics of your board, they do have a pull-up resistor on a xshut pin of vl, so you could remove that code, it seems that it does nothing at all. |
I didn't call who_am_i function if is important i can try. |
Who am I is the register inside vl and you are reading it directly without a driver with a line |
So if who_am_i register doesnt work it should not work magnetometer right? |
Something is wrong before the driver. You need to debug it a bit. To understand what exactly try C example (if there is one that comes with this board.) Or maybe ask the embedded_hal team. |
I checked it on another stm32l475 board and I get the same error. |
Is it your board? https://www.st.com/en/evaluation-tools/b-l475e-iot01a.html |
Yes |
Also the link of issue for hts221 sensor: |
I've the same problem for STM32L432 board |
Hi guys,
I tried to use this driver with RTFM for stm32l475 (the Discovery kit for IoT node, stm32l4) and i get BusError(Nack):
openocd session:
Any idea what is wrong?
The text was updated successfully, but these errors were encountered: