More MC9S12C64 flash burner questions

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

More MC9S12C64 flash burner questions

跳至解决方案
1,806 次查看
roberthiebert
Senior Contributor I

I thought I had the flash burner routine solved but when I inserted my working test code into my main program it wouldn't work. So, I went back to my test program and found that it was limited in what I could burn back. I wrote another test program that uses the same number of configurable constants as my main program. I found that it would erase the sector just fine, but I couldn't get it to burn any more than 256 bytes. I'm kind of at a loss to explain why. Any suggestions would be greatly appreciated.

Regards,

Robert

0 项奖励
回复
1 解答
1,718 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

look into attached code.

1) label "<<<<<<<<<<<<<<<<<" is asking you for your code regarding error processing.

2) read the code carefully to understand also notes. The flash is written once and then in loop...just as an example. You can add more command for processing if you want.

3) When debugging you should set:

 

image.png

4) Do not visualize written part of memory in memory window while E/W because debugger is reading the memory and reading while writing is not allowed.

 

5) Tested, working.....Now, you must be able to do it!!!

 

Best regrads

Ladislav

 

在原帖中查看解决方案

0 项奖励
回复
7 回复数
1,719 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

look into attached code.

1) label "<<<<<<<<<<<<<<<<<" is asking you for your code regarding error processing.

2) read the code carefully to understand also notes. The flash is written once and then in loop...just as an example. You can add more command for processing if you want.

3) When debugging you should set:

 

image.png

4) Do not visualize written part of memory in memory window while E/W because debugger is reading the memory and reading while writing is not allowed.

 

5) Tested, working.....Now, you must be able to do it!!!

 

Best regrads

Ladislav

 

0 项奖励
回复
1,697 次查看
roberthiebert
Senior Contributor I

Hi Ladislav,

Thanks very much for the attachment. I was able to load it into my controller and run it. I believe I understand what it does. Excellent work!

I notice that the program was written in relocatable assembler. I'm not familiar with that and my programs are written in absolute assembler. I'll have to see how I can integrate the parts of your program that I need into my absolute assembler program.

Regards,

Robert

0 项奖励
回复
1,514 次查看
roberthiebert
Senior Contributor I

Follow up:

Thanks to Ladislav's suggestions and code examples I was finally able to solve this coding problem I've been working with on several projects for well over a year now. I was able to get, out of his latest example, the portions I needed and convert them to absolute assembler. Then I was able to integrate them into my main program. The erase and burn routines work perfectly.

No matter how much I studied the reference manual and code examples from a couple of books,  I just could not get it right. Now I have it and owe Ladislav a great debt of thanks. I couldn't have done it without him.

Regards,

Robert

0 项奖励
回复
1,774 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

the Sw you attached is S12ZVMC. The device you mention is S12C .... absolutely different families.

BTW, I created a simple project (attached) and it works without any issues. I am not able to make your project alive. Please check also your license and limitations here....

https://www.nxp.com/design/design-center/software/development-software/codewarrior-development-tools...

 

 
 

 

Best regards,

Ladislav

 
 

 

 

0 项奖励
回复
1,755 次查看
roberthiebert
Senior Contributor I

Hi Ladislav,

Now I am really confused. I am using the free version of Code Warrior. CW 5.9.0 build 5294. From the link you sent it says it will accept unrestricted assembler. I see no restrictions on flash burning. When I created the project that I attached last time I went to:

New project -> Select derivative (MC9S12C64) -> connection (USBDM) -> Language (absolute assembly) -> Add existing files (BurnerTestv4.asm) ->Rapid Application (none).

In the Select derivative I see no mention of S12ZVMC.

Just in case, I followed the same path to created a new project which I am attaching the zip file for.

I couldn't open your attachment because I couldn't find an MCP file for it.

Also, as I mentioned, I am not fluent in C so if you can help me with this it pretty well has to be in assembler only.

Thanks 

Robert 

0 项奖励
回复
1,737 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

my fault, I mixed answers.

I would like to ask which part of the flash you want to E/W. If you need only small part then I suggest to select some part of near flash. (4000-4FFF, C000-FFFF) It will solve issue with paging.

Easier for me is to create example than fight with each issue.

I will remove incorrect part of our communication from this thread.

So, what is exactly your task.

Best regards,

Ladislav

0 项奖励
回复
1,716 次查看
roberthiebert
Senior Contributor I

Hi Ladislav,

Thanks again for taking the time to answer my question. Yes, I can fit what I need into near Flash. (Unpaged Flash?)

My code is from $C000 to $D8F2, 6,226 bytes by my reckoning. It may expand in future but not much. The only time this code is changed is when I do a code revision, it never gets changed on the fly.

My configurable constants are from $4000 to $424C (588 bytes) They may expand in future but certainly never anywhere near $4FFF. (4,095 bytes maximum available, I think.)

In my program the configurable constants from $4000 to $424 C are copied to RAM at start up where the program accesses them. They can be modified there and burnt back to Flash in the program if necessary.

Does that answer your question?

Regards,

Robert

Reqards,

Robert

0 项奖励
回复