9 years, 7 months ago.

KL25Z production with less flash memory

mbed provides a great platform for developing an application for production, but there is no support for designs using the same chip but with fewer pins or less memory. For example, how do you change the mbed library to compile code for the KL25Z with only 64k or 32k of flash and the corresponding smaller RAM size? How do you change it for 64 pin or smaller packages?

Thanks, Tom

It turns out that the .sct files are locked so you cannot change the size of flash or RAM without exporting the project to an offline tool chain. Why are these files locked? It should be possible to program variants of each processor with mbed.

posted by Tom Russell 11 Oct 2014

1 Answer

9 years, 7 months ago.

For both you can create a custom target for your own environment (you can also make a pull request for this, but I *think* they would want a dev board to exist for that target, but don't pin me on that), where you change that for your target.

Besides that you could also stick to the online compiler and:

Smaller packages: I think just not using the pins which aren't available should do the trick.

Less flash: Make sure your program fits in the smaller flash space and it should go correctly.

Less RAM: See the answer to this question. It is for another target, but should be similar for yours: https://mbed.org/questions/4643/Does-mbed-support-STM32F030F4/. (KL25 default compiles on ARM STD iirc, so you need: http://mbed.org/users/mbed_official/code/mbed-src/file/a7562ccfb9d5/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/TOOLCHAIN_ARM_STD/startup_MKL25Z4.s) and the size in: http://mbed.org/users/mbed_official/code/mbed-src/file/a7562ccfb9d5/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/TOOLCHAIN_ARM_STD/MKL25Z4.sct

Very helpful. Thanks. I was able to figure out what each number means by comparing it to the KL05Z file. Will adjusting the starting address for flash cause the loader to leave space which I could use for the Kinetis bootloader?

Thanks, Tom

posted by Tom Russell 22 Sep 2014

It might work, I have never done that myself so cannot really guarantee it. One thing I do know you need to take into account/change is the interrupt vectors. Their default values are placed in the flash memory. Now the mbed lib copies them to RAM the first time one is changed, but that flash location is already used by the bootloader. So I do know it is an issue, but I don't know exactly how you should deal with it, and what kind of problems you will run into.

Anyway here is that relevant file: http://mbed.org/users/mbed_official/code/mbed-src/file/a7562ccfb9d5/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/cmsis_nvic.c

posted by Erik - 22 Sep 2014