- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to implement an abortion criteria for a RAM test for an improved runtime. The processor is a MB96348 (16FX). The RAM test shall stop, as soon as the "free" RAM is reached.
My idea was to set a flag in the RAM and stop the RAM test on the address. We have declared RAM_Int1, RAM_Int2 and RAMExt, where RAMExt has the highest addresses. However, following code is setting the address to the end of RAM_int2 instead of RAMExt.
#pragma section FAR_DATA
static uint32_t __far endRamAddress;
myprintf_d("end address:", (uint32_t)&endRamAddress, TERMIO_CARRIAGE_RETURN);
Defining endRamAddress as const is setting it in the ROM-area.
The mapping file has following RAM free:
S_Addr. -E_Addr. Size Remain Name/State
00101E02-0010FFFE 0000E1FD --------- FREE
RAM -- Total(00013FBF) Used(00005DBA) Remainder(+0000E205)
Our Makefile looks like the following:
LFLAGS += -ra _INRAM01=0x000180/0x00037F
LFLAGS += -ra _INRAM02=0x004240/0x007FFF
LFLAGS += -ra RAMExt=0x100000/0x10FFFE
LFLAGS += -sc SSTACK/Stack/BYTE+USTACK/Stack/BYTE+INIT*/Data/BYTE+DATA=_INRAM02
Illustation of the mapping:
--------------- 0x10FFFF
| |
| RAM_ext |
| |
|-------------| 0x100000
/ /
|-------------| 0x7FFF
| |
| RAM_int2 |
| |
|-------------| 0x4240
/ /
|--------------| 0x037F
| |
| RAM_int1 | -> 0x1A8
| | -> teststruct 24 bytes (sizeof(sRamTest)) -> 0x18
|- - - - - - - - - | 0x0190
|Test-Struct| -> 0x10 bytes reserved (RP = Register bank pointer)
|Reg.Bank0 |
---------------- 0x0180
I found the manual "F2MC-16FX Family 16-Bit Microcontroller All Series Start-up File" but it didn't help me further. I was thinking about define another Section than "Data" and use the "LFLAGS += -sc ... =RAMExt" command without any success.
If anyone could provide me the solution, or even a better solution, I would be grateful.
Thank you in advance
Marian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello again,
I was thinking I share the solution which worked for me:
LFLAGS += -AL 2
LFLAGS += -sc SSTACK/Stack/BYTE+USTACK/Stack/BYTE+INIT*/Data/BYTE + DATA + DATA_*/Data/BYTE =_INRAM02
LFLAGS += -sc DATA_x/Data/BYTE + DATA_y/Data/BYTE + DATA_z/Data/BYTE + INIT_ram_test/Data/Byte + DATA_ram_test/Data/Byte = RAMExt
static uint8_t endRamAddress = 0; (global module)
myprintf_d("end address:", (uint32_t)&endRamAddress, TERMIO_CARRIAGE_RETURN);
The solution is not perfect, since modules which do not have space in INRAM02 have to be declared in RAMExt before the RAM Test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello again,
I was thinking I share the solution which worked for me:
LFLAGS += -AL 2
LFLAGS += -sc SSTACK/Stack/BYTE+USTACK/Stack/BYTE+INIT*/Data/BYTE + DATA + DATA_*/Data/BYTE =_INRAM02
LFLAGS += -sc DATA_x/Data/BYTE + DATA_y/Data/BYTE + DATA_z/Data/BYTE + INIT_ram_test/Data/Byte + DATA_ram_test/Data/Byte = RAMExt
static uint8_t endRamAddress = 0; (global module)
myprintf_d("end address:", (uint32_t)&endRamAddress, TERMIO_CARRIAGE_RETURN);
The solution is not perfect, since modules which do not have space in INRAM02 have to be declared in RAMExt before the RAM Test.