10 years ago.

Anyone working on porting open-hardware http://mchck.org board with Freescale K20 Cortex M4 ?

Hi,

This is such a nice $5 open-hardware board (http://mchck.org), I just assembled it, and it comes with toolchain, but I would like to use mbed plaftform.

/media/uploads/Mashu/mchck-r5-rc3.png

Does anyone know if there is some work in progress, or whether it would be possible to flash mbed bootloader on this board with Freescale K20 chip ?

Thanks

2 Answers

10 years ago.

Just to make sure: this board has a bootloader running on the target itself. Mbed doesn't have that, and has a seperate chip (which also happens to be a K20 for the Kinetis boards) which acts as programmer. The problem is likely that while it does accept bin files, those bin files require possibly an offset to work with its bootloader.

Accepted Answer

Yes, I have board populated just with the chip and some passives, nothing more and that works.

I think application code starts from 3072 according to ld script for both MK20DX128VLF5 and MK20DX32VLF5

Linker script for MK20DX128VLF5
MEMORY
{
	loader_rom (rx) : ORIGIN = 0x0, LENGTH = 128K
	app_rom (rx) : ORIGIN = 3K, LENGTH = 128K-3K
	ram (rwx) : ORIGIN = 0x20000000 - 16K / 2, LENGTH = 16K
}
...etc...
Linker script for MK20DX32VLF5
MEMORY
{
	loader_rom (rx) : ORIGIN = 0x0, LENGTH = 32K
	app_rom (rx) : ORIGIN = 3K, LENGTH = 29K
	ram (rwx) : ORIGIN = 0x20000000 - 8K / 2, LENGTH = 8K
}
...etc..

But I got bare chip, and I flashed bootloader using buspirate with SWD, so if the mbed port can run without bootloader than it can be flashed starting from the beginning.

posted by Mateusz Kaduk 29 Mar 2014
10 years ago.

Hello,

The mbed bootloader should be functional, although not out of the box, due to different pinouts (I assume the reset button there is not wired to the same pin as on FRDM K20). I believe that board has already the bootloader, doesn't it? IF it does and it accepts .bin files, it should be satisfactory.

I have been porting K20 to mbed, had to pause it for a while. You can look at github repo where K20 is present, not completed though. I have a notepad with k20 progress here on mbed (check my profile).

Regards,
0xc0170

Thanks for your answer. Yes, mchck board already has the bootloader that accepts bin files, also UART, SPI, I2C, FTM(PWM input output) code is functional and available on their git repository. When it comes to pinout it's described here https://github.com/mchck/mchck/wiki/Pinout While nReset can be found at https://github.com/mchck/mchck/wiki/Schematic-and-layout#mcu-schematic so I believe that should be the same as on FRDM K20 board. I find mbed code abstraction more convenient, easier to use and having a couple of extra advantages when compared to lower level coding, which would help me a lot to actually finish my project.

posted by Mateusz Kaduk 29 Mar 2014