10 years, 7 months ago.

Loader crashing when flash configuration bist are set to '0'

Hi All

I used the Flash loader for the first time today on the FRDM-K64F. Loading the Hello World reference worked fine but I couldn't upload my own binary file. Each time I tried the USB disconnected almost immediately and the uploaded SW didn't run. The same SW however runs normally when loaded with a debugger.

After some attempted debugging I found that the uploaded code was not correctly, or fully programmed. The first strange thing was that the program code between 0x410 and 0x403f (just after the flash configuration area) was blank (all 0xff) athough there was code there in the binary.

After experimenting for some time I found the following: If my code sets the Flash configuration (0x400..0x40f) as follows "0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff 0xff 0xff 0xbe 0x03 0xff 0xff", which is setting it as I want each parameter to be, the upload of the binary will fail. It is as if the loader resets during the process just as it wants to program the flash area.

If, however, I change this to "0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xfe 0xff 0xff 0xff" - just the non-secure bit at '0' - the loading works fine and the code runs normally after resetting the board.

Is this problem known?

Regards

Mark

www.uTasker.com

Question relating to:

The Freedom-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs.

3 Answers

10 years, 7 months ago.

I could use this firmware now. I bought another one but it looks like all I needed was this updated firmware. Essentially in the same boat. After I flashed it with a program it never shows the flash drive as available.

What program did you flash it with? What firmware do you need? Is this related to flash protection area?

posted by Martin Kojtal 23 May 2014
10 years, 7 months ago.

Hello Mark,

yes it is known and was designed that way. Firstly, mbed always set those bit to the same value and that is expected to be. However, I updated that behavior in the pull request 2 weeks ago which has still not been merged. This new update should allow a user to change flash configuration bits, except mass erase and security enable bit. Once it will be merged ,the new firmware will be released and available here on mbed site

Regards,
0xc0170

Martin

Thanks. I'll watch out for the update annd verify that I can then load my standard settings.

Regards

Mark

posted by Mark Butcher 04 May 2014
10 years, 7 months ago.

Martin - I don't see a pull request open for this https://github.com/mbedmicro/CMSIS-DAP/pulls but I do see the patch under issue 45. This will be applied shortly.

Mark can you confirm if a file was created called fail.txt on the drive. The contents should have said RESERVED BITS

I started as an issue and shared my branch ;) https://github.com/mbedmicro/CMSIS-DAP/issues/45

posted by Martin Kojtal 05 May 2014

Sam

I can confirm that the fail.txt contains "RESERVED BITS" the next time the connection is made.

Regards

Mark

posted by Mark Butcher 09 May 2014