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: "184.108.40.206 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.
Solved! Go to Solution.
Rappid bootloader supports only RBF (flash algorithm) in case of MPC57xx devices:
That means it is flash resident bootloader and it must be loaded by JTAG:
This solution was used because BAF serial boot does not start execution if valid boot header is present in flash.
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)?
It works on my side:
1. I loaded RBF s-record to flash:
2. There's virtual serial port on the EVB board. Connect USB cable and make sure the drivers are installed properly:
3. Run GUI and configure:
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.
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.
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:
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!
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...
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.
BAF communication protocol is extremely simple:
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:
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.
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 ?
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!
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?
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.
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?
lukaszadrapa, I'm actually struggling with this LIN0 boot...
My setup is the following:
Everything should be OK, right?
So, when I press "Start Boot Loader" I'm (regardless of used MCU) getting:
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?