Programming MPC5604B via BAM

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

Programming MPC5604B via BAM

ソリューションへジャンプ
3,462件の閲覧回数
fscheidl
Contributor II

Hello,

I just finished building a custom PCB with a MPC5604B and now I'm trying to program the board/chip with the included Boot Assist Module. For this I am using the RAppID BL Tool included with the MPC5606B StarterTRAK. This works normally: Loading the Bootloader (1-100%), Erasing, Download the App (1-100%) and then shows "Complete".

 

So far so good, but the application does not seem to be stored to the flash, neither does it seem to be executing. To be precise, I attached a LED and a resistor to the PH9 pin, which, by default, has a weak pull up. So the LED should glow during startup/when the MPC5604B is not programmed. During the initialization, I am disabling the weak pull up of that pin like so:

 

SIU.PCR[121].R = 0x0000;

 

Still glows after the RAppID BL Tool shows "Complete". I cannot get the Lin-Module in UART mode or any other GPIO Output to work either. Is there something I have to consider when using the BAM Module for the first time? (The ABS and FAB pins are set accordingly, otherwise it would not download the code in the first place)

 

My setup is like this: I am powering the MCU from 5V, have all the decoupling capacitors for the power rails set up as outlined in the datasheet, have ABS and FAB pins shorted to 5V and GND, respectively. Then I connect my UART interface to pins PB[2] and PB[3] for TX and RX. During the serial download of the code, I get the echo back from the MCU.

 

Thank you very much in advance!

ラベル(1)
1 解決策
2,286件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

attached you will find *.mot file. It's just very simple toggling of PH9 which is working on my board. Could you try to load it to MCU? It uses internal RC oscillator. This will confirm if it is related to software or not.

Lukas

元の投稿で解決策を見る

11 返答(返信)
2,286件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

take a look at this thread:

https://community.freescale.com/message/623574#comment-623574

There's attached project for test purposes. Could you give this a try?

Regards,

Lukas

0 件の賞賛
返信
2,286件の閲覧回数
fscheidl
Contributor II

Thank you for the quick reply.

Do you by any chance have a test project for the MPC5604B (QFP64) at hand? I can get my program to work with the TRK-MPC5606B without problems.

0 件の賞賛
返信
2,286件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Try this one:

Example MPC5604B PinToggleStationery CW210

It may be necessary to change the PLL settings depending on your crystal frequency...

Lukas

0 件の賞賛
返信
2,286件の閲覧回数
fscheidl
Contributor II

I think I might know why my application won't start. Is it ok to let the RESET pin float or do I have to pull it up during regular operations?

At the moment, I have it floating. Before starting the BAM download, I just cycle the power to the whole MCU.

0 件の賞賛
返信
2,286件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

There's internal weak pull up resistor on RESET pin. It could be sufficient but for robust operation, I would recommend to add external pull up resistor 3k3 or 4k7 (10k, at least). You can add also small capacitance to filter the noise.

Maybe stupid question but once the code is loaded by BAM, have you reconfigured FAB pin back to logic "0", so the device boots from internal flash after next reset/power on?

Lukas

0 件の賞賛
返信
2,286件の閲覧回数
fscheidl
Contributor II

Hm, that's what I thought. Yes, I did reconfigure the FAB pin back to logic 0. But in my understanding, the application should start anyway after the BAM is finished, right? Reconfiguring the FAB pin should only be necessary after cycling the power/resetting the device?

0 件の賞賛
返信
2,286件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Yes, I can see in user manual for rappid bootloader that the bootloader should start the application once the code is loaded.

Have you disabled watchdog in your application? You can use this sequence:

SWT.SR.R = 0x0000c520;

SWT.SR.R = 0x0000d928;

SWT.CR.R = 0x8000010A;

Is the reset line toggling? Could you check that by scope?

0 件の賞賛
返信
2,286件の閲覧回数
fscheidl
Contributor II

Yes, I had the SWT already disabled in my application. The reset line is at GND during startup, then switches to VDD (5V) and stays there. I couldn't see any toggling after turning on with my scope.

I am using the RAppID Init software for the initialization code. The same settings (based on a different base configuration for the chip, naturally) work flawlessly on my MPC5606B StarterTRAK... This is bugging me.

0 件の賞賛
返信
2,287件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

attached you will find *.mot file. It's just very simple toggling of PH9 which is working on my board. Could you try to load it to MCU? It uses internal RC oscillator. This will confirm if it is related to software or not.

Lukas

2,286件の閲覧回数
fscheidl
Contributor II

Wow, this worked perfectly. Weird, that I couldn't get it to work with the RAppID Init... Would you mind uploading the project/source code for me to compare?

Thank you so much for this great support!

0 件の賞賛
返信
2,286件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Written in CodeWarrior 2.10...