Tag Archives: singlechip

[Solved] Keil-MDK Error: “Error: Encountered an improper argument”

Keil MDK solves the problem of “error: encoded an improved argument”


Arm official problem description and solutions: https://developer.arm.com/documentation/ka004382/latest


Cause of problem: μ The vision5 debugger is currently unable to process dwarf debugging information that contains folders or file names with UTF-8 characters. In other words, your project directory should be in Chinese, instead of using the directory with Chinese.

Solution: change all the paths to English, then clean up the project and recompile.

Dca1000 reports an error and the SPI port cannot be connected

Dca1000 reports an error and the SPI port cannot be connected

Article catalog

Dca1000 reports an error and the SPI port cannot be connected. Problem Description: problem cause: solution:

Problem Description:

When using dca1000evm board and mmwave Studio software to measure AWR/IWR board data, SPI cannot be connected

Cause of problem:

The possible causes are problems with the 60 pin HD cable of the dca1000evm, or problems with the SPI pin of the FPGA on the board

resolvent:

    replace the 60 pin HD cable. At present, TI company not only provides additional 60 pin HD cable. Therefore, it is necessary to re purchase the board or find other 60 pin HD connection lines to replace it. At present, it is known that the 60 pin HD connection line of mmwave Devpack can be used with the 60 pin HD connection line of dca1000evm to replace the FPGA chip on the board, or check whether there is faulty soldering and additional connection at the pin (metal wire may be attached to the pin)

IAR Compile Error: Error[Li005]: no definition for [How to Solve]

after transplanting the program today, there was an error report of “error [li005]: no definition for” during compilation, which was encountered and solved before. Today, I’m going to officially record the causes and solutions of this error.

1. Reasons

just look at the error reminder given by IAR, “error [li005]: no definition for xxxxx”, which means that xxxxx is not defined (all cases I encounter refer to a function), but find the problem yourself, and you will find that this xxxxx has been defined in other C files, and this xxxxx function has been declared in the header file corresponding to this C file, And the path of the header file has been included in the IAR settings. There should be no problem! Then I began to wonder.

2. Solutions

let’s talk about the solution to this problem:

2.1 the C file where the xxxxx function is located is not added in the project

most of this happens because you accidentally removed the C file from the project, and you haven’t noticed it. The solution is very simple. Add the C file to the project again and recompile it.

2.2 when using conditional compilation, the xxxxx function is not compiled

this is why I have this problem this time. Let me give you an example:

#define FANJIE 1

#if FANJIE
void Get_Fans(void)
{
    for(int i  = 0; i<100;i++);
}
#endif

Take the simple function above as an example, when FANJIE is 1, call Get_Fans() in other c files, and no error will be reported, but when FANJIE is 0, call Get_Fans() in other c files Function, it will report the error “Error[Li005]: no definition for Get_Fans”.
The solution is also very simple, just make sure that the conditional compilation can be compiled normally.

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

[Solved] Rtthread DCM component dcm_cache_save interface Error: mkdir:/data failed

The rtthread dcm data persistence component was used in the project, but mkdir:/data failed was reported during dcm_cache_save

But this error log is not the code of this project, it is confirmed that it is the log printed inside the dcm interface

Then confirmed that the macro #define DCM_DEFAULT_STORAGE_NAME “/user/data/db/dcm” is already in rtconfig.h

Declare that this macro is also useful for business code at system startup

The final investigation is because dcm_default_storage_name needs to be assigned when the system starts, and the dcm_strg.o of the dcm component depends on

If this variable is not assigned, it will default to mkdir:/data, but if /data has no permission, it will report that error.

So dcm_default_storage_name = DCM_DEFAULT_STORAGE_NAME is solved (it needs to be called at startup)

Keil Compile Error: ..\OBJ\USART.axf: error: L6002U: Could not open file ..\obj\sys.o: No such file or directory

This is not the first time that this problem has occurred. When I go to the Internet for help, it mostly refers to the problem of environment variables. After I change it, I find that keil flashes back. When I see someone saying that it is impossible to generate. O files, I add them manually, but my intuition tells me that this is the most correct choice. After consulting the data, I find that the following problems occur.

One reason for the error is that your computer user name is Chinese, which is the problem of environment variables, but I did not report an error when running the routine, indicating that there is no problem with my environment;

Another reason is that there was a low version of keil software installed before, and the registry was not deleted after uninstallation. At this time, just delete it.

My problem is that I didn’t pay attention when creating a new project. I copied the routine directly, and then added the file manually, resulting in an existing. O file. At this time, I compiled it again, resulting in a problem. Because preprocessing, compilation, assembly and linking are indispensable, the. O file is generated in the assembly stage. If it already exists, it will trigger the error report. I would like to remind you that the new project should not be as easy as me, but step by step

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

Cmake error solution encountered in STM32 development with clion

Recently, if you want to use clion to replace keil for STM32 development, you need to install the following software and add the last two to the system path:

STM32CubeMX

Clion

MinGW

arm-none-eabi-gcc  

After configuring toolchain and cmake, it is found that the simplest project cannot cmake and displays

CMake Error: CMake was unable to find a build program corresponding to “MinGW Makefiles”.   CMAKE_ MAKE_ PROGRAM is not set.   You probably need to select a different build tool.

After debugging for a long time, the final solution: do not use mingw64, download the installation tool of mingw32 on the official website: mingw-get-setup.exe, and configure it again. It may be that 64 bit MinGW is incompatible.

[Solved] Keil error: #101: “name“ has already been declared in the current scope

 

Keil compilation error

 

#include <stdio.h>
#include <stdlib.h>
...

#define Result_TIMOUT               3
#define Result_INTIAL               0
#define Result_ERROR                1

... 
typedef enum
{
    MD_INIT,
    HARDWARE_CHECK, 
    FILESYSTEM,     
    BS_SEARCH,      
    BS_REGISTER,    
    BS_REG_CHK,     
    ME_FC_INIT,
		ME_SOCKET,	
    ME_READY
}STATUS_MACHINE_INDEX;

... // struct, enum, union

extern md_Socket_CB 			SocketOpen_CB;
extern md_Socket_CB 			SocketClose_CB;

... 

Solution:

Use conditional compilation to prevent header files from being included repeatedly. Take the above code as an example

#ifndef __MODEM_H__
#define __MODEM_H__

#include <stdio.h>
#include <stdlib.h>
...

#define Result_TIMOUT               3
#define Result_INTIAL               0
#define Result_ERROR                1

... 
typedef enum
{
    MD_INIT,
    HARDWARE_CHECK, 
    FILESYSTEM,     
    BS_SEARCH,      
    BS_REGISTER,    
    BS_REG_CHK,     
    ME_FC_INIT,
		ME_SOCKET,	
    ME_READY
}STATUS_MACHINE_INDEX;

... // struct, enum, union

extern md_Socket_CB 			SocketOpen_CB;
extern md_Socket_CB 			SocketClose_CB;

...

#endif

Keil compiled successfully

Error: l6218e: undefined symbol appears when keil calls lib

1. Recently, when using MDK to generate lib, Keil failed to call lib, resulting in a lot of undefined problems

2. When generating lib with keil for testing, you can’t add the header file to the project.

        Delete all. H files, regenerate the Lib file, and call again. It is found that there will be no more problems such as error: l6218e: undefined symbol