Hello,
I am using MPC5644A for my application. When i set small data size in project settings below 4 bytes, i face power on reset problem. When i use debugger for reset, no problem occurs. I need to set small data size to 0.
Do you have any suggestions?
Regards
Hello,
I assume you are using CodeWarrior for MPC55xx/56xx.
There might be a pragma section sdata_type/sconst_type somewhere in your code ...once you set small data/data2 threshold below 4 bytes all integer data types are now considered as .data /.rodata instead of small data/data2.
Typically this could be an issue related to the reset vector (RCHW) placement:
e.g. in the default CodeWarrior startup file (MPC55xx_init.c):
/**************************************************************/
/* RCHW and Reset Vector setup: */
/* The chip is by default setup to boot from internal Flash */
/* and the watchdog is disabled. */
typedef void (*resetfuncptr)(void);
#pragma push /* Save the current state */
#pragma section sconst_type ".__bam_bootarea" // <- only small data const are placed into ".__bam_bootarea"
extern const unsigned long bam_rchw; // if the threshold is >= 4 all works fine; below 4 bam_rchw goes to .rodata
extern const resetfuncptr bam_resetvector;
In case you change small data2 threshold to 3 - bam_rchw is placed to .rodata instead of ".__bam_bootarea" and the project fails after reset (no valid RCHW found)
I'd recommend you to search all "pragma section" and if there is "sconst_type / sdata_type" you can add "const_type / data_type" keyword to pragma to make sure the object is placed to a custom section regardless of its size.
#pragma section sconst_type const_type ".__bam_bootarea" // now all constants (regardless its size) are placed into ".__bam_bootarea"
extern const unsigned long bam_rchw;
extern const resetfuncptr bam_resetvector;
hope it helps.
Stan