I put Heap size in 0x900 and the problem persist.
The problem occurs when I have to work with this Struct:
UnionAverias_t UnionAverias; //(word)
UnionRoturas_t UnionRoturas; //(word)
UnionRoturas_t UnionRoturasAnt; //(word)
UnionAvisos_t UnionAvisos; //(word)
UnionAvisos_t UnionAvisosAnt; //(word)
UnionModoAveriasAvisos_t UnionModoAveriasAvisos; //(word)
It is too long? or similar?
The IntDefaulthandler() is jumped to in case of an error occured. This (quite often) is an addressing error due to a busted array, clobbered stack or nil/bad pointer. I would suggest you to
- Set compiler optimization to "none"
- Set a breakpoint at the line in question
- Change when BP reached to disassembly view
- Single asm-step through the code and watching for pointers and stack
Thankfully, people like you are in the forum ...
If I compile in NONE mode, the program roms overflows. I'm using 49k of 64k.
I can only compile in DEBUG mode.
In disassembly mode, it does not say much ... you´ll see registers (ldr r3, [r4, #4]) that are loaded and then jump to IntDefaultHandler again ...
I think the fail is dueto the size of the structure that I'm putting in the pointer.
Would you tell me please, in what register have I to see?
Thank you, Bob.
I think, the debug does not stop exactly where it should ...
153: case TAMANO_WORD:
154: *p_Dato = *p_LocalMemoria->p_UnionDirMemoriaPrincipal.p_Word;
0x00005C42 ldr r3, [r4, #4]
0x00005C44 ldrh r3, [r3, #0]
0x00005C46 strh r3, [r5, #0]
jumps to CY_ISR(IntDefaultHandler)
0x00007FB8 ldr r4, [r5, #8]
327: unsigned count;
328: for (count = 0u; count != limit; count += sizeof (uint32))
Register values when fail occurs.
The problem looks like you are dereferencing the pointer twice to get the value, and then assigning that value to a pointer. I suspect the issue is with incorrect pointers/referencing in your code.
Also, the structure EstadoAveriasAvisos_t has no member p_Word, so it looks like the structure you posted is different from the structure you are using.
Using a pointer to a structure containing the variable would be fine, but if you dereference the pointer to the structure, you now have a structure, and then you dereference the structure member p_word, you will end up with the value of p_word, not pointer to it. Which you are then trying to assign to a dereference of p_Dato, which sounds incorrect. But, to know for sure, you would have to show us the declaration of p_Dato and EstadoAveriasAvisos_t.