Tag Archives: Keil

How to Solve Hdsc32 MDK compile error: #29 & #223-D

1. error: #29: expected an expression

1. Error in compiling the following statement
for(int i=0; i<16; i++)
2. MDK uses C90 by default. It can support C99 after configuration. Modify it according to the following figure

2. error: #223-D: function “BSP_CLK_Init” declared implicitly

F460:
After initializing the BSP_CLK_Init function in main.c and calling it in the main function, this error is reported, indicating that the declaration is not legal.

Referring to the following article, I made a declaration at the beginning of main.c to call extern void BSP_CLK_Init(void);

after which the error disappears.

Keil prompts the stlink download program to prompt error: Flash download failed – target DLL has been cancelled

The Keil version is v5.25.30.0
the Downloader is st-link
1. As shown in the figure below, Keil prompts error: Flash download failed – target DLL has been cancelled

2. The reason is that the TVCC of st-link in the figure below is not connected to the 3.3V of the circuit board

as shown in the figure below. When the yellow line is connected, it can be downloaded normally. If the yellow line is not connected to stlink, The target DLL has been cancelled error will appear

3. Discuss the difference between Vdd and TVCC in stlink
as shown in the figure below, TVCC is pin 1.2. When stlink is plugged in USB, TVCC has no 3.3V output
VDD is pin 19. When stlink is plugged in USB, VDD has 3.3V output

when downloading the program in SW mode:
TVCC must receive 3.3V to download successfully, otherwise an error will be reported: Flash download failed – target DLL has been cancelled
VDD is not connected

So can VDD be connected to TVCC to power up the single chip microcomputer?I tried. It is feasible in theory, but I generally don’t do so, because the 3.3V driving ability is not strong
I test with the board of the punctual atomic warship. When VDD is connected to TVCC, both Vdd and TVCC will be pulled to about 2V, and keil can also successfully download the code. As shown in the figure below, VDD gives a voltage of 3.3V to the MCU through the white line, and then to TVCC through the yellow line. However, the LED will not be lit. Personally, I think the voltage is too low

Looking through the manual of STM32, you can see that the working voltage of STM32 is 2v-3.6v, so Vdd and TVCC are two or more volts, which can also make the STM32 program download successful

to sum up:
1. TVCC itself has no voltage. When downloading the program, it needs to be connected to 3.3V of the circuit board
2. VDD can supply power to the MCU to download the program. At the same time, if the power is supplied on the circuit board or separately, VDD should not be connected to the development board to avoid the conflict between the two 3.3V. So it can be described by one word, but it’s not necessary. VDD is just a foot that doesn’t exist. Don’t use it
PS: the standard JTAG interface is attached. It can be seen that the 19 pin is not connected. I don’t quite understand why stlink wants to output the 19 pin to 3.3V as VDD

Keil compilation Error: Error: L6218E [How to Solve]

KEIL compiles and reports an error

