MPC5748G LIN0 boot

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

MPC5748G LIN0 boot

Jump to solution
6,168 Views
alexvinchev
Contributor V

Hi,

does somebody has already experience (which could be shared here) how to boot/flash MCU through LIN0, which tools to use for this, etc.

I'm also interested in implementation of DCF update mentioned here: "57.4.8.5 SER_BOOT_CBACK – BAF serial boot DCF client". There are specific memory regions (UTEST and BAF) in the description, so I would like to have advice how to update them.

 

I'm using GreenHills 6.1.6 for building and Lauterbach fro flashing/debugging.

 

Regards,

Aleksandar

Labels (1)
1 Solution
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Aleksandar,

and what about Rappid bootloader? It could save a lot of effort:

https://www.nxp.com/webapp/Download?colCode=RAPPID_BOOTLOADER_UTILITY

Lukas

View solution in original post

20 Replies
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Aleksandar,

Rappid bootloader supports only RBF (flash algorithm) in case of MPC57xx devices:

pastedImage_0.png

That means it is flash resident bootloader and it must be loaded by JTAG:

pastedImage_1.png

This solution was used because BAF serial boot does not start execution if valid boot header is present in flash.

Regards,

Lukas

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

lukaszadrapa​, I've flashed the RBF file to all kinds of MCUs, listed above. On CUT1 (0N65H) MCU it does nothing. On CUT2(1N81M) MCU it lits DS2 LED (PG2 pin).

In all cases, RAppID BL Tool doesn't connect (again) to the MCU.

mem (0xF8C000--0xF8E15F).bin file contains flash contents after flashing. You could compare it with the RBF file to see if it is what is expected. (it is, I've already verified).

Apart of the actual topic, I'm wondering why I should use RAppID BL Tool if I have JTAG to flash the MCU? What is the interest to do this? To use BAF to flash MCU is useful, because avoids JTAG usage, but if I connect JTAG what is stopping me to flash entire MCU, why do I need one more tool (RAppID BL)?

0 Kudos
Reply
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

It works on my side:

1. I loaded RBF s-record to flash:

c:\Freescale\RAppIDBL\RBF_Files\MPC5748G.rbf

2. There's virtual serial port on the EVB board. Connect USB cable and make sure the drivers are installed properly:

pastedImage_0.png

3. Run GUI and configure:

pastedImage_1.png

I used some s-record file which does not overlap with the rappid bootloader.

There are two COMs for virtual serial port - COM 20 and COM 21 in my case. I had to select the second one to make it working.

4. Then I clicked on Start Boot Loader and it passed.

5. I checked the content of flash using debugger and I can see that the s-record file is loaded correctly.

4,677 Views
1506840872
Contributor II

Hi, Lucas

When using S32 DS to flash the *.rbf file into the flash , shall I use the openSDA or multilink(JTAG)?

Thank you

0 Kudos
Reply
4,677 Views
1506840872
Contributor II

Hi, Lukas.

I have devkit-mpc5744p now, but I wonder how to flash the RBF file to MCU.

Could you please teach me?

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

Hi Lukas,

I confirm, this works (communicates).

Now, I would like to ask the following question: How with the documentation provided I'm supposed to figure out that I should use LinFlex2 instead of LinFlex0 (no word about RAppidBL_UserManual.pdf and ReleaseNotes.pdf regarding LinFlex2)? Which also brings us to one of my initial questions: "How to boot/flash MCU through LIN0?". LIN0 & LIN1 are the only LinFlex ports, which support DMA (as far as I could remember from MPC5748GRM document) and thats why they will be routed and used for LIN communication, not the LinFlex2 port.

0 Kudos
Reply
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

That's very good point. It seems this is not clearly stated in Rappid bootloader documentation. They obviously used EVB board for development, so that's the reason why they selected LINFlex2 as interface.

If you want to use BAF serial boot mode, LINFlex0 must be used:

pastedImage_0.png

pastedImage_1.png

Lukas

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

Cool, and not the pins, used on EVB for LIN0, but pins for CAN0 :-) This could explain my observation that LIN0 seems to be uninitialized... Thank you! You save me lot of time!

0 Kudos
Reply
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Let me check that. I will try it on my board - I will let you know later.

Rappid bootloader is used to be able to update firmware in the field without JTAG. It is typical example of flash resident bootloader. Simple example: you have several ECUs in a car and you want to update firmware in some of them. For car service, it is much easier to use diagnostic interface. If an ECU is connected via CAN, you can easily update firmware via CAN. You do not need to search for the ECU in car, you do not need to use expensive JTAG device, you do not need to reconfigure pins (like FAB and ABS on MPC56xx) - just use the diagnostic tool...

Lukas

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

Oooook... Actually, rapid bootloader is something similar to the code I'm going to do now, but I'll extend its functionality to work with LAN as well...

Initially I was searching for something, which is usually called bootstrap loader, in order to use it at production line, since it is already in the MCU and is easier to attach 3 lines for serial link instead of 6-7 for JTAG. I believe in case of MPC5748G this bootstrap is BAF and I've mistakenly assumed that RappID is this bootstrap. I don't mind to develop program to communicate with BAF, but I'm having difficulties to find BAF communication protocol in case of serial loader. If you can just point the right documents (even available under NDA) I can talk with someone from the supply channel to get them, since we already signed NDA with Freescale. Is there any source code of the RBF file, which could be shared, will be very helpful for my development?

