Problem running AN2295

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem running AN2295

ソリューションへジャンプ
13,334件の閲覧回数
feraro
Contributor IV

Hello.

I downloaded the project "AN2295_Kinetis" KINETIS K 100MHz. I try to run on my board with MK60DN512 in debugger mode, and when it enters the while (1) to await receipt of characters from the serial port, the debugger gives the error:

ARM Processors, AN2295_Kinetis.afx (Suspend)
Thread [ID: 0x0] (Suspended: Signal 'Halt' received. Description: User halted thread)
1 0xE0B003E8 (0xE0B003E8) () 0xe0b003e8

The project is the original Freescale. I'm using in my board the UART3 to conect with PC.

I've also noticed that when I run the program win_hc08sprg.exe attempts to detect the target, nothing is coming out the computer's serial port.

Someone can help me?. Thanks in advance.

Greetings.

Fernando

ラベル(1)
0 件の賞賛
返信
1 解決策
10,817件の閲覧回数
santiago_gonzal
NXP Employee
NXP Employee

Hello Ramon,

Please uncomment both defines, so in the file TWR_K60_cfg you should have:

# define KINETIS_MODEL K60_100MHz

# define KINETIS_K60_OM33Z


And change in bootloader_cfg.h the include to the correct one:


# Include "AN2295_TWR_K60_cfg.h"

//# include "AN2295_TWR_K60D100_cfg.h"

Now it should work.

Let us know if it solves your problem.

Regards,

Santiago

元の投稿で解決策を見る

0 件の賞賛
返信
38 返答(返信)
3,054件の閲覧回数
adrianlopez
Contributor I

Hi to all:

I try testing the software downloader for KINETIS KM34 , but not work ,

I need used the UART1 for dowload the bootloader

Thanks a lot

ADRIAN LOPEZ

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hi.


I also tried it and still not working.

The problem is that the board does not return the ack.


Could it be that the problem is in the calculation of the baud rate, using a 8 MHz oscilator?


Regards


Fernando

0 件の賞賛
返信
3,054件の閲覧回数
santiago_gonzal
NXP Employee
NXP Employee

Hello Ramon,

That shouldn’t be the problem, since the boot clock is configured to be the slow internal oscillator.

Are you using the same UART that is used in the TWR board to communicate with the PC application?

Regards,

Santiago

0 件の賞賛
返信
3,054件の閲覧回数
rabbit
Contributor III

Hello Santiago,

I check the registers, MCG_C1  = 0x04; MCG_C2 = 0x00, this means the K60 MCU runs the 32.768Khz internal slow clock,

but the source code define:

                                    #define BOOT_BUS_CLOCK (32768 * 640)

It doesn't work if I modify to #define BOOT_BUS_CLOCK 32768

Would you please explain why?

Regards

Sam

0 件の賞賛
返信
3,054件の閲覧回数
Gargy
NXP Employee
NXP Employee

Hello,

the reason is very simply. Yes there is no settings for the MCG module and the MCU is keep in default state after startup. Thi sis internal clock source 32KHz FLL enabled and the default FLL multiplier is 640.

So the startup BUS clock is 32768 * 640 = 20971520 Hz ~ 21MHz

Best regards

Petr

0 件の賞賛
返信
3,054件の閲覧回数
samz
Contributor I

Hi Petr,

Our system require the K60 MCU go to low power mode, send uart CMD to extra device to supply full power, then K60 go to normal to do bootloader function.

So after reset, I need make the K60 MCG go to FEI==> FBI ==>BLPI. After get full power, K60 MCG need go back to FEI again.

My question:  Which register control FLL multiplier?

                       Which register make the BUS_CLOCK connect to 32Khz FLL?

Regards

Sam

0 件の賞賛
返信
3,054件の閲覧回数
Gargy
NXP Employee
NXP Employee

Hello,

All these settings are in MCG module.

There is no simple answer that the register is this one and this one …

But the settings what are you talking about is here:

- Multiplier MCG_C4

And what you think by 32KHz FLL, there is just 32KHz internal clock source with bypassed FLL, and you can switch it by IRCLKEN.

But I recommend you study whole MCG and the right processes how to control Kinetis clocks.

Petr

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hi Santiago.

Yes, it is the same, use the UART3 and working properly. My applicaction on this board is using the same UART to communicate with PC.


Regards.


Fernando

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hello
I have seen that data is received by the UART3, but when the application sends, nothing comes through the port. In the tower running, but not on my board.



0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hello.
I think I've seen what the problem.


My board works in RS-485 and tower in RS-232, and the bootloader is not trying TX_ENABLED pin, being made ​​for RS232. To see how I can fix it.

Thank you very much for all the help provided.


Best Regards


Fernando

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hello.

When I load the application with the bootloader, win_hc08sprg.exe program, displays the following message:

WARNING! S19 image will not fit into available memory (at address 0x00000400)!

Changes made to the file intflash.lcf of my application are as follows:

Originally:

