cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMx and Discovery L1

Alexandre Bouillot
Associate II
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
7 REPLIES 7
Imen.D
ST Employee
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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
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
Senior III
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

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?

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

Posted on February 27, 2017 at 18:05

Hi

Joly.Jeanne

,

rebuild the project has already been done :-). What I was asking is recreate it - i.e. make the 'same' program but using the CubmeMX toolchain. I am under the impression the example is quite divergent from what it would have looked like if it was created with CubeMX.

Posted on February 28, 2017 at 10:28

Hello

Bouillot.Alexand

,

I see your point.

We already did a complete answer on BSP and LCD in another post (

https://community.st.com/0D50X00009XkYoaSAF

).

Could you please have a look to it? This is the same procedure you should follow to add LCD on top of your CubeMX project.

And you are right, the examples are quite divergent from the one generated in CubeMX.. However, we are working on a way to ease the integration of the examples in CubeMX project, it will come in some months...

BR. Eric