MCT code generator writes but can't read UTF-8?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCT code generator writes but can't read UTF-8?

Jump to solution
977 Views
dmarks_ls
Senior Contributor I

The latest MCT in MCUX 10.3.1 seems to have an issue with UTF-8 characters.  I have a Kinetis K24 project with SDK 2.5.0, and I've configured the PIT peripheral and a single channel.  But when I regenerate my peripherals.c, exit, and come back, MCT thinks I need to regenerate my code again because one of the documentation comments has supposedly changed.  Here's the actual code:

/***********************************************************************************************************************
 * ANALOGIN_PIT initialization code
 **********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
instance:
- name: 'ANALOGIN_PIT'
- type: 'pit'
- mode: 'LPTMR_GENERAL'
- type_id: 'pit_a4782ba5223c8a2527ba91aeb2bc4159'
- functional_group: 'BOARD_InitPeriph_ANALOGIN'
- peripheral: 'PIT'
- config_sets:
 - fsl_pit:
 - enableRunInDebug: 'false'
 - timingConfig:
 - clockSource: 'BusInterfaceClock'
 - clockSourceFreq: 'GetFreq'
 - channels:
 - 0:
 - channelNumber: '0'
 - enableChain: 'false'
 - timerPeriod: '100 us'
 - startTimer: 'true'
 - enableInterrupt: 'false'
 - interrupt:
 - IRQn: 'PIT0_IRQn'
 - enable_priority: 'false'
 - enable_custom_name: 'false'
 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const pit_config_t ANALOGIN_PIT_config = {
 .enableRunInDebug = false
};

void ANALOGIN_PIT_init(void) {
 /* Initialize the PIT. */
 PIT_Init(ANALOGIN_PIT_PERIPHERAL, &ANALOGIN_PIT_config);
 /* Set channel 0 period to 100 µs. */
 PIT_SetTimerPeriod(ANALOGIN_PIT_PERIPHERAL, kPIT_Chnl_0, ANALOGIN_PIT_0_TICKS);
 /* Start channel 0. */
 PIT_StartTimer(ANALOGIN_PIT_PERIPHERAL, kPIT_Chnl_0);
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

See line 39 there?  MCT inserted the comment "Set channel 0 period to 100 microseconds", using Greek "mu" for "micro", which is correct.  The "mu" displays correctly in the Eclipse editor window and in my third-party text editor.  However, MCT doesn't know how to handle this when determining whether to regenerate the code.  peripherals.c is always flagged for regeneration because of that line.  If I click the green "Update Project" button, then click the peripherals.c "change" link to compare what's changed, this is what I see:

mct_cant_read_utf8.png

It's not reading the UTF-8 "mu" correctly, so it shows two question marks in the "on disk" box, and one question mark in the "newly generated" box.

I don't know if this is an Eclipse issue with UTF-8 compatibility, or if this is purely an NXP software component, but either way, this is rather frustrating, because there's no workaround; even if I hand-edit peripherals.c to use the Latin "u" instead of Greek "mu", MCT is still going to flag peripherals.c for regeneration.  Any chance you can fix this in the next release?

1 Solution
792 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi David,

This issue has been reported to the software team to get fixed.

Thanks for bringing this to our attention.

Best regards,

Felipe

View solution in original post

4 Replies
793 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi David,

This issue has been reported to the software team to get fixed.

Thanks for bringing this to our attention.

Best regards,

Felipe

792 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi,

Just to continue with the follow up, from internal team:

This has been fixed as a software bug and the updated config tool will be released together with SDK 2.6, which will be available on 6/6/2019 as estimated.

Regards,

Felipe

792 Views
dmarks_ls
Senior Contributor I

Thank you for correcting this.

0 Kudos
792 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi David,

 

I reproduced this on my side and I was able to confirm this issue is present.

I have reported this internally, I will let you know as soon as I receive any updates.

 

Thanks for your feedback.

 

Best regards,

Felipe