…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_Cmd (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_DeInit (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_GetCalibrationStatus (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_GetConversionValue (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_GetFlagStatus (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_GetResetCalibrationStatus (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_Init (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_RegularChannelConfig (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_ResetCalibration (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_SoftwareStartConvCmd (referred from adc.o).
…\OBJ\USART.axf: Error: L6218E: Undefined symbol ADC_StartCalibration (referred from adc.o).


Go to Manage Project Items and add adc.c under FWLib, see the picture below for the exact location, I used the project template of Positive Point Atomic, anyway, find the adc.c file and add it in.



After adding and recompiling, no error will be reported

The file is generated, but an error is still reported. Error: CreateProcess failed

         Remember, when using keil compiler in the past, there were such problems:

          At the first glance, I saw “1 error (s)”, and subconsciously thought that my program had made a mistake. I looked for it for a long time and didn’t find it.

         Later, I took a closer look and found that this error can be completely ignored because the required. Bin and. Hex files have been generated.

          This error is just that the file copy.bat is not generated, and I don’t need this file.

         But the bitch of OCD is itching. It’s uncomfortable to see an error hanging.

         In the option, I removed the check box before “run #2”.

         Just compile the unnecessary copy.bat file without parameters.

          At this point, compile again and 0 error will pass.

[Solved] KEIL Error: source file ‘.XXX.o‘ – object file renamed from ‘XXX.o‘ to …

Problem description

1. In the Keil project, move the C file in the app component to the dev component,
2. When using keil, sometimes you accidentally add two identical. C files in different group folders
at this time, the compilation will appear:
note: source file ‘… (core/Src/GPIO. C) – object file renamed from’ 7.710.200c/GPIO. O ‘to’ 7.710.200c/GPIO_ 1. O ‘.
error report

Solution

1. Delete duplicate files to ensure that. C files are not duplicated in the project
2. Close the Keil project and run keilkill.bat to delete all the compiled link files
3. Open the project to compile

Keilkill.bat code attached

del *.bak /s
del *.ddk /s
del *.edk /s
del *.lst /s
del *.lnp /s
del *.mpf /s
del *.mpj /s
del *.obj /s
del *.omf /s
::del *.opt /s  ::Settings that do not allow JLINK to be deleted
del *.plg /s
del *.rpt /s
del *.tmp /s
del *.__i /s
del *.crf /s
del *.o /s
del *.d /s
del *.axf /s
del *.tra /s
del *.dep /s           
del JLinkLog.txt /s

del *.iex /s
del *.htm /s
del *.sct /s
del *.map /s
exit

Copy the content to a TXT file, save and exit. Then change the suffix of. Txt to. Bat. Put the modified bat file into the project and run it

[Solved] KEIL MDK Warning: “no browse info for symbol in this context”

If there is no Chinese path, enter   Option for target-> ouput-> Cancel the check of browse information, click rebuild all target files to recompile all the files, re check the check of browse information, re check the check of browse information, and recompile all the files, the perfect solution, you can go to define happily!!!

(Keil MDK) UCOS floating point support abnormal solution

Recently, we encountered a problem, that is, the printf display of floating-point calls in uCOSII is abnormal, but the support for floating-point calls on bare metal machines is normal. Here are the details.

When calling printf to debug floating-point numbers in UCOS, it is correct in memory, but print data is 0, and other shaping data are normal.

The running result on bare metal is completely normal, that is to say, the problem lies in UCOS.

According to the information, this is because the user task stack is not aligned with octets. When running bare metal programs, the system’s default stack octets are aligned, but UCOS’s user task stack is not.

Align the user stack octets.

 

Solution:

1. Solutions under IAR: (untested)

Through # pragma data_ Alignment specifies the number of bytes to align

For example:


#pragma data_alignment=8

OS_STK Task1_LED1_Stk[Task1_LED1_Stk_Size];

#pragma data_alignment=8

OS_STK T

2. Solutions under keil MDK: (available for personal testing)

Add the force octet alignment command before the task stack declaration, as follows:

__align(8) static OS_STK  TaskEquipmentStk[TASK_EQUIPMENT_STK_SIZE];
__align(8) static OS_STK  TaskUartRcvStk[TASK_UARTRCV_STK_SIZE];
__align(8) static OS_STK  TaskFileRcvStk[TASK_FILERCV_STK_SIZE];
__align(8) static OS_STK  TaskFtpStk[ TASK_FTP_STK_SIZE ];
__align(8) static OS_STK  TaskErrorRateRS485Stk[ TASK_ERROR_RATE_RS485_STK_SIZE ];

 

Detailed explanation of the reasons

The history of this is that arm itself does not support non aligned data access; Therefore, with a 64bit data operation instruction, the instruction requires 8-byte alignment.

Furthermore, after a certain version of the compiler (rvct3?) AAPCs requires stack 8-byte alignment.

AAPCs with 8-byte alignment first, then cm3. Pay attention to the sequence. Before cm3 r2p0, automatic stack pressing does not require 8 alignment, and r2p0 seems to be forced alignment.

Printf’s 8-alignment is required by the C runtime and has nothing to do with hardware. The C RTL manual is written and can be read. Its root lies in the requirements of AAPCs; AAPCs is rooted in instructions like LDRD.

In other words, in the future, if 128bit data operation is available and arm does not support non alignment, AAPCs may be upgraded to 16 byte alignment.

Causes and solutions of errors in “insufficient ram for flash algorithms”

The error of “insufficient ram for flash algorithms” usually has a prompt window of “can’t load flash programming algorithm!” as shown in the following figure:
in case of “insufficient ram for flash algorithms” error, there will be a prompt window of “can’t load flash programming algorithm!”

“Insufficient ram for flash algorithms” literally means “insufficient RAM space for loading flash algorithm”.

This error usually occurs after adding a new flash burning algorithm.

Reason: the flash burning algorithm itself is also equivalent to a small program, which is executed by the chip in the process of burning program from JLINK to flash, so the burning algorithm needs to allocate memory space in the burning process. Open the settings of the utilities tab to see its configuration options;

As shown in the figure:

The place indicated by the arrow in the figure is the size of the RAM space for storing the burning algorithm. If the allocation of this place is too small, the above error message will be caused.

The problem can be solved by changing its size to a larger one.

For reference only.

If you want to reprint it, please note: the reasons and solutions for the errors in insufficientram for flash algorithms

Use keil software to report syntax error near ‘;

Using keil software to report syntax error near ‘; ”

This is the first time through CSDN upload their own learning situation, novice report.

Today, when using keil to write C, I used a piece of such code

    ?Define uint unsigned int; void delay (uint MS) { uint a; while (MS --)// software delay module for (a = 0; a & lt; 114; a + +); }

    When compiling, a syntax error near ';' was given, and the following MS and a both reported an error that no identifier was defined.
    From the code above, it can be seen that there is an obvious error with the ";" sign after define, but I found that the line with syntax error near ';' error is void delay (uint MS).
    I was hoodwinked at that time, looking for a long time, I found that there was an extra "; to commemorate this stupid operation.