How do I start with the Freedom FRDM-K22F?

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

How do I start with the Freedom FRDM-K22F?

Jump to solution
5,420 Views
coopertrooper
Contributor III

Hello everyone,

 

I am having the hardest time writing even a single program to work with the FRDM-K22F eval board. I have downloaded codeWarriors IDE and KSDK 1.1.0 , but I seem not not ever be able to get a single hello world application running. Is there a step by step or something similar I can follow to write my very first simplest hello world program for this eval board? I followed the "quick start guide" from freescale.com/k22f but that only takes me up to where it mentions like 3 or 4 IDEs and that is it. Any help is greatly appreciated.

Labels (1)
1 Solution
1,699 Views
coopertrooper
Contributor III

For anyone interested, this guide provides a one stop shop to get a working project from scratch.

View solution in original post

11 Replies
1,700 Views
coopertrooper
Contributor III

For anyone interested, this guide provides a one stop shop to get a working project from scratch.

1,699 Views
Rick_Li
NXP Employee
NXP Employee

HiCaicedo,

Regard your question, I would suggest refer quick start package of FRDM-K22F.

FRDM-K22F-QSP (Quick start package) can be downloaded from the below link:

FRDM-K22F|Freedom Development Board|Kinetis|Freescale

(Please Expand "Run-time Software " to download this package)

please reply if you have any question!

0 Kudos
1,699 Views
coopertrooper
Contributor III

Hello,

Thank you very much for replying to my message.

I have that package that you mention already downloaded into my machine. I followed the instructions indicated in the FRDM-K22F-QSG.pdf successfully, and installed the drivers correctly, updated bootloader. At the end of this document it just mentions a couple of IDEs that are available, but that is where it ends.

I downloaded the Kinetis software dev kit from freescale.com/ksdk.

I followed the instructions I read from someone else in this forum that in order to get the KS IDE working, i had to follow the instructions in the "Getting Started with Kinetis SDK (KSDK).pdf". Following those instructions I was finally able to successfully compile a Hello_world demo program into .elf. Then I used objcopy.exe to turn the .elf into a .bin, which I then had to manually copy over the mbed directory to write into the K22.

My problems with the Kinetis Design Studio are:

- Compile a program to produce .bin files instead of .elf files

- being able to directly load/run/debug a program using the IDE, instead of having to manually copy and paste the .bin file into the mbed drive.

0 Kudos
1,699 Views
DavidS
NXP Employee
NXP Employee

Hi Christian,

The FRDM-K22F (and other Freedom development boards) can have different debugger firmware loaded.

By default the FRDM-K22F comes with the MBED debugger firmware which only accepts a binary file and works really well with the MBED online development environment.  Firmware FRDM K22F - Handbook | mbed

Other debugger firmware from P&E Microcomputer and Segger JLink ( ) can also be used and they work with the *.elf file generated in KDS.  Other development environments are IAR/Keil/Atollic/GCC.

I recommend the P&E (FRDM-K22F: Debugging with P&E OpenSDAv2.1 Firmware) or JLink (FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmware) .

Regards,

David

1,699 Views
coopertrooper
Contributor III

Hello David,

Appreciate your help with someone who is completely new at working with the FRDM boards.

So, If I understand correctly, the firmware seems to be company dependent (P&E, Segger, etc), and the firmware that is loaded into the microcontroller has to match the one I select when debugging?

Following this assumption I made an experiment. I loaded the default mbed  firmware from developer.mbed.org into the booloader, and for the debug in the kinetis design studio I selected the debugging configuration that says "GDB OpenOCD". The program was actually able to load into the mcu, and it is now capable of successfully execute and debug with step into/step out/etc.

0 Kudos
1,699 Views
DavidS
NXP Employee
NXP Employee

Hi Christian,

You are correct!

Other resources that might be helpful.

Kinetis Design Studio

Look to right under "FEATURED CONTENT".

Regards,

David

0 Kudos
1,699 Views
coopertrooper
Contributor III

David,

I was able to successfully run the hello world program using both the JLink and the mbed bootloader and corresponding debug configuration. However the first time I tried JLink, i kept getting a "does not support serial wire output" error. Other than the error message, the program actually executed correctly and debugged fine. I then changed the debug config (unchecked the SWO box), and tried again. This time the SDK IDE just crashed on me.

After the crash, I was no longer able to debug since I got an error:

WARNING: Failed to read memory @ address 0x00000530

WARNING: Failed to read memory @ address 0x00000000

I also noticed that the mbed directory is no longer visible in the Windows Explorer.

If I change the bootloader back to mbed from JLink, then the mbed directory works ok, and I am able to debug fine. But if I revert back to JLink bootloader, the symptoms persist (no directory and cannot debug).

Did I brake the MCU? I restarted the computer thinking that might help but it did not.

0 Kudos
1,699 Views
DavidS
NXP Employee
NXP Employee

Hi Christian,

FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmware

Above link had the Disable SWO step about half way down the page but glad you we able to figure it out.

I have not had the issue before.  You might try putting the OpenOCD firmware back in, test all is OK, then try the JLink firmware again.

Sorry for the hassle.

Regards,

David

0 Kudos
1,699 Views
coopertrooper
Contributor III

David,

Sadly, I already tried alternating between the JLink and the OpenOCD firmware several times, and every time the JLink does not work, but the OpenOCD works fine. I downloaded a new copy of the JLink firmware just in case, but still same symptom.

guess I am stuck using OpenOCD for now.

0 Kudos
1,699 Views
DavidS
NXP Employee
NXP Employee

Weird.  Sorry to ask...but you are sure you were trying to debug using the GDB SEGGER J-LINL Debugging Debug Configuration?

I'm attaching the PEMicro debugger firmware if you want to try it.

Regards,

David

0 Kudos
1,699 Views
mjbcswitzerland
Specialist V

Hi

Don't miss checking out

µTasker Kinetis FRDM-K22F support

(compatible with µTasker Kinetis TWR-K22F120M support and many other boards).

Works out-of-the-box with CW, KDS, IAR, Keil uVision, Rowley Crossworks, CooCox, Atollic, GCC make, Green Hills (in dev. version) and VisualStudio for simulation and debugging.

Allows composite USB devices with multiple USB-CDC to UART bridges to be created with just a couple of defines (eg. #define USB_CDC_COUNT   3 for 3 - and can be adjusted from 1..6 - limited by UARTs in the K22) and allows creating KBOOT compatible boot loaders mixed with USB-MSD, SD card etc. Projects movable between most TWR and FRDM boards with just 3 project settings in most IDEs (no porting needed since it adapts itself automatically).

Regards

Mark

http://www.utasker.com/kinetis.html

0 Kudos