Closed RoboDurden closed 1 year ago
It's not about where this loop should be. This code works on arduino-stm32 and worked on gd32 with the spl code, but fails on arduino-gd32.
So it helps check if there is any issue in arduino-gd32.
It was happening with my setup so I will check if the recent arduino-gd32 fixed this issue when I am back home next week.
But thanks for your help with this. It could also be a specific to my setup.
Yes sorry, i fear that for you reading my words means more trouble and i better stay silent. I now only send data from ESP32 to Gen2_D32F130C6, and not sending data from Gen1 to sideboard_GD32F130C6 Next step would be to send your SerialFeedback struct from ESP32 and then test your receive function with your original Sidebaord-Arduino on a Gen2_GD32F130C6 In the end i might built myself another sideboard_GD32F130C6 test-setup and test ESP32<->sideboard_GD32F130C6 Tell me when this might help you.
Please don't get me wrong. All tests we can do will result in fixes in the firmware/libraries/framework that less experienced users won't face later.
So your help is really appreciated. For me the next step after that is to test i2c also, it will be very useful with the i2ccommander
Yes i like the i2ccommander too. I have some experience with using arduino i2c just like uart serial. So will be happy to add some i2c-slave test code to the GD-Arduino
Yes i like the i2ccommander too. I have some experience with using arduino i2c just like uart serial. So will be happy to add some i2c-slave test code to the GD-Arduino
That would be great. I have zero experience with i2c outside using IMUs
Adding a link to https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/issues/11#issuecomment-1584842216 for me to jog my memory once I get the GD32 boards and can start testing on real hardware. This way we track all Serial port issues (initialization, reliability) in one issue
Hi guys,
I finally came back yesterday. With the recent fixes, I could receive data with uart for 30 minutes without an issue, so it's fixed for me.
Nice to hear from you :-) I am a little disappointed that the driver port from you and @robcazzaro https://github.com/Candas1/Arduino-FOC/blob/master/src/drivers/hardware_specific/gd32/gd32_mcu.cpp hast not publicly making progress any more. Please inform me when it would be better for me to continue..
@Candas1 probably this was a clock issue. Having a chip overclocked by 50% can cause problems to anything with a strict timing like the serial port.
As an update, my boards have gone past US customs and are in the hands of the local delivery network in California, on their way to Seattle
@Candas1 probably this was a clock issue. Having a chip overclocked by 50% can cause problems to anything with a strict timing like the serial port.
As an update, my boards have gone past US customs and are in the hands of the local delivery network in California, on their way to Seattle
In any case, it looks more robust now. I am closing this issue.
@Candas1 i can even send from ESP to GD every 5 ms and everything gets returned. But the GD_rx buffer size seems to be 64 bytes because when i check for incoming data only every 100ms then only 63 bytes get returned:
The ESP-tx packets every 5ms are a counter
1375_
then the millis() of the ESP32109316
The GD-tx sent every 100ms is the millis() of the GD32GD32: 689300
So all 20 packets every 100ms (= 200 Hz) get received and sent back :-) If i however only read the rx buffer every 100ms, then only 63 chars get sent back:
i let an ESP 32 S2 mini sent serial Data to a GD32F130C6 split hoverboard to test if RX of the GD32-Arduino-Core is not working properly. I used my https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/blob/main/src/main.cpp#L154 which is based on your Sideboard-Arduino and which sends bldc data to ESP every 100ms and returns all incoming RX back to ESP.
I can not confirm that RX fails with the GD32-Arduino-Core :-/ And if your
loop()
is not blocked for too long, yourHoverserial::receive()
empties the rx buffer :-)In your Sideboard use case, the rx data would be realtime hoverboard data. Sending these at 10ms would mean 100 Hz data refresh rate - only needed for some closed loop control of speed or torque. I personally think that any realtime closed loop should be in the hoverboard firmware and NOT in the Sideboard controller. 100ms refresh rate = 10 Hz should be sufficient for any use case ?
Greetings from Germany, Roland and :-)