cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152C-DISCO board does not work with CubeIDE

Kolkentu
Associate II

Hello

 

I just bought the STM32L152C-DISCO board. The board worked with its original firmware, but I can't use it with CubeIDE to create my own programs.

 

I create empty STM32project using Board Selector option:

Kolkentu_0-1739956045690.png

 

 

I made a simple program to make the LEDs on the board blink, but it cannot be debugged.

Kolkentu_1-1739956045691.png

 

 

 

The program downloads correctly, but this message appears:

Kolkentu_2-1739956045698.png

 

The board appears to be resetting, because the LEDs are blinking very fast, as if the program were continually restarting.

 

On the other hand, are there any example programs for cubeIDE with this board? I downloaded this file, but the examples are for other IDEs, it doesn't have CubeIDE projects: STM32Cube_FW_L1_V1.10.0

Can anyone help me?

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Kolkentu first of all, a note: STM32L-DISCOVERY was renamed to STM32L152C-DISCO aka 32L152CDISCOVERY a long time ago, otherwise they are completely identical.

Your observed problem has nothing to do with the STM32CubeIDE, but with the usage of the board. Please bear in mind that it is not a NUCLEO board, but a DISCOVERY, where existing functions must be taken into account. In this specific case, when single stepping through the program, you will notice that you see the same messages in routine MX_GPIO_Init(void)when initialising pin IDD_CNT_EN_Pin, which is due to the enabling of counter U3 (M74HC4060, see schematics).

If you change the jumper J1 (Idd Measure, under the display) from ON to OFF and thus disable the counter, your programme should work without any problems - right?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Ozone
Lead III

Your post contains not much information, like Cube and CubeIDE versions, and either the name of the example, or the source code.

This board was on the market when Atollic, IAR and Keil were the supported toolchains, with the example firmware based upon the SPL (standard peripheral library).
I don't know if any useful example(s) were ever created for Cube.
And I don't use Cube /CubeIDE, by the way.

> I create empty STM32project using Board Selector option: ...
But I suspect ST does very little regression testing with this old boards.

I would either try to find a dedicated Cube example for this board, or locate the "old" firmware package, get the demonstration firmware binary, and flash it to the board.

> I made a simple program to make the LEDs on the board blink, but it cannot be debugged.

When debugging such issues, always set the debugger to "break at reset vector", not "main".
And check in your project that both the MCU variant and the external quartz frequency match exactly.

Hi Ozone.

 

Thanks for your reply, but if you don't use CubeIDE, you can't help me. The problem is CubeIDE. I've done the same project in CubeIDE using only the STM32L152RCT6 microcontroller in the cubeIDE configurator, and it works perfectly. If the hardware is fine, and the software is fine, the problem is probably with the IDE, or how I use the IDE.

 

The information I've provided contains enough information to start working on the solution. And I'm providing the code I've used, which is only 6 lines that I've added to the program that, by default, creates the cubeIDE configurator.

The development board I'm using is not obsolete:

Kolkentu_0-1740040915288.png

 

 

Maybe you're referring to this other board, same appearance, but with a different microcontroller:

Kolkentu_1-1740040915302.png

 

The library I mentioned is for the old board, and the old ST IDE, called SW4STM32. That's why I'm asking for examples or test programs for the new board, that work with the new ST IDE, CubeIDE.

 

Can anyone help me?

 

Thanks

@Kolkentu first of all, a note: STM32L-DISCOVERY was renamed to STM32L152C-DISCO aka 32L152CDISCOVERY a long time ago, otherwise they are completely identical.

Your observed problem has nothing to do with the STM32CubeIDE, but with the usage of the board. Please bear in mind that it is not a NUCLEO board, but a DISCOVERY, where existing functions must be taken into account. In this specific case, when single stepping through the program, you will notice that you see the same messages in routine MX_GPIO_Init(void)when initialising pin IDD_CNT_EN_Pin, which is due to the enabling of counter U3 (M74HC4060, see schematics).

If you change the jumper J1 (Idd Measure, under the display) from ON to OFF and thus disable the counter, your programme should work without any problems - right?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for your reply, Peter.

 

I had solved the problem yesterday morning before your reply. The solution was the following. I found a course from a Spanish University that uses the same development board. In the course they mentioned that you have to set the PC13 pin to reset state in CubeMX due to "known problems with Pin13". So I did, and my program worked. Now I understand why my project worked when I created it in CubeMX selecting the STM32L152RCT micro instead of the development board: in this case I only set the pins I used (PB7 and PB6 for the LEDs), leaving the rest of the pins in "Reset state". I just tried your solution and it works.

 

On the other hand, when I saved my program, I lost the firmware that was originally included with the board, with the example that used the LCD, and the rest of the elements. Is there a cubeIDE project with that original firmware so that I can reprogram the board using cubeIDE and learn how the different elements work? In my R&D department we have acquired the board with the aim of testing the SMT32L152RCT6 microcontroller and using it in our new developments. Anything that helps us with this study will be of great help.

 

Regards

Of course, you can find the original firmware incl. source code in the software package STSW-STM32072, for quick programming you will find the binary in subfolder

Projects\AN3413-Current_consumption_touch_sensing\Binary\STM32L-Discovery.hex

Good luck!
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.