-
Notifications
You must be signed in to change notification settings - Fork 29
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
Does the GD32F303CCT6 have a FPU? #4
Comments
Yes, We tested that its FPU was OK,
Result is |
That's interesting it doesn't work for me at all unfortunately - when I read back the CPACR register after writing 0b11 to CP_10 and CP_11 they are still 0. Would it be possible to add another (minimal) example project in the examples directory with this working? |
As a further update I received a few more BluePill-Plus / GD32F303 boards recently. I built the GNU-template project that has been added to repository (thanks!) and enabled the FPU compiler settings. The new boards work perfectly fine - and the temperate and Vref is calculated using the FPU. Looking at the processor markings the two sets of boards clearly have processors from different batches as the markings are different. |
I'm glad to hear that my contribution is helpful, keil is a powerful ide, but I believe open source toolchain is better. Considering your situation, it's possible that some batches have bugs in fpu. Have a nice day! |
Eventually got around to replacing an MCU with a non-working FPU with a replacement part (GD32F303CG). |
When I try and compile code using hardware floating point I get a HardFault exception on the first instruction that tries it execute a floating point instruction. The fault indicated is NOCP despite have written to 0b11 to CP_10 and CP_11 of the CPACR.
I've tried with IAR, Keil and GCC each with the same results. Indeed, if I take the example 04-MSC_internal_flash and then adding some floating point arithmetic to main() results in the HardFault. This can be cured by changing the 'Floating Point Hardware' from 'Use Single Precision' to 'Not Used'. The compiler no longer generates FPU instructions and the code works.
The text was updated successfully, but these errors were encountered: