With stack in the local memory there is an exception when accessing 16-bit local variables:
j is a 16-bit variable.
r31 = 0x50800748
93 int argc=0;
40007fa0: se_li r7,0
40007fa2: se_stw r7,44(r31)
ee_u16 j=0;
40007fa4: se_li r7,0
40007fa6: se_sth r7,10(r31)
e_u16 num_algorithms=0;
40007fa8: se_li r7,0
40007faa: se_sth r7,12(r31)
ee_s16 known_id=-1;
40007fac: se_bmaski r7,0
40007fae: se_sth r7,14(r31)
ee_s16 total_errors=0;
40007fb0: se_li r7,0
40007fb2: se_sth r7,16(r31)
ee_u16 seedcrc=0;
MEMORY
{
SRAM : org = 0x40000000, len = 384K
local_dmem : org = 0x50800000, len = 64K
}
.stack (NOLOAD) : ALIGN(16)
{
__HEAP = . ;
PROVIDE (_end = . );
PROVIDE (end = . );
. += __HEAP_SIZE ;
__HEAP_END = . ;
_stack_end = . ;
. += __STACK_SIZE ;
_stack_addr = . ;
__SP_INIT = . ;
. += 4;
} > local_dmem
Hi, it'll be apparently because of 32-bit data ECC granularity on DMEM memory. DMEM needs to be initialized by 32-bit writes to completely define ECC code for data unit. Then less than 32-bit access can be performed.