cancel
Showing results for 
Search instead for 
Did you mean: 

Touch Sensing on STM32F0

eltar
Associate III
Posted on June 15, 2012 at 13:27

Hi, it is stated in STM32F051 RM that the MCU was designed to work with STM32 TSL. I attempted to build a prject with the TSL, however it supports only STM32L and would not build saying that ''instruction is unsupported''. How do I go about this? Unfortunately RM is not clear on how exactly to use TSC and there are no examples in SPL.

P.S. I'm using STM32F0-Discovery

#tsl #stm32f0
16 REPLIES 16
enmirc
Associate II
Posted on March 29, 2016 at 13:58

Hi, 

I have a little STM32L152RB code generated from CUBEMX, works. 

Than I add STMTouch_Driver 1.4.3  and errors .. what I missed ? 

''RCC_AHBPriph_GPIOA is undefined'' I have headache .. just tell me please

enmirc
Associate II
Posted on March 29, 2016 at 19:56

stm32l1xx.h     // Perip.Acc. Leyer Header file V2.1.2 it seems does not work correct 

Please any answer .. 

Posted on March 29, 2016 at 21:30

The project (compiler command line) defines 

USE_HAL_DRIVER ??

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
enmirc
Associate II
Posted on March 30, 2016 at 07:35

hi, 

- comman line: 

 USE_HAL_DRIVER, STM32L152xB

- '' GR1 has already been declared in the current scope '' etc.

- '' PA2 has already been declared in the current scope '' etc.

..\..\..\..\32l1-touch-lib\STM32L1xx_STMTouch_Lib_V1.1.0\Libraries\STMTouch_Driver\src\tsl_acq_stm32l1xx_sw.c(79): error:  #20: identifier ''RCC_AHBPeriph_GPIOA'' is undefined

- it seems MDK  in building process tied different things or not .. but why .. so I think 

  I missed parameters .. but where ? 

Amel NASRI
ST Employee
Posted on March 30, 2016 at 14:56

Hi mickey,

You shouldn't include the STMTouch_Lib in the CubeMX generated code. The TSL is developed based on the standard peripheral library. However the CubeMX code is using HAL drivers. 

You can activate TS using CubeMX as suggested by Syrine in [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/CUBEMX%20-%20code%20-%20add%20TSL%20Lib%20something%20is%20wrong&FolderCTID&currentviews=9]the other discussion.

-Mayla-

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.

enmirc
Associate II
Posted on April 01, 2016 at 08:21

Dear Mayla,

 STM32Cube_FW_L1_V1.5.0\Middlewares\ST\STM32_TouchSensing_Library

  

1. In CubeMX I enabled TS as Syrine said (graphicaly) 

   - CubeMX produce a code without of TS support because CubeMX does not know where it is .. 

   - In MDK Keil I added STM32_TouchSensing_Library  bc I need it .. so .. I get errors .. ok. 

2. you said: You shouldn't include the STMTouch_Lib in the CubeMX generated code !

   - does it mean CubeMX will add TS files ? how CubeMX knows where is TS Lib ? aaa .. 

   - How I know where I have to put TS lib that CubeMX will be able to generate my TS app. ?? 

Amel NASRI
ST Employee
Posted on April 01, 2016 at 11:59

Hi mikey,

1- In CubeMX generated code, only the pinout is configured for Touch Sensing  peripheral. The TSL library isn't included.

You have to add it manually, and take into account paths of all required files in order to avoid errors like ''undefined variable...''.

2- I am speaking about the old TSL available on

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF258658

: this one is not compatible with CubeMX generated code. And the one that you have to include MANUALLY is STM32Cube_FW_L1_V1.5.0\Middlewares\ST\STM32_TouchSensing_Library.

If you have some errors, you may refer to the examples available in STM32Cube_FW_L1_V1.5.0\Projects\STM32L152D_EVAL\Applications\TouchSensing to know how used variables for example are defined.

-Mayla-

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.