Environment Codewarrier 5.1 for M9S12Xdp512 on WIN 7 64 bit. Programmer was Multilink Universal and .ini file and .prm configured to place 32 bytes into EEROM at 0C00. Tapped F5 and debugger loads .abs file and erases and initializes EEROM with default data.
Now I have a Multilink Universal FX which doesn't work at all with Codewarrier and my non FX unit won't be back for a week or so. I had also bought the P&E PROG12Z which does recognize the Multilink Universal FX so I thought I'd try programming with that.
First I have to translate the logical address S records to physical ones using the P&E application LOG2PHYS application. A little bit of digging and I see that there is no set of S records describing my default EEROM values.
In one of the files I have declared:
typedef BYTE TEEPROM_DATA[1000]; #pragma DATA_SEG EEPROM_DATA extern TEEPROM_DATA EEPROM_Storage;#pragma DATA_SEG DEFAULT
The EEROM is declared in EEROM_cfg.h (attached):
#pragma DATA_SEG EEPROM_DATA TEEPROM_DATA EEPROM_Storage = { 0x01, //! 0 MODBUS Module # 0x00,0x00, //! 1,2 Spare for COM1. 65, //! 3 MODBUS Bit Rate 19200 (COM2) 0x01,0x23, //! 4,5 MODBUS 3.5 character Delay Time. CANRATE_250K, //! 6 CAN Channel 0 CANRATE_500K, //! 7 CAN Channel 1 CANRATE_500K, //! 8 CAN Channel 2 CANRATE_500K, //! 9 CAN Channel 3 CANRATE_250K, //! 10 CAN Channel 4 0x00,0x00,0x00,0x00,0x00, //! Spare 11,12, 13, 14, 15 0xE7, //! 16 ELCON Charger ID for Tray #1 0xE8, //! 17 ELCON Charger ID for Tray #2 0xE9, //! 18 ELCON Charger ID for Tray #3 0xE5, //! 19 ELCON Charger ID for Tray #4 80,80,80,80, //! 20..23 Max Current (Amps) Tray #1..#4 29,29,29,29, //! 24..27 Max Voltage (Volts) Tray #1..#4 10,10,10,10 //! 28..31 MIN SOC before Automatic Charging Starts };#pragma DATA_SEG DEFAULT
Also attached is the linker.prm file.
How do I tell the linker that I want it do create 19 records for the non-paged EEROM?
Thanks
John
Solved! Go to Solution.
You need to edit burner file (*.bbl).
You need to add following lines somewhere between OPENFILE command and CLOSE command.
len = 0x400
origin = 0x000C00
destination = 0x000C00
SENDBYTE 1 "%ABS_FILE%"
You may add these lines to make GLO, S19 or both files containing addresses origin..origin+len. But I think prog12z requires separate input files for flash and EEPROM. Unless thay changed something. For separate EEPROM file use your own set of open and close like this:
OPENFILE "%ABS_FILE%_EEPROM.s19"
format = motorola
busWidth = 1
SRECORD=Sx
len = 0x400
origin = 0x000C00
destination = 0x000C00
SENDBYTE 1 "%ABS_FILE%"
CLOSE
You need to edit burner file (*.bbl).
You need to add following lines somewhere between OPENFILE command and CLOSE command.
len = 0x400
origin = 0x000C00
destination = 0x000C00
SENDBYTE 1 "%ABS_FILE%"
You may add these lines to make GLO, S19 or both files containing addresses origin..origin+len. But I think prog12z requires separate input files for flash and EEPROM. Unless thay changed something. For separate EEPROM file use your own set of open and close like this:
OPENFILE "%ABS_FILE%_EEPROM.s19"
format = motorola
busWidth = 1
SRECORD=Sx
len = 0x400
origin = 0x000C00
destination = 0x000C00
SENDBYTE 1 "%ABS_FILE%"
CLOSE
Thank you,
Incorporating those statements into the burner file did indeed create a TrayControlUnit.abs_EEPROM.s19 file with not only the EEROM but flash segments.
I did try to find this information but I think a bit overwhelmed and had trouble even figuring out where to look.
Can you point me to the document that describes what you suggested? I'd like to learn what I did and why.
Thanks again.
John
Now if I could only figure out why the XF won't talk to CodeWarrier 5.1. P&E has been no help so far.
Hm, maybe you added that open-close block inside existing open-close block? I'm getting _EEPROM file with only EEPROM c00-fff data. See attached xdp512 bbl file.
It is documented in CW online help, also in CW root\Help\PDF\Build_tools_utilities.pdf. See Common 8/16bit Tools -> Batch Burner Language. PDF's can be more recent and complete.
I haven't used XF yet. Standard thing to try is to use P&E's unsecure_12 utility, which supports those new XE, XF, and others.
Thanks for the hint. After a bit of thinking about how the bbl file was structured I moved my OPENFILE just like you did in your attachment. I now have a separate S19 file with only EEROM data.
So far I've been able to read EEROM and create an S19 file from it using PROG12 and the FX. As yet programming doesn't work. But it's late. (2AM) so I think I'm not really totally awake anymore.
I'll try unlocking it although when locked I don't think it should be possible to read the data. Probably one more tiny detail.
I know with the EEROM I can't program bytes. It has to be done one 32 bit word at a time. Could very well be something like that. My Serial port monitor code I wrote can change EEROM bytes by reading, modifying and then writing the entire 32 bit long.
But clealy I've now created an S19 file with default data so this thread is done and time to start a new one with respect to the P&E FX issues. Thanks again for the links to the documents. I'll study them in the morning.
John