Skip to main content
RDrum.1
Associate II
September 4, 2024
Question

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

  • September 4, 2024
  • 3 replies
  • 2193 views

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.

3 replies

STTwo-32
Technical Moderator
September 4, 2024

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 

Andrew Neil
Super User
September 5, 2024

@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.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
STTwo-32
Technical Moderator
September 5, 2024

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

RDrum.1
RDrum.1Author
Associate II
September 5, 2024

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
Technical Moderator
September 6, 2024

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 

RDrum.1
RDrum.1Author
Associate II
September 9, 2024

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.

Andrew Neil
Super User
September 10, 2024

@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".

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.