-
Notifications
You must be signed in to change notification settings - Fork 88
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
Communicating with sideboard via USART #25
Comments
Hi, Have you seen this? |
Sure, but I can't see how it may help. |
Not all imu's are supported... |
It's MPU-6050. Nevertheless, where must be at least start codes (0xabcd), but it's all zeroes. |
Have you tried debug variant ? |
Yes, but it's even harder to debug, since the board doesn't send anything at all. And doesn't receive as well. |
Weird. |
Hmmm.. i doubt they are fried. I've never used 5V TTL levels just in case, since one of UARTs of main board isn't 5V tolerant. |
FYI, this should be the frame that is being sent by the sideboard |
Flashed VARIANT_DEBUG. Sent 'h' and got a reply! Strange, it didn't work earlier. |
Alas. Now I can send commands and receive replies, but something seems to be wrong:
Sometimes it getting stuck on |
Could be a bad clone of MPU6050 |
Hi @redeemarr, At least you should be able to read raw accelerometer and gyro data if communication with the MPU is working. DMP is not working on all chips so is more challenging. |
Hi @EFeru!
btw, i've zeroed gyro and accel variables in mpu_start_self_test just in case:
Looks like GD cannot communicate with MPU. Strange, the hoverboard was fully functional before disassembling. |
Can you try my fork ? |
@Candas1 yes, thank you. |
Really weird... |
Checked power source, turned current knobs to maximum, nothing changes. |
If there is really an ICM-20602 inside, it's means there is no DMP for angle calculation. I will check if I have any sideboard with ICM-20602 IMU, and if it behaves the same. |
I'd check whether i2c is functional, but i have no idea how to do this lol. |
Hmmm there is something weird with my code, it shouldn't say 0x12 for this chip. On those MPU6050A DMP won't work, so you can read raw accelerometer an gyroscope data, but not the angles. |
I bet your code is ok, something is wrong on my side - maybe flashing process, maybe power source. I'll investigate further. |
I did my tests by just powering the board with 3.3v via the stlink, and it was ok. |
How did you read back data on UART? I'm wondering is it safe to connect both stlink and usb-ttl adapter to pc simultaneously. |
Never had a problem with that. USB-TTL is set to 3.3v, only connecting TX/RX/GND. |
Sigh.. powered the board with stlink (3.3v) - no changes. st-flash usage (maybe i'm doing smth wrong):
Also tried to flash with pio:
|
Maybe try disabling the DMP in config.h |
Disabled DMP, no changes. It was obvious, since WHOAMI still gives ICM-20602. |
Pulled, disabled DMP, flashed, same result. I'm pretty sure something wrong happens in flashing process. Probably those GS chips are fake ones and the firmware doesn't flash fully. I'll try to find another MCUs for replacement and other boards to test. |
I am flashing from platformio, which is set up to use a particular toolchain package/version. |
Thank you, finally, some progress!
|
What if you disable DMP in config.h now ? |
It was disabled already. Hmmm.. I can try to enable it for green boards. |
In my case, when I disable the DMP with a MPU6050A, I can see values and it's moving. It's weird that see non zero values and it's not moving |
At last!
So the problem was in flashing process (correct setup of option bytes). Should I close this issue now? |
Yep, it does. Strange.
Step 6 describes how to disable read protection, but nRST_STOP, nRST_STDBY and WDG_SW are not set. Seems like that was essential. Also i've set up user data storage option bytes to 0xFF. Edit: ah, nevermind, my bad, I missed this: |
OK I think this was discovered later with GD32 chips, it's mentioned in the troubleshooting only |
Hi!
I'd like to use sideboard as UART-driven sensor, i.e. the goal is to read gyro/accelerometer data via UART.
Had some problems flashing the GD chip using ST-link utility, but solved them with st-flash.
Connected sideboard to external power source with 15V and connected it via USB-TTL adapter to PC's USB port (this have worked earlier with main board)
Tried different variants and noticed the following:
But values in the buffer are all zeroes.
Again, this setup worked normally when used with gyro's mainboard (sending commands, reading feedback).
I'm out of ideas. Maybe serial setup is different for sideboard?
The text was updated successfully, but these errors were encountered: