"Flash Programmer" mistake

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

"Flash Programmer" mistake

3,499 Views
clovis
Contributor I

Hello,

I am working on TWR-K70F120M board, with CodeWarrior for MCU 10.5

I usually start from a bareboard project, with no processor expert, no MQX.

After several successful runs and debugs with a simple LED chaser program, I wanted to load the program so the board can still run after a reset (which is not the case in run mode).

I tried the CW option "Flash Programmer" -> "Flash File to Target". Then I selected my "ledchaser.elf" file and made an "erase and program" operation.

Now, when I try to load a program (even the counter default program) in debug or run mode, FLASH or RAM, I get no errors but nothing happens on the board.

In debug mode, I get :    no source available for "0x6576206C (0x6576206C)()".

So I would be able to run and debug bareboard programs (no RTOS) as before. I would also know how to write programs which not disapears when I reset.

Thanks in advance.

Labels (1)
0 Kudos
19 Replies

2,135 Views
_clovis
Contributor II

PROBLEM SOLVED :

With the "Debugger shell" I realized that the file loaded in the tower is not the right one (xml instead of binary).

As a result : memory protection register says that some FLASH addresses are write-protected and the tower is in secure mode.

All tries in codewarrior to mass erase the tower didn't led to a solution, so I had to buy a J-link.

with j-link commander, and just the "unlock Kinetis" command, my tower works again !

0 Kudos

2,135 Views
lakkimsetty
Contributor II

Hello.

In order to flash the code on to the boards flash memory, do I need to buy J-Link?

0 Kudos

2,135 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

If you want to unlock the chip, you can purchase a J-Link debugger tool.

Thank you for the attention.


Have a great day,
Ma Hui

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

0 Kudos

2,135 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

If it is possible, you could upload that "LED chaser program" with thread. I could test that code with TWR-K70F120M board here.

In general, please select the correct target (Flash) and related ".elf" file to program the Flash.

Thank you for the attention.

0 Kudos

2,135 Views
admin
Specialist II

Hello,

here is the code...

(by the way, I had to change my account because of a website-login failure)

Regards

0 Kudos

2,134 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

I record a video file about how to use [Flash file to target] tool, after I flash LED_chaser.elf file to TWR-K70F120M board, it works as expected.

Wish it helps.

B.R.

Ma Hui

0 Kudos

2,132 Views
_clovis
Contributor II

Thanks for your video !

I've carefully followed your instructions. Unfortunately I get the following message :

downloading 0x000001E8 bytes to be programmed at 0x00000000 

Executing program .... 

Error:  Program failed.  Flash driver reports the following error(s): The flash device algorithm was interrupted during execution.

Please check if the flash base address is correct or if there are any flash devices mapped inside the selected memory space.

If a custom target initialization file was used then check the following parameters: flash base address, flash bank size and flash

bank port size.

Please enable Verify Target Memory Writes in Target Configuration to check that the algorithm downloads correctly. If you are down

loading the algorithm to DDR try checking your DDR configuration.

Error: Program failed. Flash driver reports the following error(s): The flash device algorithm was interrupted during execution.

Please check if the flash base address is correct or if there are any flash devices mapped inside the selected memory space.

If a custom target initialization file was used then check the following parameters: flash base address, flash bank size and flash

bank port size.

Please enable Verify Target Memory Writes in Target Configuration to check that the algorithm downloads correctly. If you are down

loading the algorithm to DDR try checking your DDR configuration.


When using Run or Debugger with RAM option, the program is loaded but not executed (and debug says that no source is available)

When using Run or Debugger with RAM option, CodeWarrior is stuck at 99% with "loading to target"

same results on other computers with new workspace, new bareboard project

Best Regards

Clovis

0 Kudos

2,132 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Have you tried to use CW MCU V10.5 software to create a new project based on TWR-K70F120M board with [new project creation Wizard], Could you debug that new created project?

0 Kudos

2,132 Views
_clovis
Contributor II

