cancel
Showing results for 
Search instead for 
Did you mean: 

Generation of warnings in Cube IDE v1.4.2 and system Hangs while executing.

nanotronicsnss
Associate II

I have developed a project in Keil Microvision v5.and the program is successfully compiled and running. But when I run the same program using Cube IDE v1.4.2 there are some warnings and when I flash the coding the system hangs .I have attached details regarding the warnings.

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/serial.c:35:26: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]

    sprintf(buffer,"%08X", commend_data);

            ~~~^

            %08lX

In file included from ../Core/Src/main.c:35:0:

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c: In function 'card_int':

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:10:24: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

        sendcyp1=&Encryptedtext[0];

            ^

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:11:22: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

       sendcyp2=&Encryptedtext[1];

           ^

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:12:22: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

       sendcyp3=&Encryptedtext[2];

           ^

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:13:22: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]

       sendcyp4=&Encryptedtext[3];

           ^

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c: In function 'keypadfunction':

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:437:31: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]

     sprintf(display1,"%02X", eepromread_data);

              ~~~^

              %02lX

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c: In function 'serial_print':

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:1225:30: warning: comparison between pointer and integer

  for(uint8_t i=0;i<string[i]!=NULL;i++)

               ^~

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/subfunction.c:1225:20: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses]

  for(uint8_t i=0;i<string[i]!=NULL;i++)

          ~^~~~~~~~~~

C:/Users/Dell/Documents/Mxcube/CPU_test_08_10_20/pulser_data.c:191:29: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t {aka long unsigned int}' [-Wformat=]

     sprintf(buffer,"%08X", Plaintext[0]);

             ~~~^  ~~~~~~~~~~~~

             %08lX

../Core/Inc/STM_MY_LCD16X2.h:57:13: warning: 'LCD1602_EnablePulse' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_EnablePulse(void);

       ^~~~~~~~~~~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:59:13: warning: 'LCD1602_RS' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_RS(bool state);

       ^~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:61:13: warning: 'LCD1602_write' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_write(uint8_t byte);

       ^~~~~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:63:13: warning: 'LCD1602_TIM_Config' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_TIM_Config(void);

       ^~~~~~~~~~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:64:13: warning: 'LCD1602_TIM_MicorSecDelay' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_TIM_MicorSecDelay(uint32_t uSecDelay);

       ^~~~~~~~~~~~~~~~~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:66:13: warning: 'LCD1602_writeCommand' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_writeCommand(uint8_t command);

       ^~~~~~~~~~~~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:68:13: warning: 'LCD1602_writeData' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_writeData(uint8_t data);

       ^~~~~~~~~~~~~~~~~

../Core/Inc/STM_MY_LCD16X2.h:70:13: warning: 'LCD1602_write4bitCommand' declared 'static' but never defined [-Wunused-function]

 static void LCD1602_write4bitCommand(uint8_t nibble);

       ^~~~~~~~~~~~~~~~~~~~~~~~

I have attached the warning list as the snapshot.

3 REPLIES 3
Markus GIRDLAND
ST Employee

What system hangs when you flash it? The entirety of STM32CubeIDE or the debug probe?

Is it only with this project or with every project you're trying to debug?

What system hangs when you flash it?
The main board with the processor hangs after flashing the code
The entirety of STM32CubeIDE or the debug probe?
The entirety of STM Cube IDE.
Is it only with this project or with every project you're trying to debug?
It is only with this part of the project. Another part of the project with the same IC has been completed and successfully running.
.Actually the system hangs due to the improper usage of sprintf function.i.e, we have used a 32 bit value.Now it is working. Now there is a problem with the communication part i.e., the same code when developed and flashed with keil microvision, works perfectly but when it is developed and flashed using cube IDE the communication part of the code is not working and the corresponding board is not receiving any data input from another board.
nanotronicsnss
Associate II

the problem is mainly due to sprintf function used in LCD header file and I have corrected it.