Problem to read out on a MC9S12C128C with USBDM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem to read out on a MC9S12C128C with USBDM

Jump to solution
10,560 Views
ProNet36
Contributor I

Hi there,

i have big trouble to read out a MC9S12C128C.

When I read out the MC9S12C128C the page function does not work.
I have in the addresses :
388000 to 38BFFF
398000 to 39BFFF
3A8000 to 3ABFFF
3B8000 to 3BBFFF
3C8000 to 3CBFFF

always the same data from the address range

388000 to 38BFFF

What am I doing wrong or can it be a hardware problem?

Sincerly

David

0 Kudos
1 Solution
10,119 Views
pgo
Senior Contributor V

Hi,

The file you provided uses a linear array for the flash rather than paged addresses (as you are probably aware).

The HCS12 programmer only supports this format for a very few devices that provide programming directly in that format in the BDM interface.

I have added an option to the HCS12 programmer to convert SREC files from linear to paged addressing when loading the hex file.  The updated software is available on sourceforge:

https://sourceforge.net/projects/usbdm/files/ 

Using this version of the programmer I was able to program the device as expected from the image.

Doing a read-back using Usbm Memorydump provided an image that verified correctly against the programmed device in the programmer.

The image does not have repeated blocks which was the start of this discussion so I have no explanation for why that occurred.

I obviously cannot verify that the program runs correctly - let me know if there is still a problem.

 

Can you tell me what software produced the image provided?

bye

 

Edit: Updated link

View solution in original post

0 Kudos
27 Replies
5,774 Views
pgo
Senior Contributor V

Hi Again,

The result indicates the chip is not secured and operating in a mode with internal Flash enabled so I do not know of a reason why it would not be readable. (This is using the original working chip?)

Given the above it should be possible to read the chip using the paged memory area as described earlier and then duplicate from this image.

I have no idea why the memory pages would be the same but it doesn't look like a error with memoryDump.

 

You have indicated that you have an original flash file to program.

Can you provide this file if it is not confidential?

Am I correct in thinking that you have a working device programmed from this flash file?

bye

 

0 Kudos
5,755 Views
ProNet36
Contributor I

Hi pgo,

Yes, this is exactly the chip that works on the board.

Of course I can provide the flash content, but not here in the forum.
But the flash file has a different address range and can not be programmed with the BDM. But it works with the Cyclone Pro. Only the start address ranges would have to be changed.

I also have a device here that works, and the Cyclone Pro to flash it again and again to original.

0 Kudos
1,769 Views
pgo
Senior Contributor V

Hi David,

You can send an attachment by private message is that is OK.

Can I once again clarify the situation with the information just provided:

  • You have a flash file that works with Cylone Pro and testing on your hardware.
  • The USBDM software does not support programming this file. (Is it an ELF file by any chance as there are some ambiguities in file formats for HCS12. Tools produce different formats of elf file - or at least I have been unable to clarify the exact format.)
  • Even when programming with Cyclone pro i.e. a know good device, the read-back of this device using UbdmMemoryDump has repeated data in paged blocks as described earlier.
  • Programming with an image created with memory dump fails to perform correctly.

Excuse the above pedantry but I am really puzzled by the results so far!

Thanks for your patience.

bye

0 Kudos
1,768 Views
ProNet36
Contributor I

Hi pgo,

Exactly.
We actually have 2 working boards and the Cyclone Pro to flash this board back to original state over and over again.
We also have the original flash file which the CyclonePro programs into the flash.

I then noticed that if I read a working board with memory dump and flash back to a 2nd with the BDM this board does not work.

With the CyclonePro I could always persuade the boards to work again.

After that I started to search and found this problem.

0 Kudos
10,120 Views
pgo
Senior Contributor V

Hi,

The file you provided uses a linear array for the flash rather than paged addresses (as you are probably aware).

The HCS12 programmer only supports this format for a very few devices that provide programming directly in that format in the BDM interface.

I have added an option to the HCS12 programmer to convert SREC files from linear to paged addressing when loading the hex file.  The updated software is available on sourceforge:

https://sourceforge.net/projects/usbdm/files/ 

Using this version of the programmer I was able to program the device as expected from the image.

Doing a read-back using Usbm Memorydump provided an image that verified correctly against the programmed device in the programmer.

The image does not have repeated blocks which was the start of this discussion so I have no explanation for why that occurred.

I obviously cannot verify that the program runs correctly - let me know if there is still a problem.

 

Can you tell me what software produced the image provided?

bye

 

Edit: Updated link

0 Kudos
1,757 Views
ProNet36
Contributor I

Hi pgo,

I can confirm all your statements.
With version .275 I can now also flash the linear image without errors.
After flashing the board works correctly.
A read back in the memory dump now also works without errors or repeating blocks.
I have also written this read out image from MemoryDump back again and the board works without errors.
Absolutely brilliant!

The compiler is the Image Craft IDE for ICC12.
To create the image you have to do several steps.
The generated S19 file must be converted to Log2Phy_12.exe.
Then our bootloader is written in front of the converted program and the SAP image can be created for the CyclonePro 

Many Thank

0 Kudos
1,883 Views
kef2
Senior Contributor IV

Perhaps your MCU is secured. For proper reading you need to make sure MODE register confirms special single chip mode. As well you need to make sure MCU is not secured, check FSEC register, make sure FF0F (NVSEC location) as well confirms unsecured mode, perhaps read BDM status register as well (special BDM command for this). 

With secured MCU you will read over BDM the same data pattern nor only from flash pages, but as well from RAM (, perhaps some registers are not readable as well, not sure, I need to refresh my experience).

0 Kudos