完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,各位,
我想让FPU在我正在使用的STM32 F4XX芯片上工作,但是我被卡住了,我相信这个问题与SDK捆绑在一起的THEXX版本有关。 我找到了这个老线程,但是好像没有解决办法:如何在STM32 F4XX上使用HW FPU? 通过在构建系统中添加一个USEL FPUIKCM4F标志,然后改变WICEDIO TooChina AmithGnU.MK中的特定于芯片的标志,我取得了部分成功。 GCC的特定芯片标志 IFEQ($(HooStHARCH),ARMYCM4) 用FPU添加支持CM4微构件的构建;在平台生成文件中定义 IFEQ($(USEL FPUIKCM4F),1) (1):= 使用:=1 CPUycFLAG:= -MMPON-MCPU= CORTEX-M4- MFLAL-ABI = SOFTFP CPUYCXXFLAG:= -MMPON-MCPU= CORTEX-M4- MFLAPE-ABI=SOFTFP CPUYASMFLAG:= -MCPU= CORTEX-M4- MFLAO-ABI=SOFTFP -MFPU=FPV4-SP-D16 CPUYLDFLAG:= -MMPON-MCPU= CORTEX-M4 - Wl,-A,拇指 其他的 CPUycFLAG:= -MMPON-MCPU= CORTEX-M4 CPUYCXXFLAG:= -McPMP-MCPU= CORTEX-M4 CPUYASMFLAG:= -MCPU= CORTEX-M4-MFPU=SOFTVFP CPUYLDFLAG:= -MMPON-MCPU= CORTEX-M4 - Wl,-A,拇指 EuffiFPUCCM4F 阿姆斯CM4 然后,在我的平台MaFILE中,我定义了USEL FPUIKCM4F。我的想法是,我不必在构建系统中定义一个全新的CM4F变体,只是稍微调整CM4的一个。根据我读到的关于GCC标志的内容,这应该是可行的,因为软FP仍然与现有的没有FPU支持的库兼容。而MFPU的选择仅仅来自于我发现的其他STM32 F4XX示例。 然后,在StulyStMs32 F4X.C中,在StuleIn()的顶部,启用FPU访问: /FPU设置-----------------------------------*/ αIf(α-fPuiFix==1)& &(; SCB-GT;CPACR=((3UL&L.&lt;10×2)〉(3UL&L.&lt;11×2));/*集CP10和CP11完全访问*// 第二节 因此,编译器确实生成了FPU指令,它们甚至看起来运行正常。 但是,系统在运行了很长时间之后就遇到了一个硬故障。在目标上使用ETM,我看到了一个似乎起源于TxthTHead创建的崩溃,当PC弹出时,它得到了一个坏地址,螺旋失控,最终以一个硬故障结束。见附件屏幕截图。如果可以的话,我可以私下提供更长的追踪历史。 我联系ExpLogic来了解这一点,它们表明对于FPU的使用,必须调用一个无效的TXTHthRead fpUIN(无效)来设置正确的FPU上下文保存。不幸的是,查看WSDICSDK中提供的TXXPur.h文件,似乎有一个文件。覆盖CM3和CM4,在任何地方都没有提到这个功能。从TraceX.ARM的ObjDip中查看头文件,在任何地方都没有提到TxththRead fPuEnable()函数,TyReX用户指南也没有提及。 所以…有没有办法解决这个问题? 看来它要升级到THEXX了。或可能重建现有存档,FPU使功能不被删除。 以上来自于百度翻译 以下为原文 Hi folks, I would like to get the FPU working on the STM32F4xx chip that I am using, but I am stuck, and I believe the problem has to do with the version of ThreadX that is bundled with the SDK. I found this old thread, but it seemed like there was no resolution: How to use HW FPU on STM32F4xx? I have had partial success by adding a USE_FPU_CM4F flag to the build system, and then changing the chip-specific flags in wiced_toolchain_ARM_GNU.mk: # Chip specific flags for GCC ifeq ($(HOST_ARCH),ARM_CM4) # flag added to support building for CM4 micros with FPU; define in platform makefile ifeq ($(USE_FPU_CM4F),1) __FPU_PRESENT := 1 __FPU_USED := 1 CPU_CFLAGS := -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp CPU_CXXFLAGS := -mthumb -mcpu=cortex-m4 -mfloat-abi=softfp CPU_ASMFLAGS := -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 CPU_LDFLAGS := -mthumb -mcpu=cortex-m4 -Wl,-A,thumb else CPU_CFLAGS := -mthumb -mcpu=cortex-m4 CPU_CXXFLAGS := -mthumb -mcpu=cortex-m4 CPU_ASMFLAGS := -mcpu=cortex-m4 -mfpu=softvfp CPU_LDFLAGS := -mthumb -mcpu=cortex-m4 -Wl,-A,thumb endif #USE_FPU_CM4F endif #ARM_CM4 Then, in my platform makefile, I define USE_FPU_CM4F . The idea was that I wouldn't have to define a whole new CM4F variant in the build system, just tweak the CM4 one a little bit. Based on what I read about GCC flags, this should work, since soft-fp will still be link-compatible with existing libraries built without FPU support. And the choice of -mfpu was just from other STM32F4xx examples I found. Then, in system_stm32f4xx.c, at the top of SystemInit(), FPU access is enabled: /* FPU settings ------------------------------------------------------------*/ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ #endif So, then the compiler does indeed generate FPU instructions, and they even appear to run OK. BUT: the system hits a hard fault after running for not very long. Using ETM on the target, I am seeing a crash that appears to originate in tx_thread_create, when the PC is popped, it gets a bad address, spirals out of control, and eventually ends up at a hard fault. See attached screenshot. I could provide a longer trace history privately, if that would help. I contacted ExpressLogic to get some insight into this, and they indicate that for FPU usage, there must be a call to void tx_thread_fpu_enable(void) to set up correct FPU context saves. Unfortunately, looking at the tx_port.h file provided in the WICED SDK, it seems like there is a single file that covers both CM3 and CM4, and there's no mention of this function anywhere. Looking at the headers from the objdump of ThreadX.ARM , there's no mention of the tx_thread_fpu_enable() function anywhere. And the ThreadX User Guide doesn't mention it, either. So ... any chance that there is a solution for this? It seems like it is going to take an upgrade to ThreadX. Or possibly a rebuild of the existing archive(s), with the FPU enables functions not being dropped. |
|
相关推荐
9个回答
|
|
|
|
|
|
我会给FreeRTOS一个镜头,虽然我不会改变这个当前项目的基础OS。所以,我很想找到一个THEXX的解决方案。 ExtLogic中的家伙向我保证TxthTrimefPuiFuffic函数应该存在于TyReX的V5.6中。我只需要皮质X4版本的TXXPORT.H,并可能重建包含该函数的库存档(防止优化输出)。 以上来自于百度翻译 以下为原文 I'll give FreeRTOS a shot, although I won't be changing underlying OS's for this current project, at this point. So, I would really like to find a solution for ThreadX. The guys at ExpressLogic assured me that the tx_thread_fpu_enable function should exist in v5.6 of ThreadX. I just need the Cortex M4 version of tx_port.h and possibly a rebuild of the library archive with that function included (prevent optimization out). |
|
|
|
MIFO^ ^ ^(虽然整个团队可能正在为深圳事件做好准备?)
以上来自于百度翻译 以下为原文 mifo ^^^ (although the whole team is probably gearing up for the Shenzen event right now?) |
|
|
|
你好,USER 108962410
现在,Westice中提供的5.2个THEXX版本不支持FPU,正如您所提到的。你能告诉我们为什么你的申请需要一个FPU,这样我们就可以试着暂时提供一个替代方案吗? 以上来自于百度翻译 以下为原文 Hello user_108962310 Right now the 5.2 version of ThreadX provided in WICED does not support the FPU as you mentioned. Could you please let us know that why your application requires an FPU so that we can try providing an alternative for the time being? |
|
|
|
我并不严格要求FPU工作。当我们做了部分选择时,我们最终得到了一个微芯片,它有一个FPU,所以我们希望得到工作,如果我们已经支付它,它已经在设备中。 没有一个杀手的要求,但几个较小的:-我们正在做一些转换使用ExpF和缩放,并在浮动格式输出钳位,它出来到大约5000个周期。但这只在1Hz下完成。 一个相当数量的数学围绕LED衰落,在50fps。我已经通过使用所有的Q16整数操作来实现这一点,但是它是一个很好的跟踪,以人为地提升动态范围,即使如此,动态范围仍然是有限的。这将是很好的能够做到这一切都与轻松浮动从一开始… -一些滤波(移动窗口,IIR),再次在Q8中实现,以提高动态范围。-使用Q15、Q31和浮点中可用的一些先进的CMIS-DSP功能;Q15和Q31已被评估,但我也想尝试浮动库。 闪光灯的大小,我们接近我们的片上闪光灯大小,测试表明,输出是一对夫妇的KB更小,如果所有的IEEE功能可以放弃有利于FPU指令。 这些都是问题的解决方案已经开发和航运。但是,TBH,必须做的所有关于现代高特征32位微型的解决方案是一种失望,它为我的NRE的上升。 以上来自于百度翻译 以下为原文 I don't strictly "need" the FPU working. When we did part selection, we ended up with a micro that had an FPU anyway, so we'd like to get working if we're already paying for it and it's already in the device. No one killer requirement, but several smaller ones: - We are doing some transforms using expf and scaling, and with output clamping in float format, it comes out to around 5,000 cycles. But this is only done at 1hz. - A fair amount of math around LED fading, at 50fps. I've made one pass at implementing this using all q16 integer operations, but it's *a lot* to keep track of to artificially boost the dynamic range, which even then is still limited. It would have been nice to be able to just do it all with easy floats from the beginning ... - Some filtering (moving window, IIR), again implemented in q8.8 to boost the dynamic range. - Using some advanced CMSIS-DSP functions which are available in q15, q31, and float ; q15 and q31 have been evaluated, but I'd like to try the float library, too. - Flash size; we are nearing our on-chip flash size, and tests have suggested that the output is a couple of KB smaller if all the IEEE functions can be dropped in favor of FPU instructions. Those are all issues where the workarounds are already developed and shipping. But, tbh, having to do all of said workarounds on a modern high-feature 32bit micro is kind of a let-down and it ups the NRE's for me. |
|
|
|
我们理解你提到的要点。我将提出一个内部请求,以便在TyReX库的下一个版本(5.8)中启用FPU支持。 以上来自于百度翻译 以下为原文 We understand the point that you are mentioning. I will put forward an internal request to enable the FPU support in the next version (5.8) of ThreadX library. |
|
|
|
是否有一个ETA在THEXX 5.8纳入SDK版本? 我即将开始构建一个特性,它将是更好地使用F32而不是Q31,以及在FFT操作中处理精度损失的所有缓解措施。 以上来自于百度翻译 以下为原文 Is there an ETA on the ThreadX 5.8 incorporation into an SDK release? I am about to start building out a feature for which it would be *way* better to use f32 throughout, rather than q31 and all the mitigation for dealing with the loss of precision in FFT operations |
|
|
|
Raktim Roy写道: 我们理解你提到的要点。我将提出一个内部请求,以便在TyReX库的下一个版本(5.8)中启用FPU支持。 罗伊 你能确认SDK-61(THEXEXV5.8)是否支持FPU支持? 嫦娥没有提到这一点。 以上来自于百度翻译 以下为原文 Raktim Roy wrote:rroy Can you confirm if sdk-6.1 (with ThreadXv5.8) have FPU support enabled or not? The changelog does not mention about that. |
|
|
|
THEXX 5.8没有在SDK 6.1中启用的FPU支持。这仍然是一项尚未完成的工作。 以上来自于百度翻译 以下为原文 ThreadX 5.8 does not have FPU support enabled in SDK 6.1. It's still a work in progress which has not yet been integrated. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2110 浏览 1 评论
1858 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1791 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
576浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
430浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
440浏览 2评论
390浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
950浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-28 08:50 , Processed in 0.903667 second(s), Total 60, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号