FRDM-KL25Z with Serial bootloader halts on reset

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

FRDM-KL25Z with Serial bootloader halts on reset

1,252 Views
allgood38
Contributor I

Hello,

 

I'm currently using the serial bootloader available here:

 

http://mcuoneclipse.com/2013/04/28/serial-bootloader-for-the-freedom-board-with-processor-expert/

 

It does exactly what I need, and loads the program no problem, however, after it resets, the debugger halts. When I press the resume button, the program exectes exactly as it should. Specifically, this is what I see when it halts:

 

19912_19912.png2015-02-16 11_54_07-Debug - Source not found. - CodeWarrior Development Studio.png

 

It seems to halt right at the program entry point. I am using Codewarrior 10.6 and the P&E Micro OpenSDA debugging unit that comes with the development board.

 

Any help would be appreciated. I can post more information if it would be useful, is there an easy way to export debugging settings?

 

I have already checked the "Run out of reset" box and unchecked the setting for creating a breakpoint on entry.

 

Thanks,

 

Stephen

Labels (1)
Tags (2)
0 Kudos
4 Replies

737 Views
allgood38
Contributor I

Okay, so I've made some progress, and may have determined the cause, I'm still checking it out now.

With regards to having the debugger disconnected: After the bootloader finished loading the program and restarts, nothing happens (program hangs), presumably because it has managed to hit a breakpoint? When the bootloader is connected, I can press resume and everything functions as expected.

>    - loader has not disabled peripherals/interrupts that were used and this causes the application a problem the first time it runs

I don't think the interrupts were disabled in the original bootloader, although I did switch over all the components to polling mode.

>    - application not handling the watchdog correctly (I have seen watchdog code that works out of reset but not after a bootloading phase - eg. Teensy Arduino code)

I'm not sure, I've disabled it, do you think it may have become re-enabled? However, before I try anything more I've managed to get it to reset without halting:

I tried flashing the binary (without starting a debugging session) for the bootloader application, then got the bootloader to install an example application that came with the serial bootloader, and it worked. After looking through the build settings for each application, I realized I had left semi-hosting enabled on the problem application :smileysilly:

2015-02-17 10_51_27-Properties for BL_app1.png

At the moment I'm assuming this would be the cause of the problem, I will post again later if this is indeed the problem.

0 Kudos

737 Views
mjbcswitzerland
Specialist V

Stephen

Please see http://www.utasker.com/kinetis/FRDM-KL25Z.html

This is a loader for your board with serial (SREC or KBOOT), USB (KBOOT HID or USB-MSD) or SD card (needs a socker connected).

There are applications that can be loaded for reference.

If this or any other boot loader doesn't operate with an application  it is likely due to the fact that the application is not set up to be able to operate at the load address. The following gives some ideas

- http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF

- Using the uTasker Serial Loader with Teensy 3.1 Arduino/Teensyduino applications (guide for operating Arduino applications with boot loader)

You can also consider using the uTasker application since it is compatible with the loader and contains many features for your board, as well as the ability to simulate it. It works out-of-the-box with CW (loaders and application), is completely free for non-commerial use, and has fast-track support in this forum.

Regards

Mark

Kinetis: µTasker Kinetis support

KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos

737 Views
allgood38
Contributor I

Hi Mark,

Thanks for the information. The uTasker project looks really interesting, it’s something I will keep in mind for the future.

For now though, I would really like to find out why the application is halting. The application is set to run at an offset of 0x4000 in flash, and I can verify that the Vector table offset register reflects this (the vector table is relocated to 0x4000). The bootloader appears to be operating correctly, it’s just that it halts as if encountering a breakpoint, and needs to be told to resume. Once it resumes, everything runs great.

0 Kudos

737 Views
mjbcswitzerland
Specialist V

Stephen

What happens when you don't work with a debugger connected? It may be that the loader is commanding a reset before jumping to the application, which would cause the debugger to pause.

Other potential difficuties are:

- loader has not disabled peripherals/interrupts that were used and this causes the application a problem the first time it runs

- application not handling the watchdog correctly (I have seen watchdog code that works out of reset but not after a bootloading phase - eg. Teensy Arduino code)

Otherwise you will need to either ask for help at the original tutorial or else debug until you find the problem if the source is not supported.

Regards

Mark

Kinetis: µTasker Kinetis support

KL25: µTasker Kinetis FRDM-KL25Z support / µTasker Kinetis TWR-KL25Z48M support

For the complete "out-of-the-box" Kinetis experience and faster time to market