I am trying to use network into an application where I use without troubles GUI libraries but it seems they reserve same memory addresses or anyway it happens some kind of memory conflict: when calling GUI_Glear() I fall into HardFault_Handler. Tried to reserve for them different memory buffers modifying .sct file, specially regarding onChip SRAM zone but found no way to get out from this hanging. Some help? Thanks.
Sorry guys..., I was speaking about LPC178x/7x...
I have gone deeper in the problem and it seems due to IAP mechanism. I have some local variables that are allocated always in external memory even though I write in scatter file different instructions.
For instance, taken from protected EMAC_LPC17xx.c file:
static int32_t Initialize (ARM_ETH_MAC_SignalEvent_t cb_event) { uint32_t pb[2]; bool dev_175x; #if defined (LPC177x_8x) uint32_t cfg_val; #endif
if (emac.flags & EMAC_FLAG_INIT) { return ARM_DRIVER_OK; }
/* Read device ID with IAP */ pb[0] = 54; iap_entry (&pb[0], &pb[0]);
After last instruction I fall in a memory/hardware fault becuase, I think, pb is in external memory. I tried to write many different solution in scatter file, for instance this one:
RW_IRAM2 0x20001000 0x00005000 { ; RW data EMAC_LPC17xx.o (+ZI +RW) EMAC_LPC17xx.o (STACK) }
So the main questions are:
- why local variables are allocated in ext RAM?
- how to put local variables in IRAM?
If someone has answers I will apreciate, thanks.
does the map file give you any clues?
Regarding the above mentioned file I find in .map file:
Execution Region RW_IRAM2 (Base: 0x20001000, Size: 0x00002a8c, Max: 0x00005000, ABSOLUTE)
Base Addr Size Type Attr Idx E Section Name Object
0x20001000 0x00000018 Data RW 1225 .data emac_lpc17xx.o 0x20001018 0x00002a74 Zero RW 1223 .bss emac_lpc17xx.o
that is what I asked but with the exception of local variables (in stack region I suppose).
I fear the task stacks locations are decided by some rtx module, I try to explore in this direction.