2016-09-16 01:59 PM
I'm really struggling to get Touch Sensing working on the stm32L152 RCT6 discovery board. I'm trying to use it with CubeMX and understand that there is a particular procedure to use the Touch lib with CubeMX. Could anyone please explain the process, and have an example project to get up and running with?
I have looked at the example included in the firmware package for cubemx, but it is for the stm32l152D_EVAL board and I'm even having trouble getting that to compile.Thanks #cubemx #stm32l152 #touch-sensing2016-09-17 02:44 PM
Hi,
The Touch Sensing library is not supported by CubeMx in the code generation, only the pinout is configured for Touch Sensing peripheral. So, you have to add TSL library manually (STM32Cube_FW_L1_V1.6.0\Middlewares\ST\STM32_TouchSensing_Library from ) and configure properly all paths for required files.You can start from the TouchSensing example for stm32l152D_EVAL board and get inspiration from this example to develop your project.You may find more details on how to use the TSL with the : ''Developing applications on STM32Cube with touch sensing''.Regards2016-09-19 09:54 PM
Thanks for the response. I've tried creating a new project for the stm32L152-disco based off of the stm32L152D_EVAL project on the firmware package, but im running into some issues. Ive linked all the library files as it is done in this project and im getting these errors:
Description Resource Path Location Type
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'CMR5' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 162 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'CICR4' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 163 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'ASMR4' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 161 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'ASMR5' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 161 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'CMR4' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 162 C/C++ Problem
initializer element is not constant tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 162 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'ASMR4' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 522 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'ASMR5' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 523 C/C++ Problem
initializer element is not constant tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 163 C/C++ Problem
'RI_TypeDef {aka struct <
anonymous
>}' has no member named 'CICR5' tsl_acq_stm32l1xx_hw.c /TouchSensor_manualInclude/Middlewares/STM32_TouchSensing_Library line 163 C/C++ Problem
Can you please assist me,
Thanks
2016-09-20 02:33 AM
Hi,
I think this is due to use incompatible library versions and include files.So, make sure that the include libraries paths are configured correctly into the project from the correct directories.Regards2016-09-20 06:33 AM
2017-04-05 01:33 PM
Nate,
Here is how I got started.
1. Using a discovery board, I located the complete example in my copy of the firmware installed by the cube for my board.
C:\Users\John.Davis\Documents\john-f-davis\discovery-meta\Projects\STM32F072B-Discovery\Applications\TouchSensing\TouchSensing_Linear
2. I ran this code as is from this location. The source is scattered about the directory. For instance, the source for the touch library is up further in the directory tree. ie. C:\Users\John.Davis\Documents\john-f-davis\discovery-meta\Middlewares\ST\STM32_TouchSensing_Library
3. I pretty much just ran the sample out of the box to see it was working.
4. Then I created a sample project using the cube for a discovery board. I made sure the pins for the touch sensors were named to match the original project. I had to look at the schematics for the discovery board to make sure I was doing it right.
5. Then I copied over the touch library into my project. I could not match the same pattern as the example code in terms of source files and header files where headers are included. ie. the sample code has the tsl_user.h included in main.h. If I do that it generates a ton of errors. I have to put the include tsl_user.h line in my main.c file. Once I can get this working I have a little more understanding of how its put together.
6. Do the same thing for our custom board setup with an ioc cube project.