In “CodeWarrior Flash Programming from a DOS Shell” I showed how to program a device from the DOS shell. Because that example was for ColdFire and CodeWarrior for MCU10.2, here is the same for a Kinetis (FRDM-KL25Z) and CodeWarrior for MCU10.6. In my workspace (c:\tmp\wsp_10.6) I have a project folder (FRDM-KL25Z).
I’m using the ‘Flash Programmer’ to sneak the needed commands:
I use these commands to build my TCL file (Standalone.tcl) with the launch configuration of my project (FRDM-KL25Z_FLASH_OpenSDA):
############################################################ # Standalone.tcl: a script file to flash my application ############################################################ # in any case, disconnect an existing debug connection cmdwin::fl::disconnect # set launch configuration: cmdwin::fl::target -lc "FRDM-KL25Z_FLASH_OpenSDA" # set Set the target RAM buffer for downloading image data: cmdwin::fl::target -b 0x1ffff000 0x4000 # switch off verify and logging: cmdwin::fl::target -v off -l off # select flash device, organization and memory range: cmdwin::fl::device -d "FTFA_PFlash128S1RAM16" -o "32Kx32x1" -a 0x0 0x1ffff # specify target file, auto detect format, range settings on followed by the flash range, offset settings off cmdwin::fl::image -f "C:\\tmp\\wsp_10.6\\FRDM-KL25Z\\FLASH\\FRDM-KL25Z.elf" -t "Auto Detect" -re on -r 0x0 0x1ffff -oe off # now erase the flash... cmdwin::fl::erase image # ... followed by writing the application to flash: cmdwin::fl::write # disconnect connection fl::disconnect # exit Eclipse IDE quitIDE
I recommend to run the .tcl file wither with the ‘source’ command in the Debugger Shell first (without the quitIDE at the end):
Here is the full Debugger Shell log:
CodeWarrior Debugger Shell v1.0 %>source c:\tmp\wsp_10.6\Standalone.tcl cmdwin::fl::disconnect cmdwin::fl::target -lc FRDM-KL25Z_FLASH_OpenSDA cmdwin::fl::target -b 0x1ffff000 0x4000 cmdwin::fl::target -v off -l off cmdwin::fl::device -d FTFA_PFlash128S1RAM16 -o 32Kx32x1 -a 0x0 0x1ffff cmdwin::fl::image -f C:\tmp\wsp_10.6\FRDM-KL25Z\FLASH\FRDM-KL25Z.elf -t Auto Detect -re on -r 0x0 0x1ffff -oe off cmdwin::fl::erase image Beginning Operation ... ------------------------- Auto-detection is successful. File is of type Elf Format. Performing target initialization ... thread break: Stopped, 0x0, 0x0, cpuARMLittle, Unknown (state, tid, pid, cpu, target) thread set: Stopped, 0x0, 0x0, cpuARMLittle, Unknown (state, tid, pid, cpu, target) thread break: Stopped, 0x0, 0x0, cpuARMLittle, Unknown (state, tid, pid, cpu, target) source c:\\tmp\\wsp_10.6\\Standalone.tcl Downloading Flash Device Driver ... Reading flash ID ... Erasing Sector 0x00000000 to 0x000003FF Erasing Sector 0x00000800 to 0x00000BFF Erasing Sector 0x00000C00 to 0x00000FFF Erasing Sector 0x00001000 to 0x000013FF Erasing Sector 0x00001400 to 0x000017FF Erasing Sector 0x00001800 to 0x00001BFF Erasing ... Erase Command Succeeded cmdwin::fl::write Beginning Operation ... ------------------------- Using restricted address range 0x00000000 to 0x0001FFFF Programming file C:\tmp\wsp_10.6\FRDM-KL25Z\FLASH\FRDM-KL25Z.elf Auto-detection is successful. File is of type Elf Format. Downloading Flash Device Driver ... Reading flash ID ... Auto-detection is successful. File is of type Elf Format. Downloading 0x000000C0 bytes to be programmed at 0x00000000 Executing program .... Program Command Succeeded Downloading 0x00001364 bytes to be programmed at 0x00000800 Executing program .... Program Command Succeeded cmdwin::fl::disconnect thread exit: Stopped, 0x0, 0x0, cpuARMLittle, Unknown (state, tid, pid, cpu, target)
Finally, I can add/enable the quitIDE at the end of the TCL file to close the IDE at the end. From the DOS shell, I launch it like this:
"c:\Freescale\CW MCU v10.6\eclipse\cwide.exe" -data "c:\tmp\wsp_10.6" -vmargsplus -Dcw.script="c:\tmp\standalone.tcl"
It will take a while to initialize the debugger engine. But above way is a convenient way to automate flashing several boards.
Happy DOSing 🙂
Links
- Scripting: The Debugger Shell, Getting started…
- Debugger Shell: Test Automation
- CodeWarrior Flash Programming from a DOS Shell
Hi Erich,
Do you have any articles on implementing GUI/interfacing touchscreens with Kinetis MCUs?
LikeLike
I’m using the touch display which is present on the TWR-LCD and I have examples here: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples.
But no tutorial. I do have as well a touch screen SSD1289 shield (http://blog.lincomatic.com/?p=1074, I have the Rev B), but no time to use it (yet).
As for a tutorial, I have this: https://mcuoneclipse.com/2012/12/16/zero-cost-84×48-graphical-lcd-for-the-freedom-board/
I hope this helps.
LikeLike