This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
If you compiled your code for floating point support and the FPU wasn't enabled - you would be getting undefined instruction exceptions. So likely your FPU is enabled. But you can check this by checking the FPEXC register (refer to Cortex R4 TRM for details) bit 30 is the VFP enable.
You should:
1) try the Cortex R4F CMSIS DSP library implementation of the function you need
2) make sure that you are compiling with optimization on and not with debug.
3) make sure that the device is initilized correctly (max freq., flash pipeline enabled w. correct wait states).
4) try compiling for the Thumb2 instruction set instead of the ARM instruction set.
Anthony Seely,
you say that ,
You should:
1) try the Cortex R4F CMSIS DSP library implementation of the function you need
2) make sure that you are compiling with optimization on and not with debug.
3) make sure that the device is initilized correctly (max freq., flash pipeline enabled w. correct wait states).
4) try compiling for the Thumb2 instruction set instead of the ARM instruction set.
To use the FPU,I must be insure the above 4 item is correct?
Now:
1. I do not use Cortex R4F CMSIS DSP library,the library is must be use to use FPU?
2. I now optimization level = 3; optimize for speed = 5; in release configuration
3. If I use HALCOGEN to generate the initilized program to the device, is the device can be initilized correctly? if not,how can I flash pipeline enabled w. correct wait states?
4. How can I set Thumb2 instruction set when I compiling ?
Best Regards,
Wang
Anthony Seely,
Do you have an example program to use the FPU? if you have the example program ,can you email it to me?
thank you !
Best Regards,
Wang
Anthony Seely,
I check the FPEXC register bit 30 ,this bit is set, so the FPU is enable .
Best Regards,
Wang
Hi Wang,
These suggestions are mainly targetted at addressing your concern about performance - not basic functionality.
No not *required*. There are Thumb2 and ARM versions of the FPU instructions. But it may help performance. Something to try.user4089018 said:To use the FPU,I must be insure the above 4 item is correct?
Not a must. But the point of the library is that the functions were hand optimized for performance.user4089018 said:1. I do not use Cortex R4F CMSIS DSP library,the library is must be use to use FPU?
user4089018 said:2. I now optimization level = 3; optimize for speed = 5; in release configuration
Ok that's good.
Yes usually. You can disable the FPU on the R4-MPU-PMU tab but you would have had to go out of your way to do this; the default is enabled. HalCoGen should base the flash wait states automatically on your clock freq to prevent this from being wrong.
There is a build option in CCS, under the Arm Compiler - Processor options tab for code state. You want 16 and not 32 for thumb 2.
I am not sure Thumb2 will improve performance. It does in some benchmarks. The floating point instructions are all 32-bit Thumb2** so it will not improve the float functions much but it might improve surrounding instructions and if these are in your critical 'loops' it could add up.
**[Thumb2 is variable length some opcodes are 16 bit and some are 32-bit... but the CCS option is still called 16-bit which is a hold-over from older parts that just had Thumb.]
Hi Wang,
I'd encourage you to try the DSPLIB and it's examples as these should give you the best performance.
Hi Anthony Seely,
I have download <Hercules Safety MCU Cortex-R4 CMSIS DSP Library (v1.0.0) >,and I install it ,but how can I use it ? DO you have a document to tell me
how can I use Hercules Safety MCU Cortex-R4 CMSIS DSP Library?
thanks a lot
Best Regards,
wang