mpc5777c bootloader to app run?

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

mpc5777c bootloader to app run?

1,688 Views
曹培亮
Contributor II

MPC577XX uses Rappid BL Tool software to upgrade the APP, and it indicates that the upgrade is successful, but the program still runs in the bootloader.  Want to know what the problem is, and the app's interrupt vector needs to be mapped again  

0 Kudos
5 Replies

1,676 Views
mikedoidge
NXP Employee
NXP Employee

Hello @曹培亮,

What board are you using for your development?

Here is a table of the supported communications and memory areas for MPC5777C device:

Device

Communication supported

Device tested

RBF file

Boot-loader areas

CAN

(500Kb/s)

UART

(115200b/s)

rchw

m_text

MPC5777C

CAN0

(PB0-PB1)

UART0

(PC8-PC9)

MPC5777CTMME3 – 1N45H

MPC5777CTMME3 – 0N45H

MPC5777C.rbf

0x00800000-

0x008003FF

0x00800400-

0x0083FFFF

Notes

  • The MPC5777C RBF boot-loader occupies 16K memory blocks starting at 0x00800000.
  • The user application is allowed on RAM from the base address + 0x1400 to the end of RAM

 

There is a document which details the steps to implement bootloader with your application. It is for MPC5744P device, but the concept is the same as they both use an RBF file. (some other devices contain BAM module and use an RBA file)

HOWTO: Use RAppID BL tool with MPC5744P EVB

 

Some additional details:

Before starting the application, the boot-loader will search for RCHW and KEY value in the application. If found, the boot-loader will consider the application suitable and run it. Otherwise, the boot-loader will not run the application and stay in waiting mode.

  • RCHW: the value of this variable will be programmed into the first 4 bytes of the application.
    The only value for RCHW is 0x005A0000
  • The KEY value is set at the last position of the application.
    The only value for KEY is 0x55AA55AA

For example: In linker file, RCHW = 0x005A0000, KEY = 0x55AA55AA, the user application section start at 0x2400, then

Size

Address

Value

Description

4 bytes

0x2400

0x005A0000

RCHW value

4 bytes

0x2404

Calculated by Compiler

Address of start executable code

4 bytes

0x2408

0x00500000

Delay value for boot-loader before jump to app

4 bytes

0x240C

Calculated by Compiler

Address of application key

 

Hope it helps,

Mike

0 Kudos

1,667 Views
曹培亮
Contributor II

I used MPC57XXMB-REVA development version, the following is the APP application generated. Srec opening file format  ,I will download this file into the development version using the Rappid BL Tool tool.  Unable to run APP program after reset.  After more than 3S, it can still be loaded again (guess it stops in the bootloader)  

_0-1626405742519.png

 

0 Kudos

1,671 Views
曹培亮
Contributor II

1. The RBF file address on the official website is not from 0x20000 to 0x2FFFF

_0-1626395559004.png

2. The Flash. id setting of my app is shown in the following picture. It cannot be downloaded through the Rappid BL Tool.  

 

_1-1626395744865.png

3. Does the interrupt vector in my app need to be mapped again? How to map

0 Kudos

1,627 Views
mikedoidge
NXP Employee
NXP Employee

Hello @曹培亮,

Here is an example of the modifications required. It is for MPC5748G device, but concept is the same:

PowerPC Architecture

  • Open S32DS for Power Architecture
  • Create a new default project wizard

image.pngFigure 6.2.1

  • Change the “flashchw.c” file by adding the following piece of code:

#if defined(START_FROM_FLASH)

#include "typedefs.h"

#define MPC57xx_ID 0x005A0000 /* RCHW boot ID for MPC57xx devices */

#define VLE_ENABLE 0x01000000 /* VLE is enabled */

#define CPU2_ENABLED 0x00000001

#define CPU0_ENABLED 0x00000002

#define CPU1_ENABLED 0x00000008

extern void _start(void);

extern void _startcore1(void);

extern void _startcore2(void);

#define TARGET_CORES (CPU0_ENABLED | CPU1_ENABLED | CPU2_ENABLED)

//#define RCHW_VAL (MPC57xx_ID | TARGET_CORES)

#define RCHW_VAL 0x005A0000

const volatile uint32_t APPKEY __attribute__ ((section(".appkey"))) = 0x55AA55AA;

const uint32_t __attribute__ ((section(".rchw"))) RCHW [] = {

                                                                        RCHW_VAL,

            /* cpu0_reset_vector */ (uint32_t)_start,

            /* delay */                                            0x2DC6C0,                                          // 3 sec

            /* application key */ (uint32_t)&APPKEY,

            /* cpu2_reset_vector */ (uint32_t)_startcore2,

            /* cpu1_reset_vector */ (uint32_t)_startcore1};

#endif /* defined(START_FROM_FLASH) */

  • Modify the linker file as shown below by adding a new line *(.appKey) into the .text segment:

image.png

Figure 6.2.2

 

  • The example output .srec file generated by the compiler integrated in S32 Design Studio:
  • The first part of the file:

image.png
Figure 6.2.3

  • The last part of the file:

image.png
Figure 6.2.4

0 Kudos

1,551 Views
曹培亮
Contributor II

Thank you for your help. I'm busy with other things. Do you have an application for the official website bootloader (MPC5777C_s32ds_uart0_can0.rbf)?  Give me a copy of the application I wrote that should be incorrectly configured in flash.id.  It just doesn't work. I want to compare  

0 Kudos