vectorrom (RX): ORIGIN = 0x00000000, LENGTH = 0x00000410
rom (RX): ORIGIN = 0x00000420, LENGTH = Const 0x0007FBE0 # Code + data
ram (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000 # SRAM - RW data
cfmprotrom (RX): ORIGIN = 0x00000410, LENGTH = 0x00000010

After the changes:

vectorrom (RX): ORIGIN = 0x00000000, LENGTH = 0x00000410
rom (RX): ORIGIN = 0x00004410, LENGTH = Const 0x0003BBF0 # Code + data (0x00040000 - 0x00004420)
ram (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00010000 # SRAM - RW data
cfmprotrom (RX): ORIGIN = 0x00000410, LENGTH = 0x00000010

Can anyone tell me how I can fix it.

Thank you very much.


Regards.


Fernando.


0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hello.

I changed the addresses to the following values:

vectorrom (RX): ORIGIN = 0x00004000, LENGTH = 0x00000410
cfmprotrom (RX): ORIGIN = 0x00004410, LENGTH = 0x00000010
rom (RX): ORIGIN = 0x00004420, LENGTH = 0x0003BBE0 # 0x00040000 - 0x00004400 # Code + Const data (0x00040000 - 0x00004420)
ram (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000 # SRAM - RW data

And now the message showing the win_hc08sprg.exe program is:

The S19 image redirected Also contains vectors. The automatic redirection is skipped now.

I program my application in memory and works properly.


But if I verify the memory, it display:

Can not read block 0 at address 0x00004000
Program memory failed.

This is normal???

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hello Santiago.

If I do the original linker file, displays the following message:

The S19 image redirected Also contains vectors. The automatic redirection is skipped now.
WARNING! S19 image will not fit into available memory (at address 0x00000000)!

  Memory programming block 0: W 0x00000000 0%
Can program block 0 at address 0x00000000
Program memory failed.


Regards.


0 件の賞賛
返信
3,054件の閲覧回数
santiago_gonzal
NXP Employee
NXP Employee

Hello Ramon,

Sorry for confusing you! The linker file in Kinetis devices must be changed: Have a look at sections 7.4 throung 7.9 of the Application note AN2295.

For MQX based applications, the advices are:

The following two things must be updated in the MQX project:

1. Linker File: In the linker file of MQX the situation is similar to bare metal user application. The

MQX application has to be moved above the AN2295 bootloader code. The MQX Linker file is

using as standard linker definition as own some. For example the updated lines from Linker file for

K60N512 and IAR6.4 tool:

• define symbol __ICFEDIT_intvec_start__ = 0x00004000;

• define symbol __ICFEDIT_region_ROM_start__ = 0x00004000;

• define exported symbol __INTERNAL_FLASH_BASE = 0x00004000;

• define exported symbol __VECTOR_TABLE_ROM_START = 0x00004000;

2. Flash configuration registers: The setting of the flash configuration registers is simpler in MQX

application than in general bare metal application. It is enough to define one MQX macro:

• #define BSPCFG_ENABLE_CFMPROTECT 0

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hi Santiago.

I had read this document, but i do not understand it. In my project, I just changed the addresses in the linker file.


vectorrom (RX): ORIGIN = 0x00004000, LENGTH = 0x00000410
cfmprotrom (RX): ORIGIN = 0x00004410, LENGTH = 0x00000010
rom (RX): ORIGIN = 0x00004420, LENGTH = 0x0003BBE0 # Code + Const data (0x00040000 - 0x00004420)
ram (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000 # SRAM - RW data


With these changes, I managed to program the application in flash on my board. When I boot the board, for a time, the bootloader transmits an 0xFC by the UART, as shown in the FC protocol, and if no response, my application starts. The only thing that does not work is, if once programmed the flash memory, attempt to verify, I get the message:

Can not read block 0 at address 0x00004000
Program memory failed.

And I do not know if that is normal or I'm missing something else.

Best Regards.

Fernando.

0 件の賞賛
返信
3,054件の閲覧回数
feraro
Contributor IV

Hello.

I have defined the constant BOOTLOADER_ENABLE_READ_CMD 1, but when I try to run from the program win_hc08sprg the commands
COMPARE, READ, BLANK CHECK or VERIFY do not work. shows me the message:

Compare Block 0: RD 0x00004000 0%
Memory is NOT CHECKED.

Know someone who may be because this?.


Best Regards


Fernando

0 件の賞賛
返信
3,054件の閲覧回数
Gargy
NXP Employee
NXP Employee

Hello,

this means that failed read command, but not that it read corrupted value.

I'm sorry for this issue, I work on the update of the master application that should fix this issue.

It will be released very soon, maybe next week.

Petr

0 件の賞賛
返信
3,054件の閲覧回数
santiago_gonzal
NXP Employee
NXP Employee

Hello Fernando,

You don't need to change the linker file in order to use AN2295 bootloader. It will process the S19 and flash it in the correct place of Flash memory.

Try with the standar linker file,please.


Regards,

Santiago

0 件の賞賛
返信