Setting MCLK PIN mode to Output Mode on MIMXRT685S generates bad code

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

Setting MCLK PIN mode to Output Mode on MIMXRT685S generates bad code

Jump to solution
401 Views
Kenzimatic
Contributor II

Steps to reproduce:

  1. Open or create a MIMXRT685S project in the IDE
  2. Open the "Clocks" perspective in the IDE
  3. Under "Details," under "MCLK Frequency", set "MCLK PIN mode" to "Output mode."
  4. Open the clock_config.c file as a preview or after it has been generated

Notice this line has been added:

 

SYSCTL1 |= SYSCTL1_MCLKPINDIR_MCLKPINDIR_MASK          /* Set MCLK Pin as output */

 

The build fails because the line is missing a semocolon and SYSCTL1 is a pointer. The line should be:

 

SYSCTL1->MCLKPINDIR |= SYSCTL1_MCLKPINDIR_MCLKPINDIR_MASK;

 

I'm using MCUXpresso IDE v11.8.0 [Build 1165]. Aside from simply putting this line of code in my own init, are there any suggestions for fixing this?

0 Kudos
1 Solution
371 Views
Kenzimatic
Contributor II

Thanks for reporting this! I was modifying the code myself, but it gets cumbersome when making a repeated changes to clocks, so I just fixed the bug myself.

If anyone else stumbles across this problem, it can be fixed locally by editing line 327 of this file:

mcu_data_v14/processors/MIMXRT685S/ksdk2_0/scripts/clocks/clock_config_c.js

The edit is very straightforward.

View solution in original post

0 Kudos
2 Replies
377 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Kenzimatic ,

  I think the generated code is wrong, it should be:

SYSCTL1->MCLKPINDIR |= SYSCTL1_MCLKPINDIR_MCLKPINDIR_MASK ;

  It is the CFG bug, I will report it it internally, and it will be fixed in the new tool version.

  Now, to your side, you can modify the code by yourself.

  Thanks a lot for your contribution.

  If you find any issues, welcome to let us know.

Best Regards,

kerry

 

372 Views
Kenzimatic
Contributor II

Thanks for reporting this! I was modifying the code myself, but it gets cumbersome when making a repeated changes to clocks, so I just fixed the bug myself.

If anyone else stumbles across this problem, it can be fixed locally by editing line 327 of this file:

mcu_data_v14/processors/MIMXRT685S/ksdk2_0/scripts/clocks/clock_config_c.js

The edit is very straightforward.

0 Kudos