4 years, 11 months ago.

Is SPI driver for FRDM-K64F broken?

Hi,
Today one of my colleague was having difficulty to use SPI in his mbed program.
We spent rather long time and could not find any problem in his program,
so from curiosity I just changed the platform to FRDM-KL25Z and it worked fine!

Then I tried my oscilloscope (k64f version) and it was working fine, too.
Then I noticed that mbed library is out-dated, so I just updated the mbed lib.
Bingo! my oscilloscope stopped working, too.

Would someone in charge of mbed library for FRDM-K64F take a look at the SPI driver?
I prefer working SPI driver over not working one.

moto

I am using 2 SPI buses on the K64F concurrently. One is connected to the K64F internal SD Flash, the other through the Arduino connector D13-D10 controlling a MX25L2006E. They have worked fine until the latest mbed, mbed-rtos, EthernetInterface builds. I get a compiler error when accessing CPU register UART_PFIFO_REG(UART0). If I bypass that, it compiles ok, but then the K64F freezes at the initialization of SDFileSystem. The I2C finds totally different devices than the devices installed. The last known working builds for me are:

mbed 119 mbed_rtos 111 EthernetInterface 52 SDFileSystem 23 (Neil Thiessen's version)

Also, "Ethernet" is not recognized for the K64F (a long time problem). All I want to do here is just get the Ethernet link status up or down...

...kevin

posted by Kevin Braun 17 May 2016

Thank you for your information!

mbed 119 mbed_rtos 111 EthernetInterface 52 SDFileSystem 23 (Neil Thiessen's version)

This is a valuable information!

I wonder if we could expect the library developers to test their work before publishing.
Although I know that no one is perfect, this kind of problem hurts rather many people.

moto

posted by Motoo Tanaka 18 May 2016

2 Answers

4 years, 11 months ago.

You can also mention this on the mbed Github: https://github.com/mbedmicro/mbed/issues. Apparently also PwmOut is broken in latest one, so I wonder how this all came through their test setup. In the meantime I would just switch to revision 119 if that still works.

Thank you for your information!
It seems that mbed for FRDM-K64F has lots to be fixed for the current version.
I will also try submitting this problem to github...,
last night all I could reach was creating an account there.

moto

posted by Motoo Tanaka 18 May 2016

I posted my issue to the github.
https://github.com/mbedmicro/mbed/issues/1754

And I received a response

==========

FYI, the program hangs in DSPI_MasterWriteDataBlocking(), which is a KSDK 2.0 function (http://kex.nxp.com/apidoc/2.0/group__dspi.html#ga70a0f7d7fe2fbce7993bbcc8c427b2b0). The thing that seems odd to me is that KSDK 2.0 hasn't been released for the K64F, only for the KS22 processor line. I also notice that the file mbed/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K64F/spi_api.c is identical to TARGET_K22F/spi_api.c. Is that a mistake? Is it possible that the K64F code is using the wrong implementation of the KSDK libraries, at least for the SPI driver?

==========

It seems that mbed lib v120 is something we should "NOT" use with FRDM-K64F.

moto

posted by Motoo Tanaka 20 May 2016
4 years, 10 months ago.

When I try to use the MBED SPI example on my FRDM-K64F the code just hang in the spi.format setup part. Can this be caused by this? Are there any progress on the problem that is described here

Try using version 119 of the library, that should work correctly. To do this right click on the mbed library under your project on the left, select revisions, select 119 and click the switch button.

If you are still having problems then it's probably in your code somewhere.

posted by Andy A 09 Jun 2016

Thanks Andy, rev 119 was better! Another strange thing: I used pin 8 (PTA0) as ChipSelect but i needed to write to PTC12 in order to get something to happen.

posted by Søren Møller Dath 09 Jun 2016

Yes, they changed the pin assignment, but the diagram was not changed...
I needed to read the schematic.
Please refer to my old post and the end part about it.
https://developer.mbed.org/users/Rhyme/code/TFT_test_frdm-k64f/

posted by Motoo Tanaka 10 Jun 2016