Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Freescale K64F MCU and FRDM-K64F Board #3126

Merged
merged 2 commits into from
Jul 2, 2015
Merged

Support for Freescale K64F MCU and FRDM-K64F Board #3126

merged 2 commits into from
Jul 2, 2015

Conversation

jfischer-no
Copy link
Contributor

This PR adds support for Freescale K64F MCU and FRDM-K64F Board.

base on #3099

If someone wants to test it, http://openocd.zylin.com/#/c/2773/ or
https://github.com/jfischer-phytec-iot/openocd/tree/wip%40phytec
could be relevant.

@jfischer-no jfischer-no added Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT State: waiting for other PR State: The PR requires another PR to be merged first labels May 30, 2015
@jfischer-no
Copy link
Contributor Author

rebased on master, volunteers for review?

@jfischer-no jfischer-no removed the State: waiting for other PR State: The PR requires another PR to be merged first label Jun 2, 2015
@@ -0,0 +1,4 @@
ifneq (,$(filter ng_netif,$(USEMODULE)))
USEMODULE += kw2xrf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I see it right, the board does natively not have a radio soldered on, right? So you should remove this file.

@haukepetersen
Copy link
Contributor

nice one! I think I might even have one of those boards in my office - will check on Monday. Besides some minor things, I think the main question is if we want to merge this PR first, or wait for #3155. I don't care...

@jfischer-no
Copy link
Contributor Author

@haukepetersen #3155 is more important for me, so i will rebase this PR on it. thx for review

@jfischer-no jfischer-no added CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable State: waiting for other PR State: The PR requires another PR to be merged first labels Jun 9, 2015
@jfischer-no jfischer-no added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Jun 16, 2015
@haukepetersen
Copy link
Contributor

ok, I do have the board at my office - though I am not there today... Will test tomorrow.

@jfischer-no
Copy link
Contributor Author

@haukepetersen
Copy link
Contributor

I was able to flash the board. After flashing, the RIOT startup output shows up once:

2015-06-19 15:41:39,944 - INFO # �kernel_init(): This is RIOT! (Version: 2014.12-1941-gb2989-HEAD)
2015-06-19 15:41:39,945 - INFO # kernel_init(): jumping into first task...
2015-06-19 15:41:39,945 - INFO # UART0 thread started.
2015-06-19 15:41:39,945 - INFO # uart0_init() [OK]
2015-06-19 15:41:39,946 - INFO # Welcome to RIOT!
2015-06-19 15:41:39,946 - INFO # > *** RIOT kernel panic

After that, the board does not give any other output (same when pressing reset). Can you reproduce this?

@haukepetersen
Copy link
Contributor

wait, no idea what went wrong. After flashing again, dis- and reconnecting the board and then starting pyterm directly, the board is running the default example just fine.

@haukepetersen
Copy link
Contributor

ok, the board seems to break after flashing. After calling make flash term it, it outputs some of the RIOT output to the terminal until it gets stuck somehow. When pressing the reset button there is no effect. But when pulling the USB connection and reconnecting it and opening a terminal (e.g. pyterm) agian, the output is just fine and the reset button does what it is supposed to do. Seems to me, like the CPU is in an undefined state or that the onboard UART-USB converter crashes or something. Any idea what this could be?

@jfischer-no
Copy link
Contributor Author

You need an update of CMSIS DAP firmware https://developer.mbed.org/handbook/Firmware-FRDM-K64F

@jfischer-no
Copy link
Contributor Author

And the mainline version of openocd does not work proper, see above.

@jfischer-no
Copy link
Contributor Author

@haukepetersen Are you still alive? :-)

@haukepetersen
Copy link
Contributor

Yes, I am... I did use the patched OpenOCD version from you github fork. But I did not update the FRDM DAP firmware (yet). I will give this a try an let you know.

@haukepetersen
Copy link
Contributor

Updated the DAP firmware (to v0221). Now I can't flash the device with OpenOCD anymore (still using the patched OpenOCD version).

I get

Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD IDCODE 0x2ba01477
START...
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ef40
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ef44
Info : SWD IDCODE 0x2ba01477
Error: Failed to write memory at 0xe000edfc
Polling target k64f.cpu failed, trying to reexamine
START...
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 100ms
Polling target k64f.cpu failed, trying to reexamine
START...
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 300ms
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* k64f.cpu           cortex_m   little k64f.cpu           unknown
START...
Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
Warn : ****                                                          ****
Warn : **** Your Kinetis MCU is in secured state, which means that,  ****
Warn : **** with exception for very basic communication, JTAG/SWD    ****
Warn : **** interface will NOT work. In order to restore its         ****
Warn : **** functionality please issue 'kinetis mdm mass_erase'      ****
Warn : **** command, power cycle the MCU and restart OpenOCD.        ****
Warn : ****                                                          ****
Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
in procedure 'reset' 
in procedure 'ocd_bouncer'

I don't have the time right now to look further into it, will try to get to it soon.

@jfischer-no
Copy link
Contributor Author

@haukepetersen

  • Hold the reset button and execute make BOARD=frdm-k64f flash in a project directory
  • Release reset button just after "Info : MDM: Chip is unsecured. Continuing."

@jfischer-no
Copy link
Contributor Author

rebased on master

@OlegHahm OlegHahm removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 23, 2015
@OlegHahm
Copy link
Member

I cannot be ready for CI build and need squashing at the same time.

@haukepetersen haukepetersen added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 1, 2015
@haukepetersen
Copy link
Contributor

@jfischer-phytec-iot: sorry for the delay... Flashed as you described, works like a charm now!

One thing I would like to ask you: could you put the information about the OpenOCD patches and the initial erase steps into the Wiki? I already started a rough page about the board here. Thanks!

One more thing to add: ACK, please squash and add the 'Ready for CI build' tag.

@jfischer-no jfischer-no added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable labels Jul 1, 2015
@jfischer-no
Copy link
Contributor Author

@haukepetersen squashed, I also wrote a little...

@jfischer-no
Copy link
Contributor Author

The Travis was merciful 🎆 .

@haukepetersen
Copy link
Contributor

ACK and go!

haukepetersen added a commit that referenced this pull request Jul 2, 2015
Support for Freescale K64F MCU and FRDM-K64F Board
@haukepetersen haukepetersen merged commit 5310cd3 into RIOT-OS:master Jul 2, 2015
@jnohlgard
Copy link
Member

Nice!

@jfischer-no jfischer-no deleted the pr@frdm-k64f branch July 2, 2015 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants