Kinetis K60 (mask 4N22D silicon release A) serial bootloader problem

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

Kinetis K60 (mask 4N22D silicon release A) serial bootloader problem

1,477 Views
lucaognibene
Contributor II

Hello everybody!

I'm very stuck with making working the present release (downloaded yesterday) of the serial bootloader AN2295 for Kinetis K60 on a custom board.

I'm using CodeWarrior 10.5 and the MCU is an MK60DN256VLL10 mask 4N22D.

In file bootloader_cfg.h:

#include "AN2295_TWR_K60D100_cfg.h"

In file AN2295_TWR_K60D100_cfg.h I set:

#define KINETIS_MODEL K60D_100MHz

#define KINETIS_FLASH FLASH_256K

#define BOOT_UART_BASE UART2_BASE_PTR

#define BOOT_UART_BAUD_RATE  57600

#define BOOT_UART_GPIO_PORT PORTD_BASE_PTR

#define BOOT_UART_GPIO_PIN_RX   2 

#define BOOT_UART_GPIO_PIN_TX   3 

#define BOOT_PIN_ENABLE_PORT_BASE  PORTE_BASE_PTR  

#define BOOT_PIN_ENABLE_GPIO_BASE  PTE_BASE_PTR  

#define BOOT_PIN_ENABLE_NUM        24  

#define BOOT_CALIBRATION_GPIO_BASE  PTD_BASE_PTR

Everything else is standard.

I always go into:

void Boot_ResetMCU(void)

I used the original LCF linker file and a modified one (the one I should use).

I the first case I go into reset immediately, while in the second case I go back to the beginning of __main() when I reach the line:

enableBootMode = 0;

Any clues?

Thanks for any help!

     Luca O.

Labels (1)
0 Kudos
Reply
5 Replies

1,151 Views
egoodii
Senior Contributor III

I don't know anything about the details of AN2295, BUT if it uses the Flash 'swap' mechanism I will just warn you that the Rev 'A' silicon had a COMPLETELY DIFFERENT bank-swap setup (which I much preferred, by the way).

0 Kudos
Reply

1,151 Views
lucaognibene
Contributor II

Thanks for the warning, but I think that the AN2295SW should take care of this since it has been written for (almost) the entire Freescale MCU families.

Thanks for the idea anyway!

Luca O.

0 Kudos
Reply

1,151 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Luca,

I searched AN2295SW project, just found the line of "enableBootMode = 1;", so I am wondering which version you downloaded, would you please help to clarify?

Untitled.png


Have a great day,
Kan

0 Kudos
Reply

1,151 Views
lucaognibene
Contributor II

Hello Kan!

Sorry for the very late reply, but I've been extremely busy on the application side of this project to fullfill the deadline for prototypes, and having the application code working with all planned functionalities.

The AN2295SW version used for the bootloader test is 9.1.67.0 (based on the changelog file found in the src folder): I think it's the most recent.

Regarding the enableBootMode = 0;

it's just the step in the main() function into bootloader.c where the program jumps to Boot_ResetMCU(), if with debugger I'll execute code step by step.

Of course it's just a variable initialization, and shouldn't create any problems.

I noticed that even commenting it, the problem is just "shifted" couple of lines later, on enableBootMode = 1;

But beside this thanks to your snapshot I'll probably found the problem.

I noticed that the debug configuration you are using is the K-1M 100MHz, while I always tried:

K60D100 (I thought should be ok for silicon release A)

or

K60 (for silicon release Z)

This has been also suggested by my FAE reference a few days later after my question.

The fact is that I didn't found any instructions/notes/readmes on which debug configuration to use: since I

#include "AN2295_TWR_K60D100_cfg.h"

I thought K60D100 debug configuration was ok.

The problem is that I needed to have my prototypes ready in time, so we switched the MCU to silicon Z, and I used the old working code for it.

Now that I have some time I'll try compiling and running the code on a board with an A silicon K60 to see if it works correctly.

I'll let you know the results.

Kind regards,

     Luca O.

0 Kudos
Reply

1,151 Views
lucaognibene
Contributor II

Hello!

One important update: tested the original AN2295 code and still no luck, but:

- in the board I'm working on, the MCU uses an external oscillator (50MHz)

- has a proper crystal connected on the low frequency 32kHz XTAL32 EXTAL32 pins

I know the bootloader uses the internal oscillator, but it is sufficient the 32kHz one to work properly or not?

Sorry if my question appears dumb.

Thanks for any help!

    Luca O.

P.S. Kan, regarding the bootloader code you were right: in fact the

enableBootMode = 0;

was related to a part of code I added (as an experiment) from my working K60 Z silicon bootloader code.

Messed up with too many tries in those days; anyway the problem remains (because of debug configuration and/or oscillator configuration).

0 Kudos
Reply