Hi, i am trying to start using Kinetis KWIKSTIK K40, using codewarrior for MCU v10.6. But I stucked at the start in test ... I have already read few similar topics, but still dont know, what to do with it...I have win7 x64
Thanks you for any help.
#include "stdio.h"
#include "derivative.h"
int main(void)
{
int counter = 0;
printf("test \n");
for(;;) {
counter++;
}
return 0;
}
**** Build of configuration FLASH for project KWICKSTIK_TEST ****
"C:\\Freescale CodeWarrior\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j16 all
'Building file: ../Sources/main.c'
'Building file: ../Project_Settings/Startup_Code/__arm_end.c'
'Building file: ../Project_Settings/Startup_Code/__arm_start.c'
'Building file: ../Project_Settings/Startup_Code/kinetis_sysinit.c'
'Executing target #1 ../Sources/main.c'
'Executing target #2 ../Project_Settings/Startup_Code/__arm_end.c'
'Executing target #3 ../Project_Settings/Startup_Code/__arm_start.c'
'Executing target #4 ../Project_Settings/Startup_Code/kinetis_sysinit.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale CodeWarrior/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Sources/main.c" @"Sources/main.args" -MMD -MP -MF"Sources/main.d" -o"Sources/main.o"
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale CodeWarrior/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Project_Settings/Startup_Code/__arm_end.c" @"Project_Settings/Startup_Code/__arm_end.args" -MMD -MP -MF"Project_Settings/Startup_Code/__arm_end.d" -o"Project_Settings/Startup_Code/__arm_end.o"
"C:/Freescale CodeWarrior/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Project_Settings/Startup_Code/__arm_start.c" @"Project_Settings/Startup_Code/__arm_start.args" -MMD -MP -MF"Project_Settings/Startup_Code/__arm_start.d" -o"Project_Settings/Startup_Code/__arm_start.o"
"C:/Freescale CodeWarrior/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Project_Settings/Startup_Code/kinetis_sysinit.c" @"Project_Settings/Startup_Code/kinetis_sysinit.args" -MMD -MP -MF"Project_Settings/Startup_Code/kinetis_sysinit.d" -o"Project_Settings/Startup_Code/kinetis_sysinit.o"
'Finished building: ../Project_Settings/Startup_Code/__arm_end.c'
' '
'Finished building: ../Project_Settings/Startup_Code/__arm_start.c'
' '
'Finished building: ../Sources/main.c'
'Finished building: ../Project_Settings/Startup_Code/kinetis_sysinit.c'
' '
' '
'Building target: KWICKSTIK_TEST.elf'
'Executing target #5 KWICKSTIK_TEST.elf'
'Invoking: ARM Ltd Windows GCC C Linker'
"C:/Freescale CodeWarrior/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" @"KWICKSTIK_TEST.args" -o"KWICKSTIK_TEST.elf"
C:/Freescale CodeWarrior/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv7e-m\libuart.a(uart_console_io.o): In function `__init_uart_console':
ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:200: undefined reference to `InitializeUART'
C:/Freescale CodeWarrior/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv7e-m\libuart.a(uart_console_io.o): In function `__read_console':
ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:93: undefined reference to `ReadUARTN'
C:/Freescale CodeWarrior/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv7e-m\libuart.a(uart_console_io.o): In function `__init_uart_console':
ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:200: undefined reference to `InitializeUART'
C:/Freescale CodeWarrior/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv7e-m\libuart.a(uart_console_io.o): In function `__write_console':
ARM_GCC_Support/ewl/EWL_C/src/sys/uart_console_io.c:151: undefined reference to `WriteUARTN'
mingw32-make: *** [KWICKSTIK_TEST.elf] Error 1
Hello Sarka:
When you create the project in CW you have three options as I/O support (printf, scanf, and the like):
- UART(default)
- Debugger Console
- No I/O
In this case I assume you selected UART, but if using printf this requires UART low level routines defined in your code. This is pretty well explained by colleague Erich Styger in the next tutorials:
Tutorial: Printf() with (and without) Processor Expert | MCU on Eclipse
http://mcuoneclipse.com/2013/04/17/printf-with-the-frdm-kl25z-board-and-without-processor-expert/
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thansk you so much! :smileyhappy:
BUT...
I had to make a new project with procesor expert, becauce when I copised he libraries and re-writed the void ConsoleIO_Init() there were a many others errors, main.c was clear and errors were in that ConsoleIO.c I copied the libraries and re-writed the void ConsoleIO_Init() . The errors werent only in changed part, but in whole file.
So i add consoleIO component to project, but i have issue with settings, if i make cange acording to tutorial everythnig go wrong.
And if i dont make any changes its works.
I thing the reason is that maybe i am using different device. Is it possible? Its hard to find any informations about device and how make it work.So i'm really glad that i moved forward a little bit. Maybe i will need help again :smileygrin: Thanks again
Hello Sarka:
In your first picture you tried to select PTA1 and PTA2 as Rx and Tx pins. Those pins are configured by default for JTAG functionality (programmer), so you better do not use those.
You could instead select other pins, such as PTE9 and PTE8. If you have a Tower System (TWR-Elevators + TWR-SER), then you can have easy access to those UART signals using DB9 connector in TWR-SER.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Well, i dont have whole tower, just LCD panel (kwikstik k40), so using DB9 connector isn't possible for me...I tried this settings:
In my device was some default program with some apps, after debug and start its disappeared. So i guess i am rewrite it with clear progoram...Is it mean that the connection is alright, isn't?
Are there any finished programs which i can use? I found some demo,but it didn't work at all, a failed in importing to workspace:smileyplain:
Hi Sarka:
Yes, if you can start a debug session it means that connection is good.
There are some demo projects in your CodeWarrior installation:
C:\Freescale\CW MCU v10.6\MCU\CodeWarrior_Examples\Kinetis_Examples\k40
Easiest way to import a project is by "Drag and Drop" of the .project from the Explorer to "CodeWarrior Projects" view:
But you can also go to "File -> Import -> General -> Existing Projects into Workspace", and actually this is the correct way.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello, this is what i look for! :smileyhappy: but again, i have some trouble with connection
it cant find device...
Error launching hello_world_MK40X256VMD100_INTERNAL_RAM_PnE OSJTAG
ARM GDI Protocol Adapter : Can't connect. The Debugger can not connect to the P&E device
I haven't do any changes in example project.
Before, in my "test project" , J-link was available:
From your screenshots, you have your connection configured to use a P&E device, but want to use a Segger J-Link?
Make sure you configure it properly for J-Link (JTAG or SWD, depending on your target):
Erich