keil compiler to migrate from ac5 ac6

The method in use today on Ann Fuller forum ac6, therefore, on the small scale chopper and playing, and finally ok.
Use keil5.25 + stm32 + hal library, 5.23 start only support ac6, therefore keil version can not be too low.

You can refer to: https://blog.csdn.net/ybhuangfugui/article/details/99826708

https://blog.csdn.net/ybhuangfugui/article/details/89369067

http://www.armbbs.cn/forum.php?m ... 5736 & fromuid = 58
have summarized above forum:
//////////////////////// ///////////////////
compiler upgrade considerations summarized
1: CMSIS, HAL, direct use, CMSIS 5.6 safe to use
2: use FreeRTOS need to change port.c, AC5 use under RVDS, AC6 with GCC in
3: C / C ++, see Figure 1, using GNC99 ++. 11 and GNC
. 4: Chinese AC6 the C file needs to be replaced as UTF-8, AC5 if it continues to use this file, it is necessary Add the --locale = english Control Misc
. 5: good habits, may be added at different compilers defined using different compilers
defined (__CC_ARM)

defined #elif (__ GNUC__)
. 6: AC5 / AC6 related definitions distinction 2
7: is a good habit, list, output file generation area is divided into recommendation AC5 (AC6)
. 8: AC6 definition on the specified address, use section ( "" name ""), or __ __attribute ((Section (. "ARM .__ at_0xxx")))
////////////////////////// /////////////////////

I have a bootloader project, which uses asm assembler, __ weak 

After selecting ac6, there will be a lot of compiler error because ac5 and ac6 use a different compiler system, many embedded inside the extension keyword is different, if it is pure c language, is no problem.

for example:

error: expected identifier or '('
__weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)

This time, do is to modify hal database?

Of course not, a way to resolve this error. Hal library to compile lib library files added to the project, which is the new method I have just discovered, do not modify the hal library. (My blog has compiled this method, written document) and then banned hal source files can be resolved,

Next, asm compiler error, this time, keil have documents

Screenshot below:

 

 This time, we need to move a lot of keywords, keyword asm I have here,

Migration is as follows:

 

 Compile again no problem, of course, there are many keywords that need to be modified, if your program uses the words. Do not use, you do not need to be modified.

! ! There is, if the band freertos system, you need to modify the place more, if it is bare metal, basically not much change places. ! !

Guess you like

Origin www.cnblogs.com/CodeWorkerLiMing/p/12034471.html
ac