Skip to main content
Alexandre Bouillot
Associate II
January 21, 2017
Question

CubeMx and Discovery L1

  • January 21, 2017
  • 2 replies
  • 1960 views
Posted on January 21, 2017 at 19:42

I'm trying to get familiar with CubeMX and STM32 development process and I'm a bit puzzled with the L1 Discovery.

To do so, I'm trying to 're-create' the demonstration FW shipped with the board using CubeMX.

When creating a new project for the L1 Discovery board, a number of pin are already defined, as they are used by the board design, which is normal.

However, I cannot have the PINs properly assigned in CubeMX to reflect the board. For example, regarding the screen someof the segments are used by the touch sensors. I haven't found a way to tell the system to use some other PINs for the signals. The SEG 3 to 6 conflicts and the followings are shifted, preventing the declaration of the other SEGments.

Would it be possible to  create the demo FW with CubeMX, or the board differ too much from the original design, it has to be made by hand?

#stm32l152 #cubemx #discovery-l1
This topic has been closed for replies.

2 replies

ST Technical Moderator
January 23, 2017
Posted on January 23, 2017 at 15:10

Hello

Bouillot.Alexand

,

You mayrefer to your reference manual and the datasheet of your product to be able identify the pins assignment (free/usable pins) andfollow the configuration steps.

Further help can be taken from the

http://www.st.com/content/ccc/resource/technical/document/application_note/bf/94/f5/49/96/52/4e/75/CD002735pdf/files/CD002735pdf/jcr:content/translations/en.CD002735pdf

'Getting started with STM32L1xxx hardware development ' document related to your device which will help you toconfigure correctly your peripherals.

About creationthe demo FW with CubeMX, this

suggestion

is alreadyhighlighted internally to our CubeMx team.

Thank you for your contribution and all your comments are welcome.

Best Regards

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Alexandre Bouillot
Associate II
January 23, 2017
Posted on January 23, 2017 at 16:04

The device I use is the L1 Discovery with L152RC chip. The CubeMX version is the latest v4190. The STM32CubeL1 library is version 1.6.0.

I want to migrate the L1 Discovery FW demo code to CubeMX environment. I therefore need to setup the board as it is shipped, but I block on the LCD Glass. There are the pin declared, but I haven't found a way to link them to proper init code to be generated by CubeMx.

Jeanne Joly
Associate
January 31, 2017
Posted on January 31, 2017 at 17:14

Hello,

I am not sure to fully understand your whole problem however I will try to give you some clues.

For your point '

However, I cannot have the PINs properly assigned in CubeMX to reflect the board. For example, regarding the screen someof the segments are used by the touch sensors. I haven't found a way to tell the system to use some other PINs for the signals. The SEG 3 to 6 conflicts and the followings are shifted, preventing the declaration of the other SEGments.'

When you put to disable the TS group2, the pins TS_G2_IO2 (that corresponds to PA6) and TS_G2_IO1 (that corresponds to PA7) move to orange color (instead of green when they are set). However, in LCD pinout, SEG3 to SEG6 are still in red color (can not be activated).

To move the pins PA6 to LCD_SEG3, you need to left click on the pin PA6 and move to LCD_SEG3. Then in the pinout tree, you will have LCD/SEG3 activated.

Furthermore, in the configuration view, in GPIO view, LCD tab, you will see that LCD_SEG3 signal is on PA6 pin.

This is the way to change the signal on a pin.

If it doesn't respond to your problem, don't hesitate to send your ioc file and give me more details.

BR.

Eric

Alexandre Bouillot
Associate II
February 21, 2017
Posted on February 21, 2017 at 11:06

Hi Eric,

In order to better understand CubeMX, I was planning to recreate a known code for the L152 Discovery board. The only code I have for this target is the example code running on it. I was therefore planning to recreate it.

Do you think this is achievable or would require to much effort?

Jeanne Joly
Associate
February 27, 2017
Posted on February 27, 2017 at 16:25

Hello

Bouillot.Alexand

,

Yes, taking an example of L152 is achievable easily.

In order to make the program work, you must do the following :

- Open your preferred toolchain

- Rebuild all files (taken from the examples) and load your image into target memory

- Run the example

BR. Eric