Is there any chance that code or settings on the tower have been deleted during flash erase/program process ?

If it's the case, is a factory reset still possible ?

0 Kudos

2,132 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Please check attached video file about how to mass erase K70 Flash.

The flash program algorithm target RAM address need be 0x1fff0000, size 0x4000.

Wish it helps.

0 Kudos

2,129 Views
_clovis
Contributor II

Thanks for the video

It's OK for the mass erase process. After that, nothing seems to change : I get the same errors as before.

And if I add a blank-check after the erase task, i get two "blank check failed" errors, with no more precisions.

I've tested new basic projects on several computers with different configurations, and get the same errors. So the problem is apparently the Tower itself.

Someone had the same problems with another board :

Kinetis k40x256 stuck at downloading binary to target

0 Kudos

2,131 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

There is on board OSJTAG at TWR-K70F120M board, please check below link to update the latest OSJTAG driver on your PC.

P&E Microcomputer Systems

And if you have another debugger tool, could you have a try with that TWR-K70F120M board, such as Segger J-Link?

If there still with problem to debug the TWR-K70F120M board, I think there could exist hardware problem on your TWR-K70F120M board.

You could submit a tool warranty request with below link:

Returns and Warranty Information

While, I still suggest to check the OSJTAG driver and try another debugger tool at first.

There with very tiny probability to get a broken board.

Wish it helps.

0 Kudos

2,131 Views
_clovis
Contributor II

My OSJTAG is up to date and I have no J-link debugger for the moment.

Someone in my team ended up with the same issue on its TWR-K70120M by doing the following steps (Windows XP SP3 ; CW for MCU 10.5 ; OSJTAG 31.21) :

  - Build a new project in FLASH configuration. Choose "Flash File To Target" option on the blue lightning button.

  - Without touching anything else, choose the ".project" file as File to Flash. (I did the same way at the first time)

  - Make an "Erase and Program"

  - obviously that didn't work, so make an Erase Whole Device

  - Try to perform an "Erase and Program", with the right .elf file selected

So we have two TWR with the same symptoms.

I will contact the warranty service. Thanks for your help

Best Regards

0 Kudos

2,133 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Have you tried to debug the Flash target code? There still with similar problem?

0 Kudos

2,133 Views
_clovis
Contributor II

Yes, we still having trouble with debugging in FLASH configuration : The process is stuck at "Downloading binary to target..." (99%)

If that helps : when I'm plugging the tower to USB port or when I manually reset the tower, the RESET LED is ON (with less intensity than for a manual reset). After a download try, the LED is OFF.

I can't remember if this behaviour was the same as in a wealthy TWR.

Apart that, where can I find a list of compatible debuggers for the TWRK70F120M ?

Best Regards

0 Kudos

2,133 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

My TWR-K70F120M board with the same behavior (RESET LED is ON (with less intensity than for a manual reset). After a download try, the LED is OFF. ).

When you debug the code, if there error info popup when the process is stuck at "Downloading binary to target..." (99%)?

Customer can select below debugger tool for TWR-K70F120M:

Segger J-Link: http://www.segger.com/jlink_base.html

P&E Multilink Universal: http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320137

Wish it helps

B.R.

Ma Hui

0 Kudos

2,134 Views
_clovis
Contributor II

No error popup or console message appears when CW is stuck at downloading,

Best Regards

0 Kudos

2,134 Views
_clovis
Contributor II

Hello,

I'm using CW for MCU 10.5 with last updates, but the Wizard assistant does not proposes TWR-K70F120M derivatives. I'm just able to choose the K70FN1M0 processor.

A new project (no Processor Expert) leads to the same problems in RUN, DEBUG, and Flash Programming.

(attachment shows the available devices in project wizard)

Best Regards, Clovis

0 Kudos

2,134 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Clovis,

There is no TWR-K70F120M board for CW V10.5 new project creation wizard, you select [MK70FN1M0] device is quite correct.

Ma Hui.

0 Kudos