How to Change Default Clock Setting in Kinetis BSPs

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

How to Change Default Clock Setting in Kinetis BSPs

Jump to solution
1,341 Views
c_dawg
Contributor III

I made a document with some print screens and it is attached.  The print screens don't paste.

Referring to the "How to Change Default Clock Setting in Kinetis BSPs" I completed this procedure summarized in the attachment called: Custom Clock

I basically end up with errors:

mingw32-make: *** [Peripheral IO Drivers/usb_dcc/int/usb_dcd_int_kn_c.obj] Error 1      bsp_Console_MK60FX512VLQ12                          C/C++ Problem

mingw32-make: *** [Peripheral IO Drivers/usb_dcc/polled/usb_dcd_pol_kn_c.obj] Error 1      bsp_Console_MK60FX512VLQ12                     C/C++ Problem

mingw32-make: *** [Peripheral IO Drivers/usb_dcc/usb_dcd_mk60_c.obj] Error 1      bsp_Console_MK60FX512VLQ12                          C/C++ Problem

mingw32-make: *** [Sources/Events_c.obj] Error 1                                          bsp_Console_MK60FX512VLQ12                     C/C++ Problem

I already opened a service request on this issue number: 1-1054023221

Unfortunately, they couldn't duplicate these errors doing exactly what I am doing.  I have tried this on two computers and get the same results.

My questions are:

Has anyone else seen this?

Is there a solution?

I think I must be doing something dumb when following the procedure.

The second attached document is what the service rep. sent me called:

Tags (3)
1 Solution
729 Views
c_dawg
Contributor III

Hey thanks for pointing out the proper way to use the console window!

Knowing this...

C:/Freescale/CW MCU v10.4/MCU/ARM_Tools/Command_Line_Tools/mwccarm|Compiler|Error

(C:\Freescale\Freescale_MQX_4_0\mqx\build\cw10\bsp_Console_MK60FX512VLQ12\Generated_Code\Cpu.c|1207|15|19|55109|19)

= SIM_SCGC4 |= SIM_SCGC4_LLWU_MASK;

>undefined identifier 'SIM_SCGC4_LLWU_MASK'

I was able to find 'SIM_SCGC4_LLWU_MASK' was undefined in cpu.c even though  it included "IO_Map.h" which defined 'SIM_SCGC4_LLWU_MASK' as 0x10000000u.  Not really sure what the problem was but I took 0x10000000u and put it in place of 'SIM_SCGC4_LLWU_MASK' in cpu.c and it compiled fine.

I am not sure this is the correct answer, but it fixed the compile error.

View solution in original post

0 Kudos
6 Replies
732 Views
barrie
Contributor I

I've run into this on a project here and so dug into it a bit.

It seems that we're using a psp customized from one that has an out-of-date MK60f15.h, which #defines the memory model guard macro MCU_MK60F12 and thus prevents the IO_Map.h from declaring it. The newer psp (included with CW 10.5) seems to fix it.

The relevant parts of the older MK60f15.h header are:

    **    Reference manual:    K60P144M150SF3RM, Rev. 1, Oct 2011

    **    Version:            rev. 1.3, 2011-11-18

     ...

    /* SCGC4 Bit Fields */

    #define SIM_SCGC4_EWM_MASK                      0x2u

    #define SIM_SCGC4_EWM_SHIFT                     1

    ....

    #define SIM_SCGC4_VREF_MASK                     0x100000u

    #define SIM_SCGC4_VREF_SHIFT                    20

    /* SCGC5 Bit Fields */

The relevant parts of IO_Map.h are:

    **     Reference manual:    K60P144M150SF3RM, Rev. 2, Dec 2011

    **     Version:             rev. 1.9, 2013-06-24

    ...

    /* SCGC4 Bit Fields */

    #define SIM_SCGC4_EWM_MASK                       0x2u

    #define SIM_SCGC4_EWM_SHIFT                      1

    ...

    #define SIM_SCGC4_VREF_MASK                      0x100000u

    #define SIM_SCGC4_VREF_SHIFT                     20

    #define SIM_SCGC4_LLWU_MASK                      0x10000000u

    #define SIM_SCGC4_LLWU_SHIFT                     28

    /* SCGC5 Bit Fields */

