Bootloader problem - changing lcf file causes failure

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

Bootloader problem - changing lcf file causes failure

1,979 次查看
Cdn_aye
Senior Contributor I

  Hi

I am using AN4368 to create a bootloader for our app which is supposed to read a new image off the flash drive.

I can get that to work. I modified the initflash.lcf, rebuilt the bsp, psp, usb, mfs libraries, then my app. I also changed user_config.h so that the the vectors are moved to ram;

#define MQX_ROM_VECTORS                           0

This worked according to xMAP; they are at

  1FFF8000 00000418 .vectors_ram ram_vector(bsp_twrk40x256_d.a vectors_c.o    )

   vectorrom   (RX): ORIGIN = 0x0010000, LENGTH = 0x00000400

   cfmprotrom  (RX): ORIGIN = 0x0010400, LENGTH = 0x00000020

   rom         (RX): ORIGIN = 0x0010420, LENGTH = 0x0003FBE0  # Code + Const data 

   ram         (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00010000  # SRAM - RW data

The problem is that the debugger in CW10.3 gives the following message

0xFFFFFFFE (0xFFFFFFFE)()

No source available for "0xFFFFFFFE (0xFFFFFFFE)()"

The system will not boot and we can't run or debug anything. If we poweroff to boot, the system fails.

If I put the lcf linkage areas back to 0x0000_0000 and rebuild everything, the app works fine, except we can't use the bootloader then.

This is using MQX 3.8.1, CW10.3 for the Kinetis k20dx256z VLL7

Has anyone experienced this, or know how to correct this?

Thanks

Robert

0 项奖励
回复
3 回复数

901 次查看
c0170
Senior Contributor III

Hello Robert Lewis,

you already asked for this kind of information in mcueclipse blog, but did not hear from you afterwards. I believe that following post did not solve the issue : Adding Symbols to the CodeWarrior Debugger | MCU on Eclipse ??

Are you using any flash task in CodeWarrior?

Regards,

MartinK

0 项奖励
回复

901 次查看
Cdn_aye
Senior Contributor I

Hi Martin

No that did not fix the problem. The system is crashing, it will not boot because the image loaded by CW seems to be wrong or at the wrong place. Therefore when it picks up the sp and pc, it gets all F's, so it doesn't boot.

Thanks for replying

Regards

Robert

0 项奖励
回复

901 次查看
nicholasf
Contributor III

Hello Robert,

Please forgive me if I misunderstand the situation, but I will try to summarize what I understand of the situation, and point out what seems to me to be the most likely issue.

It seems that you have relocated your application in flash, and configured the LCF correctly.  You can connect to the device (using a debugging tool), and download your application; it runs well, but after you turn the uC off, it does not run again.

If this is correct, and it is the case that you have not loaded another vector table to flash location 0x00000000, I think the problem is that when the processor starts up, it always looks at location 0x00000000 for a vector; if that location is blank (0xFFFFFFFF), it goes to an invalid memory location, and crashes immediately.  What you have to do in this case is one of two things:


1) compile your bootloader, convert it to a binary, and include it in your project (with its vector table beginning at location 0x00000000).  This is what you will probably have to do when you compile your program for production, and doing this now will make debugging much easier.

2) locate your main application at memory location 0x00000000 (by changing "vectorrom   (RX): ORIGIN = 0x0010000, LENGTH = 0x00000400" to "vectorrom   (RX): ORIGIN = 0x0000000, LENGTH = 0x00000400"), which will facilitate debugging for now, and will not depend on your bootloader.


If my assumptions were incorrect, please correct me, so I can be of greater assistance.  I have a great deal of sympathy with you, as I have had every possible problem with bootloaders, and I hope that I can help you avoid going through the same pain I did.

Sincerely,
Nicholas F


EDIT: I responded to this post without realizing it was a dead thread, and that the user has either long since fixed the problem or given up.  My apologies for reviving an old question.

0 项奖励
回复