Problem with DEVKIT-MPC5744P serial bootloader - using RAppID BL - after flash - app won't run after POR
Succesfully programmed in the RAppID BL bootloader for MPC5744P- no problems...
filename: MPC5744P.rbf -> as provided by the RAppID BL install package
using a PE Multilink Universal FX over JTAG
using S32DS - "Flash from file..." -dialog - so far so good
Set up RAppID BL Tool for:
Serial Port - Com Port designation for DEVKIT-MPC5744P OpenSDA serial port interface - 115200
MCU Part No: MPC574xP
BAM Setup -> Disabled - evidently not supported for MPC5744P for this tool, if at all.
Application file -> MyApplication.srec
Auto Read File -> unchecked
automatically filled -> Start Address 0xFA0000
automatically filled -> Code Size Range 0x63488
Operation Setup: RadioButton "Erase and Program" selected
Enable Trace -> checked
Upon Clicking the "Start Boot Loader" button of the RAppID BL Tool User Interface, status messages show proper erasure and programming
Application runs as expected - twiggles the DEVKIT's LED - sends a test packet out the CAN bus, etc.
So Far So Good (SFSG) - except, If the DEVKIT has it's reset button pressed - the program does not run
Not being sure if the previously programmed bootloader was wiped by the RAppID BL tool, reconnected with S32DS and the PE debugger to try and flash the bootloader again, and that failed, as the bootloader was already there - so that's good, the bootloader stayed resident in code after a RAppID BL flash, as expected.
Flashed in the application code's .srec file again, successful flash, program runs, but this time power was removed and re-applied - and program does not run
In preparation for bootloader, the application project's linker command file and main.c were modifed as follows - maybe incorrectly....in that the bootloader (MPC5744P.rbf) does not appear to jump to the application properly when the bootloader is not being called for.
In my S32DS IDE project for the application, file 57xx_flash.ld was modifed as follows:
within MEMORY {}
added
/* added for rbf bootloader support - 1 of 2 */
delay_us : org = 0x00FA0008, len = 0x4
/* added for rbf bootloader support - 2 of 2 */
appkey_addr : org = 0x00FA000C, len = 0x4
within SECTIONS {}
added
/* added for rbf bootloader support */
.appkey_addr :
{
KEEP(*(.appkey_addr))
} > appkey_addr
/* added for rbf bootloader support */
.usdelay :
{
KEEP(*(.usdelay))
} > delay_us
in main.c - added these bootloader reserved memory and assignments
// .rbf bootloader support constants
const volatile uint32_t __attribute__ ((section(".appkey"))) APPKEY = 0x55AA55AA;
const volatile uint32_t __attribute__ ((section(".usdelay"))) BLDELAY = 0x2DC6C0; //3 sec delay
const volatile uint32_t __attribute__ ((section(".appkey_addr"))) APPKEY_ADDR = &APPKEY;
Questions:
I recall a mention of a 2nd interrupt vector table or such - is that what is missing?
Should there be a memory field assigned to the start address of the application?
Or is that implicit by what flash block we start at?
Note that our test application was ported from the DEVKIT-MPC5744P demo project FlexCAN_MPC5744P - which works fine in debug mode on both a DEVKIT-MPC5744P and a RD33771 demo board.