Lukas, I really very much appreciate your effort, spent on the subject.

0 Kudos
Reply
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

BAF communication protocol is extremely simple:

pastedImage_0.png

In other words, the BAF just helps to load your bootloader image to RAM memory. Just send password, start address of image, VLE bit + size if image and then the image. BAF will send echo for each character to confirm that everything works fine. Once all data are loaded, the image is executed. The start address (sent in step 2 of the protocol) is supposed to be entry point of the image.

That's all you can do with BAF in serial mode. Everything else is a matter of your application (downloaded image). The application is then responsible to load data from somewhere (usually also from serial interface) and program them to flash.

Take a look at this thread:

https://community.freescale.com/thread/320166#386416

I described here how to create RAM image which will be loaded by BAM. The description is written for MPC56xx family but the principle is still the same for MPC5748G.

Lukas

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

Hi Lukas,

I'm glad to tell that I've successfully booted MCU thru ram image, loaded via BAF.

Thank you very much for your help on the subject!

0 Kudos
Reply
4,677 Views
balachandrakuma
Contributor I

Hi Alexander Vinchev,

I came across this forum seeking some info to boot the device via RAM image loaded via BAF. I have been struggling with this for a while now and thought you could throw some lights on the right areas though this forum is old and you would be working on something else to remember anything at all. The BAF seems like its accepting my RAM image(download goes till 100%) and later the execution doesn't jump to RAM address. The execution remains at baf which i verified by jtag and also that the BAF echoing continues for any uart data input. 

I created a RAM image of the uart bootloader and renamed it as MPC5534.rba (the RappID tool supports BAF download for MPC5534 devices) and placed it in the RBA image folder. This allowed me to send the RAM image down to the device. After this i see execution is still at BAF. Can you please let me know what was your approach for getting the RAM image loaded via BAF ?

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

OK, clear.

This is chapter 57.4.9 from MPC5748GRM. Thank you for your guidance. This also answers my question below. Now I'll have to play with BAF to see if I'll succeed.

Thank you very much!

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

OK, I could understand this, but BAF should go into serial boot mode if valid boot header is NOT present in the flash. That's why my devices were erased, to force BAF to go to serial boot mode.

If RAppID could not communicate with BAF, running serial boot mode, then what I should use to communicate with BAF?

0 Kudos
Reply
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Rappid bootloader does not communicate with BAF. It communicates with RBF (bootloader image in the flash).

If you want to use serial boot mode of BAF, you would have to develop own application.

0 Kudos
Reply
4,678 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Aleksandar,

and what about Rappid bootloader? It could save a lot of effort:

https://www.nxp.com/webapp/Download?colCode=RAPPID_BOOTLOADER_UTILITY

Lukas

4,677 Views
alexvinchev
Contributor V

Thank you very much Lucas,

I think this is exactly (as tool) I was looking for...

Can you propose some example for the callback? I would like to use some pin in order to decide if BAF should use already flashed code or should start internal serial loader?

0 Kudos
Reply
4,677 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

This is a new feature for me, I have never tested the callback. Right now I do not have any example...

Lukas

0 Kudos
Reply
4,677 Views
alexvinchev
Contributor V

lukaszadrapa​, I'm actually struggling with this LIN0 boot...

My setup is the following:

  • I'm using X-MPC574XG-MB board (MPC574xG evaluation board);
  • MCU's I've tried are PPC5748GSK0MMJ6 (0N65H), PPC5748GMMJ6A(1N81M), SPC5748GGMMJ6(1N81M);
  • MCU is in "3:Customer delivery" (verified in SSCM.LCSTAT) state;
  • Flash is erased in all locations, where boot could be present, starting from 0x00FC0000 up to 0x00FFFFFF (inclusive);
  • PB2 (LIN0_TX, J10-3) is connected via wire to serial RX (pin 5, FT232RL);
  • PB3 (LIN0_RX, J10-1) is connected via wire to serial TX (pin 1, FT232RL);
  • GND of the evaluation board is connected to the GND of USB to serial board;
  • Serial port on PC side is COM57, latency is set to 1ms;
  • Host OS is Windows 7 Professional, 64 bit;
  • Version of RAppID BL Tool is: Screenshot 2016-05-09 16.04.52.png
  • Configuration of the tool is: Screenshot 2016-05-09 16.09.05.png

Everything should be OK, right?

So, when I press "Start Boot Loader" I'm (regardless of used MCU) getting:comm_loss.PNG

I've tried:

  • Pin swapping (TX/RX);
  • Baudrate change from 115200 to 57600;
  • Editing RAppidBL_MCU.rbm file in order to disable auto baudrate and add additional time for options 8 & 9, like explained in the manual;
  • Looping TX to RX of serial converter. When this is done, result is the following (nothing unexpected, since MCU is not present in the loop, but at least serial communication is verified in both directions):loop_err.PNG
  • Measuring voltage on PB2 & PB3, loaded with ~1Mohm resistor to GND - 0.5V;

After everything described it seems to me that BAF by some strange reason is not going to the serial boot mode. Could you advice me, please? What else I could try, what could be the reason to not get into serial boot mode? Could you try at your side what is happening?

Aleksandar

0 Kudos
Reply