MDK解决方案:Warning L6989W

在使用STM32L4系列单片机,使用数学函数以及DSP库的时候,有时会出现以下警告

Warning: L6989W: Could not apply patch sdcomp-29491-629360 to instruction VPOP     {d8-d12} at offset 0x24, instruction is within an IT block and is not the last instruction for sin_i_x.o(i.____kernel_sin$lsc).

在KEIL官网上找到了解决方案

官网链接:https://www.keil.com/support/docs/3853.htm

英文原版回答:

CAUSE

Some members of the STM32L4 family have an eratta for the FMC (Flexible Memory Controller) where a read burst access of 9 words or more is not supported by FMC. To prevent burst accesses that are greater than 8 words, a special linker patch was developed to patch certain instructions that result in burst accesses of greater than 8 words. The patch can be applied in most cases with a few exceptions. One of these exceptions is when the instruction to be patched is inside an IT (If-Then) block and is not the last instruction in that block. In this case this warning will be generated.

RESOLUTION

Since the FMC is only used for external memory, you can ignore this warning if you are only using internal memory. If you are using external memory, make sure your stack is located on-chip. In compiled code, the use of IT blocks can be eliminated by using the --no_conditionalize compiler option. If you are using the DSP library, you will need to rebuild it with the --no_conditionalize compiler option to prevent this warning.This can increase the processing time for DSP functions, so this should only be done for the library used with the STM32L4xx. Also, some math functions such as log10() contain IT blocks that cannot be patched. Since these math functions are not available to be re-built, it may be difficult to eliminate the warning in all cases. In the case of log10(), you can use a similar function, log10f() that does not have the IT block restriction.

翻译

版本:MDK-ARM V5.16及更高版本

原因:STM32L4系列的某些器件是具有用于FMC的eratta,其中FMC不支持9字或更多的读取突发访问。为了防止突发访问大于8个字,开发了一个特殊的链接程序补丁程序来修补某些指令,从而导致突发访问大于8个字。该补丁可以在大多数情况下应用,只有少数例外。这些例外之一是当要修补的指令位于IT(If-Then)块内而不是该块中的最后一条指令时。在这种情况下,将生成此警告。

解决办法:由于FMC仅用于外部存储器,因此,如果仅使用内部存储器,则可以忽略此警告。如果您使用的是外部存储器,请确保您的堆栈位于芯片上。在已编译的代码中,可以使用--no_conditionalize 编译器选项来消除对IT块的使用。如果使用的是DSP库,则需要使用--no_conditionalize 编译器选项来重建它以防止出现此警告,这会增加DSP函数的处理时间,因此仅应针对STM32L4xx所使用的库执行此操作。此外,某些数学函数(例如log10())包含无法修补的IT块。由于无法重建这些数学函数,因此可能很难在所有情况下都消除警告。如果是log10(),则可以使用类似的函数,

 

 

你可能感兴趣的:(STM32)