- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
dear friend:
The background for this question is: App needs to transfer some data to bootoader, and App jump to FBL via 'soft' reset.
Following solution works fine for NXP MCU:
1.allocate the variables to share date between App and FBL in a special section named 'NoInit_RAM'
2. In startup.s (created by compiler automatically), bypass the copy initiliazation for section 'NoInit_RAM'
For TC367 +ADS1.8, step 1 is completed successfully,
variable counter_receive is allocated to section 'NoInit_RAM' and its address is 0x70020000 like below
But I don't know how to do step 2.
From my know-how, the ADS created file Ifx_Ssw_Tc0.c , and call function Ifx_Ssw_doCppInit() to perform variable initialization.
/* Initialization of C runtime variables and CPP constructors and destructors */
Ifx_Ssw_doCppInit();
The function _c_init() in lib libcs_fpu.a is called to do the actual initialization, it's impossible to change logic of _c_init()
IFX_SSW_INLINE void Ifx_Ssw_C_InitInline(void)
{
extern void _c_init(void);
_c_init(); /* initialize data */
}
I guess the '__A0_MEM' is used by _c_init() to initialize the global variables, so
The dsram0 size is changed from 192K to 128K, limited to range [0x7000000, 0x70020000]
But variable counter_receive is still initialized to value = 3
Could you please give me a solution to bypas the section 'NoInit_RAM' initialization?
the lsl and map file is attached for your reference.
thanks and BR
Zhou Yi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
clear / noclear [on | off | default | restore] (*)
By default, uninitialized global or static variables are cleared to zero on startup. With pragma noclear,this step is skipped. Pragma clear resumes normal behavior. This pragma applies to constant data as well as non-constant data.
See C compiler option --no-clear.
ZY, Could you please try --no-clear pragma? The details is in um of Tasking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the 'noclear' seems doesn't work:
I add #prgama noclear for variable counter_receive like below:
#pragma section fardata "NoInit_RAM"
#pragma noclear
uint32 counter_receive;
#pragma clear
#pragma section fardata restore
during the SW running, change counter_receive to 5 via on-board debugger.
then , restart the MCU via debugger, the value is reset to 0
thanks and BR
Zhou Yi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try to configure UCB to ignore RAM initialization.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, dw:
thank you very much. I'll try , but it needs some time to understand it.
thanks and br
ZY