Simplest/cheapest way to flash MC9S12XEP100CAG with .s19 file?

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

Simplest/cheapest way to flash MC9S12XEP100CAG with .s19 file?

10,497 Views
marty900
Contributor I

I already got a .s19 file and only want to program a couple of MC9S12XEP100CAG chips and unlikely to need to do it again so looking for most cost effective solution. What type of programmer do I need and are any aftermarket options available? My chips are soldered to the boards but I don't see any apparent programming headers there so I plan to connect directly to the pins of the chip. Please help.

0 Kudos
Reply
13 Replies

9,863 Views
lama
NXP TechSupport
NXP TechSupport
0 Kudos
Reply

9,937 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I am really confused of your S19 record. I do not understand how you get the srecord you use. The addresses are in logical form and because of this suitable for HiWave. No conversion to linear form is necessary. However, as I wrote before, there is no address FD4000 in the memory map.

At this place it is good to think and get info how the S-record was generated and what part of the code is placed into the space FD4000.

Best regards,

Ladislav

0 Kudos
Reply

9,928 Views
marty900
Contributor I

Hi, sadly I do not have the source code, only that s19 file. I guess normally this file was uploaded via bootloader or something as it is normally flashed over CAN.

The cureent s19 file uploads to 88%. If I manually changed the addresses of the remaining 12% of the code would the code still work? Would you recommend which adresses could I use? I wish I understood about that but all this is new to me and not easy to understand. I would appreciate the help.

0 Kudos
Reply

9,995 Views
lama
NXP TechSupport
NXP TechSupport

OK, i have forgotten linear format for stand alone devices. It looks like you use HiWave and try to use S19 record in linear format which was generated for stand alone device. In this case I suggest you to use reverse conversion from linear format to a banked and it should work.

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Where-can-I-download-the-program-SrecCVT/m-...
Best regards,

Ladislav

 

0 Kudos
Reply

9,988 Views
marty900
Contributor I

Hi, thanks I tried converting the file but it does not or I am doing something wrong. Would you be so kind and try to convert the file? Thank you so much

0 Kudos
Reply

10,299 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

MODC should by connected to the VDD via 4.7k resistor. MODB and MODA should be connected to GND to select special single chip mode for communication with the hiwave or pemicro sw.  (of course, rest should also be connected ....  see https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Reference-schematics-for-S12-X-devices/ta-p...
scheamtic for s12XE and look at the connection of the pins PE5, PE6. They can be conneced to GND directly if they are not used for another purpose later in the application.
)
The connector is not necessary if you are able to ensure connection of required circuitry.

Best reards,

Ladislav

0 Kudos
Reply

10,290 Views
marty900
Contributor I

Thanks a lot. What about connecting +5V power to the s12xe is that pin 87 (VDD)? Can +5V be connected directly to the pin or is a capacitor necessary? And which pin is the s12xe ground for powering it for programming?

0 Kudos
Reply

10,279 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @marty900,

Please refer to AN3262 Designing Hardware for the MC9S12X D-Family

https://www.nxp.com/docs/en/application-note/AN3262.pdf

And follow Chapter 5 MC9S12X D-family Power Supplies

 

The capacitors are needed.

There is no ground pin for just programming the MCU, all the ground pins must be used as specified in the RM and the AN above mentioned.

Also, please note that the TEST pin must be connected to the ground.

 

Regards,

Daniel

 

 

 

0 Kudos
Reply

10,470 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I suppose you have possibility to connect to BDM interface of the MCU. See, attached schematic and search for BDM connector.
Then,

A) Download free version of the CW if you do not have any.
You can download free version of the CodeWarrior for HCS12(X) (Classic IDE)
from
https://www.nxp.com/design/software/development-software/codewarrior-development-tools/codewarrior-l...

It contains some limitations.
The document: https://www.phaedsys.com/principals/codewarrior/codewarriordata/CWS-H12-FS.pdf shows limitations.

> Use only Hiwave.exe from installation directory to load S19 record to the MCU through BDM interface.
1) (CW installation directory\Prog\ hiwave.exe)
2) Component->Set Connection (select connection)
3) File->LoadApplication ----> Select S19 record ----> press load Code


> There is no limitation for program download using hiwave.exe

B)
- Also www.pemicro.com provides its own programmer IDE – PROG12Z. www.pemicro.com

(CodeWarrior is free)


Of course you will need an interface to connect PC to the MCU.
http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320180&productTab=3

Best regards,

Ladislav

 

0 Kudos
Reply

10,079 Views
marty900
Contributor I

Hi, so I found the BDM connector on my board and connected to it via USBDM programmer and hiwave. When I press select my .s19 file and press load code it starts uploading and when it reaches some 80% it gives an error: 'Error while writing to FD4000...FD4200. Information: no memory at this address.' I tried many times on 2 different boards with same chip: MC9S12XEP100CAG but every time it starts and then fails. I attach my .s19 file if anybody could help me please as I have no idea what is wrong.

0 Kudos
Reply

10,296 Views
marty900
Contributor I

Hi, my board does not have a BDM connector, can I connect directly to the relevant pins or do I need to connect via some resistors? Looks like I have the package as in the picture. Could you please help identify the BDM pins: VCC, GND, RESET and BKGD?

0 Kudos
Reply

10,013 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

your S record is not correct. If you look at attached memory map it does not corresponds to neither global(linear) addresses nor PPAGE addresses.

Yes, your S19 record contains an address 0xFD4000 but:

1) If it is PPAGE address then PPAGE = 0xFD must contain offsett 0x8000~0xBFFF. Offset 0x4000 is out of range

2) If it is Global address then yes, it contains offset 4000 but the range of pages GPAGE is from 0x70 to 0x7F. SO the GPAGE = 0xFD is out of range

 

So in both cases it is wrong.

Best regards,

Ladislav

Tags (1)
0 Kudos
Reply

9,990 Views
marty900
Contributor I

Hi,

Thank you for checking, I appreciate it. The .s19 file I attached is the official firmware that the ECU diagnostic tool uses to flash onto this chip via CAN BUS. But when upgrading the firmware there was some sort of error and flashing did not finish essentially bricking the ECU as the diagnostic tool can no longer connect to the chip via CAN. So I am trying to flash the .s19 file on this chip via BDM. How could then the .s19 file be not correct? Also could it be that the .s19 file part that is wrong is not actual program but something that could be removed? I mean would it be possible to convert the file to leave the data only? Thank you

0 Kudos
Reply