cancel
Showing results for 
Search instead for 
Did you mean: 

Touch sensing error under Cube IDE 1.6.1 on STM32L152

TJack.2
Associate III

The code generation of tsl_user.h from the .ioc file appears to be broken.

Firstly if you change the TS configuration in System Core, the updated configuration doesn't show up in Touchsensing middleware options until you have saved the .ioc file or closed and reopened it.

Secondly and critically the generated file doesn't reflect the configuration. Creating a system with four basic keys on Groups 1-4, it always configured Channel 0 as G2_IO2 even if that was not configured or was used elsewhere. Reducing this to a two-key system just using Groups 3&4 crashed Java, see attached files.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @TJack.2​ ,

Thanks for those inputs, the problem is reproduced on my side. Indeed there is an update issue with STM32CubeMX GUI when changing TS configuration.

Sorry for any inconvenience that this may cause.

This is raised internally to be fixed. Thanks for your contribution.

Currently, as you've mentioned, the workaround for this misbehavior is to save and re-load the project so that TS and TOUCHSENSING parameters will be updated.

Thank you for bringing this to our attention.

Even though this reply doesn’t directly solve the issue, I’m marking it as Best, since it will help clarify the current situation for other customers with the same question. I will post an update here once the issue has been fixed.

Khouloud.

View solution in original post

5 REPLIES 5

Hello @TJack.2​ ,

Thank you for having reporting, but the issue isn't reproduced from my side and the tsl_user.h file is correctly generated.

Also no problem was observed with updating parameters.

Could you please attach the whole project or at least the .ioc file to check it further on my side.

Your feedback is helpful to track faster the root cause of this misbehavior.

Thanks in advance.

Khouloud.

TJack.2
Associate III

Here is the project.

I note that according to UM1913 Table 70, Group 4 is available as a source on the STM32L152, but that according to RM0038 Figure 22, groups 4, 5 and 10 do not connect to any comparator or ADC, so could not actually be read. I'm confused.

TJack.2
Associate III

Further experiments. I tried disabling all channels, rebuilding the code, then reopening and configuring the channels I wanted and this time it produced the correct code. The error obviously had something to do with the history of having at some time had other channels selected.

Further to the first error, here is a screen recording of what happens. In this example I have two channels configured, groups 1 and 2, and have generated code. Then in System Core / TS, I add two more channels in groups 3 and 7. When I go to Middleware / TOUCHSENSING I increase the number of channels to four and attempt to assign them to the groups, but the selection box still only shows the original two channels as choices, I can't select 3 or 7. However if I then close and reopen the .ioc file it does come up with a valid assignment and generates correct code.

Hello @TJack.2​ ,

Thanks for those inputs, the problem is reproduced on my side. Indeed there is an update issue with STM32CubeMX GUI when changing TS configuration.

Sorry for any inconvenience that this may cause.

This is raised internally to be fixed. Thanks for your contribution.

Currently, as you've mentioned, the workaround for this misbehavior is to save and re-load the project so that TS and TOUCHSENSING parameters will be updated.

Thank you for bringing this to our attention.

Even though this reply doesn’t directly solve the issue, I’m marking it as Best, since it will help clarify the current situation for other customers with the same question. I will post an update here once the issue has been fixed.

Khouloud.

TJack.2
Associate III

There was a second issue, partially concealed by the one discussed above. CubeMX allowed me to specify group 4 as a sensing channel (I was following documentation in user manual UM1913, Table 70) despite the fact that group 4 (or 5 or 10) do not connect to any comparator or ADC (see Reference manual RM0038). Therefore those groups are only usable for a shield connection in the touch-sensing context. This may explain why CubeMX crashed when I attempted to configure group 4 as a touch input.

As I see it this is an error in UM1913 and a corresponding error in the input sanity checking in CubeMX.