0 Kudos
732 Views
c_dawg
Contributor III

(Forgot to Finish This)

The second attached document is what the service rep. sent me called:

In order to reproduce your issue.pdf

0 Kudos
732 Views
c0170
Senior Contributor III

Hello Colin Dawson,

could you please explain me why do you share problems output , not the console? Does those error say anything to you ? They are meaningless to me. Share a console output the next time.

Could you share yours generated project?

Regards,

c0170

730 Views
c_dawg
Contributor III

Hey thanks for pointing out the proper way to use the console window!

Knowing this...

C:/Freescale/CW MCU v10.4/MCU/ARM_Tools/Command_Line_Tools/mwccarm|Compiler|Error

(C:\Freescale\Freescale_MQX_4_0\mqx\build\cw10\bsp_Console_MK60FX512VLQ12\Generated_Code\Cpu.c|1207|15|19|55109|19)

= SIM_SCGC4 |= SIM_SCGC4_LLWU_MASK;

>undefined identifier 'SIM_SCGC4_LLWU_MASK'

I was able to find 'SIM_SCGC4_LLWU_MASK' was undefined in cpu.c even though  it included "IO_Map.h" which defined 'SIM_SCGC4_LLWU_MASK' as 0x10000000u.  Not really sure what the problem was but I took 0x10000000u and put it in place of 'SIM_SCGC4_LLWU_MASK' in cpu.c and it compiled fine.

I am not sure this is the correct answer, but it fixed the compile error.

0 Kudos
732 Views
c0170
Senior Contributor III

Hello,

I  had read you previous message therefore I was going to point to that LLWU_MASK. I am glad that you have solved it. I always keep the console opened while coding, helps a lot. Problem tab is useless for me the most of time :smileywink:

Regards,

c1070

0 Kudos
732 Views
c_dawg
Contributor III

Here is my console information...

 

C:/Freescale/CW MCU v10.4/MCU/ARM_Tools/Command_Line_Tools/mwccarm|Compiler|Error

(C:\Freescale\Freescale_MQX_4_0\mqx\build\cw10\bsp_Console_MK60FX512VLQ12\Generated_Code\Cpu.c|1207|15|19|55109|19)

= SIM_SCGC4 |= SIM_SCGC4_LLWU_MASK;

>undefined identifier 'SIM_SCGC4_LLWU_MASK'

'Invoking: ARM Compiler'

'Finished building: C:/Freescale/Freescale_MQX_4_0/mqx/source/io/debug/iodebug.c'

"C:/Freescale/CW MCU v10.4/MCU/ARM_Tools/Command_Line_Tools/mwccarm" -gccinc @@"Generated_Code/GPIO1.args" -o "Generated_Code/GPIO1_c.obj" -c "../Generated_Code/GPIO1.c" -MD -gccdep

'Invoking: ARM Compiler'

'Finished building: C:/Freescale/Freescale_MQX_4_0/mqx/source/io/cm/cm.c'

"C:/Freescale/CW MCU v10.4/MCU/ARM_Tools/Command_Line_Tools/mwccarm" -gccinc @@"Generated_Code/MQX1.args" -o "Generated_Code/MQX1_c.obj" -c "../Generated_Code/MQX1.c" -MD -gccdep

' '

' '

'Finished building: ../Generated_Code/GPIO1.c'

' '

'Finished building: ../Generated_Code/MQX1.c'

' '

'Finished building: C:/Freescale/Freescale_MQX_4_0/mqx/source/io/debug/iodebug_asm.S'

' '

Errors caused tool to abort.

mingw32-make: *** [Generated_Code/Cpu_c.obj] Error 1

mingw32-make: *** Waiting for unfinished jobs....

0 Kudos