Skip to content
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

GD32F130C8T6 #3

Closed
tonvanhieu opened this issue Feb 25, 2020 · 13 comments
Closed

GD32F130C8T6 #3

tonvanhieu opened this issue Feb 25, 2020 · 13 comments

Comments

@tonvanhieu
Copy link

My sideboard chipset is GD32F130C8T6 different from yours (C6T6). I have flashed your firm ware to my chip success but it can't read MPU data. Do you know what i have to do to make project is suitable with C8T6 chip

@EFeru
Copy link
Owner

EFeru commented Feb 25, 2020

Looking at the memory map GD32F130C8T6 vs STM32F103C8T6 there are similarities but also differences. So, I don't think the hoverboard-sideboard-hack-STM version would match.

I think you need to download the GD32F1x0_Firmware_Library_V3.1.0 from here:
https://gd32mcu.21ic.com/documents
search for GD32F1x0 and download the files. Then replace the library.

In quick words these should be the steps. Let me know about the progress.

image

@EFeru
Copy link
Owner

EFeru commented Feb 25, 2020

oh, I just noticed is the same GD library, the C8T6 has only more memory (Flash: 64K, Ram: 8K ) than the C6T6 (Flash: 32K, Ram: 4K).
After flashing, does the LEDs blink?

Edit: Can you check the connection of I2C_SDA and I2C_SCL pins from MPU6050 towards the GD32? Which pins of the GD32 are used for that?

@tonvanhieu
Copy link
Author

I'm checking it.
I just change device from device list and the "Programming Algorithm" then I can flash it normally. But i have problem with debugging by Keil 5. Variables that i add to WATCH window don't change, it's always ZERO.
Yes, the center LEDs blink.
I have checked I2C, it's same as yours ( I2C_0, PB6 and PB7). Because i can't debug so i don't know if it can read or not ( i will check it by USART later).

@EFeru
Copy link
Owner

EFeru commented Feb 25, 2020

That is a good sign! And do you get Green LED after the blink? That is an indication the MPU6050 is working fine.
Edit: For debugging and playing with the board a bit you need one of this. I heard someone did it with an ESP32, maybe an Arduino also works... basically you need a Serial Communication, but this you know :)

@tonvanhieu
Copy link
Author

I will check it later ( i have to go to school now).
By the way my MPU is 6052, is it same with 6050?

Reply edit: yeah i know about that, in my case i use my USART-Bluetooth module (HC-05 - from my old project 😄 ).

@EFeru
Copy link
Owner

EFeru commented Feb 25, 2020

MPU6052 is probably a newer variant, theoretically it should work, practically I didn't check because I don't have it.

@tonvanhieu
Copy link
Author

tonvanhieu commented Feb 26, 2020

BIG PROBLEM WITH DELAY FUNCTION.
It's always stuck when meet delay(>400). I don't know why. When i delete introDemoLED(100); it configuring MPU non-stop.
image
Edit: Do i need power the board by 15V to enable MPU???

@EFeru
Copy link
Owner

EFeru commented Feb 26, 2020

You need to power the board with at least 12V. I noticed similar funny behavior when I was powering the board with 7.5V from an external source.
So, yes, either use the an external source with 12V or use the mainboard power.

@tonvanhieu
Copy link
Author

delay_ms(); make program be stuck. How to fix it :((. i feel so impotent.
I have tried power it by mainboard but nothing change.
Sensors work well but mpu not yet.

@tonvanhieu
Copy link
Author

It's all about delay function. when i change delay time in mpu_init() below 10 the board can go 1 more step (writing DMP). So, if i can find out what happen to delay_ms() i can solve that. But i still can't :((. Delay_ms() kill me.
image

@EFeru
Copy link
Owner

EFeru commented Feb 26, 2020

How did you unlock your GD32 chip?

I had similar behavior with one board. To fix it I did the following (please try):

  • Lock back the GD32 with ST Link Utility
  • Unlock the GD32 as described here
  • At Step 6, check all the boxes for "User configuration option bytes"
  • Flash and try

@tonvanhieu
Copy link
Author

tonvanhieu commented Feb 26, 2020

I follow you at step 6 and this box appear
image
Any wrong with it?
EDIT: OH MY GODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD.
It WORKS. OMG. YOU ARE GOD.
Let me call you teacher from now. You teach me so much.

@EFeru
Copy link
Owner

EFeru commented Feb 26, 2020

Hahaha...:) Good that it works. The error is no issue.
Yeah.. sometimes the unlocking is not done properly and you get funny behavior.

EDIT: I will put this as a side note in the unlocking process. If someone else has the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants