cancel
Showing results for 
Search instead for 
Did you mean: 

.ioc Cofigurator requires a user label "start with a character or an underscore" - for only 1 pin (?!)

RDrum.1
Associate III

I just configured an MCU using the latest configurator, in STM32CubeIDE V1.16.0. Set up a bunch of GPIOs no problem, gave them useful names.

One pin though wouldn't let me: each time I entered the desired nae ("5V_ENA") I'd get 

"The label '*' on pin '*' should start with a character or an underscore"

If I started it with an underscore, it was ok, but 5V_ENA was rejected.

 

What did I miss?

 

[UPDATE] A number ('5') is not considered a character apparently. "ENA_5V" was ok. Solved, leaving here for reference.

8 REPLIES 8
STTwo-32
ST Employee

Hello @RDrum.1 

In fact, this is a known rule in C. The identifier cannot begin with a digit/ numeric digit. The initial letter/ first element of an identifier should always either be an underscore or an alphabet.

Best Regards.

STTwo-32 

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.


@STTwo-32 wrote:

In fact, this is a known rule in C.


But this wasn't C - this was CubeMX

I don't think a user should be assumed to automatically apply (or even know?) C software rules in a hardware configuration tool?

 


@STTwo-32 wrote:

The identifier cannot begin with a digit/ numeric digit. The initial letter/ first element of an identifier should always either be an underscore or an alphabet.


But that's not what the reported error message said.

The reported error message said, "character" - which includes digits!

So, unless @RDrum.1 misquoted it, the message is wrong - and needs to be fixed.

Hello @Andrew Neil 

I will check the message on my side and ask internally for more clarification on the coming releases (to say that this a C rule for numeric.

Here is the message 

STTwo32_0-1725530845942.png

Best Regards and thanks Andrew. Your contributions are really helpful. 

STTwo-32

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.

RDrum.1
Associate III

Thank you, gentlemen for your replies.

I might add that in the case where an 'invalid' string is entered, the handling is poor, i.e., the UI becomes sluggish, and the text is difficult to edit / correct. You can end up with text in the edit box that disagrees with text on the pin, which is confusing. @STTwo-32 if you're diving into that part of the code to tweak that error message, can you perhaps check that part out too?


@STTwo-32 wrote:

Here is the message 

STTwo32_0-1725530845942.png


That's definitely wrong - '3' most certainly is a character!

(and so is an underscore)

The message should definitively say "digit" - not "character"

 

BTW: if this rule does come from C, then leading underscores should be reserved - not used in user symbol names 

STTwo-32
ST Employee

Hello @RDrum.1 @Andrew Neil 

@Andrew Neil the ticket has been submitted to the CubeMX Team to clarify the message (number of tickets is 190443).

@RDrum.1 could you give more clarifications about your issue so we can forward it to the concerned team (with examples if possible).

Best Regards.

STTwo-32 

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.

STTwo-32, I've made a vid (attached).

The issue is that the check for validity is done on every change (TextChanged event I guess), and pops ups a warning dialog every time.

What should happen is that if the content is invalid (tested on TextChanged), the edit box background should go red (or some other indicator) with a tool tip that indicates the problem, and the popup should only happen after Enter is pressed or focus is shifted from the control.

Also, the text in the pin list shouldn't update if the edit box is invalid, because it does not accurately reflect what the label on the pin is. Instead, it should stay blank as long as the edit box is red (or blank).

And I agree that the text on the warning dialog should be more specific and clearer, as a digit can quite easily be equated in the class of 'character' to many people, even though programmers might have a different perception.

Thanks.


@RDrum.1 wrote:

a digit can quite easily be equated in the class of 'character' to many people, even though programmers might have a different perception.


No, even programmers know that "digit" is a subset of "character".