AnsweredAssumed Answered

Can USBDM program to ROM space?

Question asked by Taisuke Yamada on Apr 24, 2012
Latest reply on Apr 25, 2012 by Taisuke Yamada



While testing out USBDM, I noticed I couldn't program the chip which used banked memory region.

Specifically, I'm working with MC9S12NE64 chip right now, and this chip has following memory map:


MCU space ---(maps to)--> ROM space--------------------------------------------0x0000-0x3FFF             none (MCU space has registers/RAM)0x4000-0x7FFF             0x8000-0xBFFF0x8000-0xBFFF             bank switched with PPAGE to:                          - 0x0000-0x3FFF                          - 0x4000-0x7FFF                          - 0x8000-0xBFFF                          - 0xC000-0xFFFF0xC000-0xFFFF             0xC000-0xFFFF


It seems USBDM tries to program the chip using MCU memory space, so it cannot program to any of banked region, hidden from MCU space. I worked around the issue by writing custom programming tool using the USBDM API.


This is kind of problematic (at least confusing), as this means memory map is completely different depending on what tool you use to program the chip. Since flash programming based on ROM space is more generic (it can access all parts of memory space), it may be useful to add a new programming mode to HCS12_FlashProgrammer.


I'm not sure about other chip types, but if they have banked memory system, they may also have similar issue.


I'm planning to either post a patch or upload my custom programming tool, so other people can use it. I guess patch would be a better idea, but I currently do not have environment to rebuild USBDM on Linux as I'm not familiar with build system / source code structure of USBDM.