-
Notifications
You must be signed in to change notification settings - Fork 33
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
SimpleFOC #95
Comments
I'd definitely be interested in custom boards being made so that they can be added here and to platform-gd32, so that they can be supported natively and with their right pin definitions. I'd also like to know if the core gets "in the way" of implementing the firmware / library due to weird behavior, bugs or missing (expectable) functionality, so we can get a feedback loop back into the core. |
Hi @maxgerhardt, So far we got the drivers working well but using SPL directly.
Sorry for sharing it all together here, I can create separate issues for better tracking. Thanks in advance. |
Just a quick note that I have working code for point 3 above (timer deadtime calculation). I need to clean it up and test is across the entire range, but should provide a way to calculate the value to program in the register without using any ST copyrighted code. I'll share once tested, in case you want to add it to the GD32 code |
Hi @maxgerhardt, Have you had a chance to look at this? Another enhancement that would be useful is to declare all the irq handlers as weak in case we want to define our own ones. If you agree I can create a PR for that. Thanks in advance. |
@Candas1: please also see issue #106 for the weak definition of the IRQ handlers. I'm copying the relevant portion here: "Just a quick note on the weak implementation: EXTI4_15_IRQHandler is already defined as weak here or here (I'm never sure which one is actually used) I don't know if the linker complains if there are only 2 definitions (one is startup.s, one in gpio_interrupt.c), both weak. Once I add my definition, it will be ok for me, but the average user is unlikely to redefine it, so both definitions are weak and it's unclear to me which one the linker will choose. I'm sure you understand this all much better than I do, though 😉" |
@robcazzaro And making this function weak worked. |
I'm not making myself clear, sorry. Let's try again. There is already a weak definition in the startup_gd32f1x0.s assembler file. The GD32 library overwrites it with a non-weak definition in C, so it all works. If you define the GD32 Arduino function in C as weak, then add yet another definition in your code, the linker sees two weak definitions (.s and .c), then one non-weak in your code, and it all works. That is what you did, and works just fine. But if the library defines that function as weak in C, without the user adding their own definition, then the linker sees only 2 weak definitions in .s and .c, and doesn't know what to do, raising an error. My point is that the GD32 Arduino library probably cannot define the IRQ handlers as weak because the average user, unlike you or me, will not redefine the IRQ handler in their code. I don't know how to solve this problem, but I'm flagging it for consideration. Hope this makes more sense :) |
ahhhhhh, ok 🤯 |
FYI I've not yet looked at it but hope to soon, along with doing a stable 1.0.0 release of this core. |
Thanks Maximilian, please let us know if there is anything we can help with. |
Hi,
Just for your information, we are working on creating a gd32 driver for SimpleFOC.
We are aiming for 6pwm using the advanced timer for now, and later work on the current sensing.
It's unfinished and untested so not ready to use.
Is there anything that can be useful to you? Like board definitions? Variants? New functions for advanced pwm?
The text was updated successfully, but these errors were encountered: