AnsweredAssumed Answered

Flash Download Fail and _init_user function fralloc issue

Question asked by Sandeep BS on Jan 14, 2017
Latest reply on Jan 17, 2017 by Sandeep BS

Hi all,

 

We are using a ST Micro SPC564A80B4 controller with Codewarrior 2.10 compiler. However as this microcontroller is of the same family as MPC5644A we are using the startup files from Codewarrior directories. During startup phase as soon as the control enters _init_user function it tries to execute fralloc directive it fails and jumps to BAM code. Also when we try to download the elf file using debugger it gives an error "Flash Programming did not execute completely".

 

This issue gets resolved when we allocate __init_user and FlashConfig functions to .init section in __ppc_eabi_init.h as below.

extern void __init_user(void) changed to __declspec(section ".init") extern void __init_user(void)

and add

__declspec(section ".init") extern void FlashConfig(void)

 

We are NOT using VLE.

 

We are using MSL with Runtime.PPCEABI.N.a library with below compiler options.

CCOPT = -c -enum int -gdwarf-2 -codegen -cpp_exceptions off -sdatathreshold 0 -sdata2threshold 0 -fp SPFP -spe_vector -O2,p -proc Zen -ir .
ASOPT = -proc Zen -gdwarf-2
LNOPTS = -proc zen -gdwarf-2 -m __init_strtup -romaddr 1 -rambuffer 0x00043000 -romaddr 0x00043000 -sdatathreshold 0 -sdata2threshold 0 -o application.elf -map -srec application.mot -sreclength 26 -sreceol dos -nostdlib

 

Can you please let us know,

1) How to resolve this issue as we do not want to modify the standard startup files to allocate __init_user and FlashConfig functions to .init section

2) Why fralloc is used only in __init_user function and in rest all part of startup files its nofralloc?

3) Why there is no extern declaration for FlashConfig?

4) Is it mandatory to use VLE option for SPC564A micro?

Outcomes