Rappid Bootloader on MPC5777C

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

Rappid Bootloader on MPC5777C

1,229 Views
berat24
Contributor III

Hello everyone,

I would like to consult you for rappid bootloader. I want to summarize my process step by step below.

1) We can load RBF file with JTAG successfully. We changed JTAG algorithms for that. There is no problem here.

2) Then, we can send our s-record with rappid bootloader utility application using uart interface.

However, Our application is not running. In my opinion, rappid bootloader cannot jump to application code.

After observing that, I tried to send same s-record to MPC5777C with JTAG and I saw the collecation as "no need to reprogram" in console but my application have run. As far as I understand, JTAG make the program jump to application code.

By the way, I attached my linker settings below. You should look at:)

To sum up, what could be reason for rappid bootloader cannot jump to application code? Or what is the reason causing this situation? Which point could not I notice?

I am looking forward to hearing your responses.

//////////////////////// main.c

#define MPC57xx_ID 0x005A0000
#define VLE_ENABLE 0x01000000
#define RCHW_VAL (MPC57xx_ID /*| VLE_ENABLE*/)

extern void _start(void);
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
};

///////////////////// linker

FLASH_BASE_ADDR = DEFINED(__flash_base_addr__) ? __flash_base_addr__ : 0x00840024;
FLASH_SIZE = DEFINED(__flash_size__) ? __flash_size__ : 4096K - 0x24;

/* Define SRAM */
SRAM_BASE_ADDR = DEFINED(__sram_base_addr__) ? __sram_base_addr__ : 0x40000000;
SRAM_SIZE = DEFINED(__sram_size__) ? __sram_size__ : 256K;

MEMORY
{
/*
flash_rchw : org = 0x00800000, len = 0x4
cpu0_reset_vec : org = 0x00800000+0x04, len = 0x4

*/
flash_rchw : org = 0x00840000, len = 0x20
cpu0_reset_vec : org = 0x00840000+0x20, len = 0x4

m_text : org = FLASH_BASE_ADDR, len = FLASH_SIZE
m_data : org = SRAM_BASE_ADDR, len = SRAM_SIZE
}

Sincerely.

0 Kudos
2 Replies

1,176 Views
mikedoidge
NXP Employee
NXP Employee

Hello Berat,

Here are some details on the MPC5777C implementation for RAppID Bootloader, which you may find useful:

 

4.6 MPC5777C Family

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

  • RCHW and KEY used in the application

Please refer to section 5.2 for defining the value of RCHW and KEY

Please refer to section 6.2 for setting up the application project with S32DS tool

  • 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

 

5. How to use RCHW and KEY in the application

5.2. PowerPC Targets

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

 

6. Project setup on S32 Design Studio

6.2. PowerPC Architecture

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

image.png

Figure 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

 

I have also attached an example MPC5777C application example setup for RAppID Bootloader as well as some images of the steps required to implement it in a new application. I hope that you will find those useful as well. Your issue is not obvious, but I think with these provided details and example, you should be able to identify where the issue is with your setup.

Best Regards,

Mike

0 Kudos

1,156 Views
berat24
Contributor III

Dear @mikedoidge 

First of all, I appreciate you for your precious answer.

I downloaded your example for rappid bootloader. Firstly, I loaded it to MPC with JTAG and it worked.

Then, I tried to load your code with rappid. As I did before, I loaded rappid bootloader s-record with JTAG. Then, I built your code again and I sent s-record by utility app. However, it did not run and I saw same behaviour.

You added s-record pictures on your response. When I looked at these photos, you generated the kind of s2 and s3 record with together but I generated S3. This could be reason?

I attached my s-record below. Could you check it?

 

0 Kudos