Can debug target but cannot load to flash

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

Can debug target but cannot load to flash

Jump to solution
1,261 Views
MikeM
Contributor III

I'm using CW 10.6.4 for the MC9S08DZ32 MCU connected via multilink to a prototype board. I can download the .abs file to the board and debug all day long. But when try to load the flash .s19 file using the "Flash File To Target" window, it seems to go alright and doesn't report any errors but when I reset the target board, it does not run.

Labels (1)
0 Kudos
1 Solution
1,041 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Mike,

If use Codewarrior, "if you want to program TRIM values with FSL flash programmer you could do it by applications which  means you should declare some global variables at those address and initialize them with proper values." This means you need define trim value as const data in s19 file. and program trim value with s19 file via Flash file to Target tool.  You can define global const variable at 0xffaf as below:
const byte NVMCGTRM_INIT @0x0000FFAF = <trim value>;
 
how to know the <trim value>? the method is: programming via debugging feature instead of NXP's simple flash programmer. Within the debug configuration, there is an advanced programming option where the customer can set the frequency they want and TRIM is automatically calculated. Then in debugger, read back the value in address 0x0000FFAF. This value is the <trim value> we need to write to global const. If the customer is only prototyping, then the CW option probably is easiest. If the customer is only prototyping, then the CW option probably is easiest. But if they are programming multiple chips, then it may be easier for them to use PROG software since starting a new debug session every time just to program the chip can be time consuming.
http://www.pemicro.com/products/product_viewDetails.cfm?product_id=27
 
 
to summary, We can only use debugger to perform trim but can’t with CW standalone programmer in the same way.
This problem has been discussed a lot in your Freescale support team, Development team and PM. CW is a professional development tool(edit, built, debug), but not professional standalone programmer. If user need advance feature in standalone programmer, we need other 3rd programmer software as I suggest above. thanks for your understanding.
 

Not sure why "Attach" button is grey on your side. please create a new project with wizard and see if this is a common issue for all your project or just for a specific project.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

4 Replies
1,041 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

0. first I suggest you check this problem is in one specific project or a common issue for all project. create a new project with wizard, then just add code of toggle a led. then test if this new project can work normal with both of the program method?

1. In CW10, we can download code to flash via debugger or Simple Flash. One difference is that debugger can do clock trim but simple flash can't. please check if your program need accurate trim value.

I know some customer's program can not work normal if using simple flash because trim setting is not correct. please check this point.

2. please check if the code is correctly programed into the flash after simple flash burning file. you can check flash content with CW "attach" to launch debugger, then check content in memory window.

pastedImage_1.png


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,041 Views
MikeM
Contributor III

Thank you for your reply. The clock trim issue sounds like a possible solution but how do I correct that? BTW, my "Create, manage, and run configurations" window shows the "Attach" button greyed out and I cannot select it.

0 Kudos
1,042 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Mike,

If use Codewarrior, "if you want to program TRIM values with FSL flash programmer you could do it by applications which  means you should declare some global variables at those address and initialize them with proper values." This means you need define trim value as const data in s19 file. and program trim value with s19 file via Flash file to Target tool.  You can define global const variable at 0xffaf as below:
const byte NVMCGTRM_INIT @0x0000FFAF = <trim value>;
 
how to know the <trim value>? the method is: programming via debugging feature instead of NXP's simple flash programmer. Within the debug configuration, there is an advanced programming option where the customer can set the frequency they want and TRIM is automatically calculated. Then in debugger, read back the value in address 0x0000FFAF. This value is the <trim value> we need to write to global const. If the customer is only prototyping, then the CW option probably is easiest. If the customer is only prototyping, then the CW option probably is easiest. But if they are programming multiple chips, then it may be easier for them to use PROG software since starting a new debug session every time just to program the chip can be time consuming.
http://www.pemicro.com/products/product_viewDetails.cfm?product_id=27
 
 
to summary, We can only use debugger to perform trim but can’t with CW standalone programmer in the same way.
This problem has been discussed a lot in your Freescale support team, Development team and PM. CW is a professional development tool(edit, built, debug), but not professional standalone programmer. If user need advance feature in standalone programmer, we need other 3rd programmer software as I suggest above. thanks for your understanding.
 

Not sure why "Attach" button is grey on your side. please create a new project with wizard and see if this is a common issue for all your project or just for a specific project.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,041 Views
MikeM
Contributor III

Thanks for all your help. I wish you could TeamView my computer and just show me :-) but you were a great help and thank you very much.

0 Kudos