AnsweredAssumed Answered

S08 PA4 not programming TRIM, address is blank

Question asked by Carl Norman on Feb 6, 2016
Latest reply on Feb 15, 2016 by Carl Norman

Hi Guys,

 

Why is there no log of the address that the TRIM values are being programmed to, see below log:

----------------------------------------------------------------------------------------

Starting 3rd party flash programming...

GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : STARTUP, Entry : SPECIFY_NETWORKCARD_ENABLED, Value : 0, R) => DI_OK

INF: Copyright 2012 P&E Microcomputer Systems,Inc.

INF: Command Line :"C:\Freescale\CW MCU v10.6\eclipse\..\MCU\bin\de.exe" -noni -language en -ORBendPoint giop:tcp:127.0.0.1: -ORBtraceLevel 0

INF: CMD>RE

INF: Initializing.

INF: Target has been RESET and is active.

INF: CMD>CM C:\Freescale\CW MCU v10.6\MCU\bin\Plugins\support\hc08\gdi\P&E\9s08pa4.s8p

INF: Initializing.

INF: (Recommended TRIM=$0086,FTRIM=1)

INF: (Bus Freq = 16776KHz)

INF: Initialized.

INF: ;version 1.02, 01/24/2014, Copyright P&E Microcomputer Systems, www.pemicro.com  [9s08pa4]

INF: ;device freescale, 9s08pa4, All

INF: ;begin_cs

INF: Loading programming algorithm ...

INF: Done.(FCDIV=$90)

INF: CMD>EM

INF: Erasing.

INF: Module has been erased.

INF: CMD>PM

INF: Programming.

INF: Processing Object File Data ...

INF: .

INF: Programmed.

INF: CMD>VC

INF: Verifying object file Checksum16+CRC8 to device ranges ...

INF:    block 0000F000-0000F8B5 ...

INF: Ok.

INF:    block 0000FA00-0000FA85 ...

INF: Ok.

INF:    block 0000FFB4-0000FFB5 ...

INF: Ok.

INF:    block 0000FFCE-0000FFCF ...

INF: Ok.

INF:    block 0000FFE2-0000FFE3 ...

INF: Ok.

INF:    block 0000FFFE-0000FFFF ...

INF: Ok.

INF:    Checksum Verification Successful. (Cumulative Checksum16+CRC8=$F757CA)

INF: CMD>PT

INF: Programming Trim value $86 to location $ 

INF:  Success.

INF: Programming FTrim value $01 to location $ 

INF:  Success.

INF: CMD>RE

INF: Initializing.

INF: Target has been RESET and is active.

 

 

Executing download task: C:\Users\carln\workspace\HCT4ULPA_04/Project_Settings/Debugger/MC9S08PA4.tcl

----------------------------------------------------------------------------------------

 

This is what I normally do with all my other S08 projects:

 

volatile byte __far NV_ICSTRM_FAR @0x0000FFAF;  

volatile byte __far NV_FTRIM_FTRIM_FAR @0x0000FFAE;

 

...

if((NV_ICSTRM_FAR == 0xFF) || (NV_ICSTRM_FAR == 0x00)) while(1);     //WAIT HERE ON ERROR, PRODUCT WILL APPEAR "BRICKED"

...

 

Ok so I just realised for some reason which I cannot understand they have moved the TRIM values to these locations (just by checking the memory table int he debugger and searching for the values 0x86 and 0x01 and found them here:

 

volatile byte __far NV_ICSTRM_FAR @0x0000FF6F;  

volatile byte __far NV_FTRIM_FTRIM_FAR @0x0000FF6E;

 

I have also just realised that the chip now magically loads these factory values on boot.

 

Questions:

- Why move them from the last used space which is where they are on everything else?

- Where is this documented as I spent an hour on this on my day off. I searched the reference manaul for FF6F and FF6E and find nothing, i searched the headers and find nothing, i searched all the programmer options and settings and found nothing allowing you to change the address

- Can I manually change this address to where I want to it to be?

- The "Factory programmed" values are now loaded automatically on boot by some internal processor magic. I checked these values against the programmed trim values and they are significantly different, the factory value is 0x0801 and the above is 0x0861. They are they so far off each other?

Outcomes