Toggling the FRDM-K64F RGB LED using interrupts in Kinetis Design Studio (KDS)

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

Toggling the FRDM-K64F RGB LED using interrupts in Kinetis Design Studio (KDS)

Toggling the FRDM-K64F RGB LED using interrupts in Kinetis Design Studio (KDS)

 

Hello Freedom community users


Bheema has posted on the Element14 community a very clear tutorial (accessible following the link below) to create from scratch a basic project example for the FRDM-K64 with Kinetis Design Studio (KDS).


Freescale Freedom development platform: [FRDM-K... | element14


I strongly recommend you to start following those steps to properly setup the tool and the OpenSDAv2 interface embedded in the new Freedom and TWR boards.


Happy Programming

Greg

Labels (1)
Comments

Absolutely Excellent tutorial on how to drive the KDS. Thankyou for posting it.

However I've run into problems with the Segger J-LInk

SEGGER - The Embedded Experts - OpenSDA / OpenSDA V2

there are two versions now 2_0.sda and 2_1.bin

and they aren't explained.

Neither works on my FRDM K64F board.

I've been spinning my wheels trying different alternatives for the last 4hours.

So I wonder if anybody can give some hints.

Timeline:

On a newly received Win8.1 I've got the KDS1.1.0 release downloaded, and built an empty module by specify the board FRDM K64F

Then discovered the excellent Bheema tutorial above - but no place to comment there - so trying here.

Created the project from the processor, then built it- but when came to debug it - it said

"no emulators connected via USB"

I had the mbed serial and composite device loaded.

Followed Bheemas blog on OpenSDA

installed _JLink_V490a.exe which has the "USB Driver for J-Link" and "USB Driver for J-Link with Virtual COM Port"

loading the Segger OpenSDA V2 - and V2.1and dropped them into the BOOTLOADER -  nothing works after power cycling the FRDK64F board.

The board does reliable come to BOOTLOADER (E:) fortunately.

I've tried rebooting my win8.1 system to make sure drivers loaded, but nothing.

Hi Neil,

The Segger OpenSDA v2.1 will not work on your FRDM-K64F, unless you change the bootloader.

Some details about OpenSDA v2.0 and V2.1 can be found on the bottom of FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmware

The OpenSDAv2.1 is only on the FRDM-K22F board (see above article). On the FRDM-K64F you can load the Segger OpenSDAv2.0 application.

See Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse

Hi Erich

Thanks for info.

I can't get the Debugger/USB to work with the FRDM-K64F.even though I can get OpenOCD.exe to talk to the FRDM-K64F/USB with the "mbed composite driver" installed.

I wonder if there is tutorial somewhere as the configuration seems to be complex. I am finding /scripts/target/k64.cfg suggesting that it is supposed to work.

There doesn't appear to be an explanation of how to configure GDB OpenOCD Debugging/USB to work with the FRDM-K64F

Much appreciate any insights

Summary

for FRDM-K64F BOOTLOADER  it takes JLink_OpenSDA_V2.bin   or possiblyCMIS mbded (from http://mbed.org/handbook/Firmware-FRDM-K64F)

Reading from Win8.1 device manager I see

OpenSDA_V2.bin creates  USB controller entry "J-Link OB CDC" that OpenOCD doesn't see to find

20140530_k20dx128_k64f_if_mbed.bin  (rev0203)  create USB Controller entry "mbed Composite Device" that OpenOCD can find

OpenOcd needs to set some configuration options

From KDS - select icon drop down Debug Configuration,

then select GDB OpenOCD Deubgging and previously created "K64_RGB_Switch_Int_Debug - tab.Debugger, Input "Configuration Options"

of which I'm trying

-f ${openocd_path}/scripts/target/k64.cfg

(from \Freescale\KDS_1.1.0\openocd\scripts\target   )

When I launch the debugger (for both OpenSDA-V2 and mbed) I get

--------------------

Error in final launch sequence

Failed to execute MI command:

-target-select remote localhost:3333

Error message from debugger back end:

localhost:3333: The system tried to join a drive to a directory on a joined drive.

localhost:3333: The system tried to join a drive to a directory on a joined drive.

-------------------------

with OpenOcd_v2.bin in the FRDM-K64 if I run

C:\n\bin\Freescale\KDS_1.1.0\openocd\bin\openocd -c

Open On-Chip Debugger 0.8.0-dev-00003-g0c51359 (2014-07-25-13:18)

C:\n\bin\Freescale\KDS_1.1.0\openocd\bin\openocd: option requires an argument --c

Runtime Error: embedded:startup.tcl:47: Can't find openocd.cfg

in procedure 'script'

at file "embedded:startup.tcl", line 47

Info : No configuration files specified defaulting to kinetis.cfg

Info : only one transport option; autoselect 'cmsis-dap'

Error: unable to open CMSIS-DAP device

Error: unable to init CMSIS-DAP driver

Error: Error selecting 'cmsis-dap' as transport

Runtime Error: C:/n/bin/Freescale/KDS_1.1.0/openocd/bin/..//scripts/kinetis.cfg:

3:

in procedure 'script'

at file "embedded:startup.tcl", line 58

in procedure 'interface' called at file "C:/n/bin/Freescale/KDS_1.1.0/openocd/bi

n/..//scripts/kinetis.cfg", line 3

C:\Users\neilh77>

-------------------------------------------------------------------------

with mbed  Composite Device

C:\n\bin\Freescale\KDS_1.1.0\openocd\bin\openocd -c

Open On-Chip Debugger 0.8.0-dev-00003-g0c51359 (2014-07-25-13:18)

C:\n\bin\Freescale\KDS_1.1.0\openocd\bin\openocd: option requires an argument --c

Runtime Error: embedded:startup.tcl:47: Can't find openocd.cfg

in procedure 'script'

at file "embedded:startup.tcl", line 47

Info : No configuration files specified defaulting to kinetis.cfg

Info : only one transport option; autoselect 'cmsis-dap'

Info : CMSIS-DAP: SWD  Supported

Info : CMSIS-DAP: Interface Initialised (SWD)

Info : add flash_bank kinetis kinetis.flash

cortex_m reset_config sysresetreq

adapter speed: 1000 kHz

Info : CMSIS-DAP: FW Version = 1.0

Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1

Info : DAP_SWJ Sequence (reset: 50+ '1' followed by 0)

in procedure 'init'

C:\Users\neilh77>

---------------------------------------

Hi Neil,

It seems to me that you try to talk with OpenOCD to a Segger firmware/probe. This will not work.

Have a look at GDB Debugging with Kinetis Design Studio.

You write

>>for FRDM-K64F BOOTLOADER  it takes JLink_OpenSDA_V2.bin

The it should enumerate as a Segger J-Link, and then you need to talk to it with the Segger interface.

Erich

Hi Erich

Thanks again for input - I got it working,

For anybody else what I did was

I have the USB on my Win8.1 connected to the USB microAB on the FRDM-K64F

In the Control Panel - Device Manager - USB Controller - it shows "J-Link OB CDC"

On the FRDM-K64F that was presetup with mbed boot, I held the reset down and pushed in the USBmicroA connector,

Then dragged and dropped the "JLink_OpenSDA_V2.bin"  (JLink_OpenSDA_V2_1.bin is incompatible)

then I setup the debugger for Segger and pressed the Debug button.

It ran until it hit main() and then stopped

then pressF8 to resume.

The 2nd time I ran it,  my AVG AntiVirus 2014  kicked and removed the Segger J-Link

detecting that Segger "unknown" was accessing the internet I guess

"Unknown is a software that installs an additional program to display and/or download to your device unwanted advertisements, toolbars and may be considered privacy-invasive.

These kinds of threats, called Adware, track your computer's web usage to feed you undesired ad pop-ups and some might even hijack your browser start or search pages,redirecting you to a different site or search engine than the one you had originally configured.Unknown is currently ranked 4303 in the world of online malware"

It referenced  FreescaleKDS_1.1.0\Segger\JLinkGDBServerCL.exe

http://www.avgthreatlabs.com/virus-and-malware-information/info/unknown/?name=Unknown&utm_source=TDP...

So it looks like JLinkGDBServerCL is advertising its being used.

After restoring  JLinkGDBServerCL, and next time it happened marking it as safe, it continued, and seems to be working

Hi Neil,

thanks for posting the solution! I would not have thought that the virus scanner could have caused this. But indeed, I had seen myself other cases where his happened.

thanks again,

Erich

Hello Eric

Thanks - appreciate the support and happy to say what I'm finding.

I've come up with another issue - I don't know if I'm missing something really basic.

I went back into start another project - my aim is to test the USB HOST MSC writing to a USB Stick.

Following the tutorial, exactly as before, as soon as I add the first pin to the project Bit1:BitIO_LDD it is marked with a red x - and the tab Problems has

"Errors: ERROR: This component is not supported in Kinetis SDK project mode. "

I seem to have upset the Processor Expert somehow and don't seem to be able to get it back.

I've tried a number of different approach to just generating one bit correctly, closing the project,rebooting my machine to make sure all processors are dead, but it isn't working.

I've closed all unrelated projects.

I would add a snapshot jpg but, its disabled in this editor.

So I must be doing something really basic wrong but I can't figure it out. Should I switch workspaces?

thanks for any help

Hi Neil,

it looks you have created an SDK project in the wizard with PEx.

the thing is this: with using the SDK, it is not possible to use any of the LDD projects. You only can use components designed for the SDK.

There is no easy way to convert an SDK project into a 'non-SDK' project, as there are a lot of internal dependencies.

If you want to use LDD or any 'non-SDK' projects with the Kinetis SDK, then make sure that SDK is *disabled*:

SDK disabled.png

Erich

Ok Got it. Didn't realise they were different. Many thanks.

Really appreciate your blogs and the examples you are posting. :smileyhappy:

No ratings
Version history
Last update:
‎08-08-2014 05:54 AM
Updated by: