Dtcm alignment hardfault

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Dtcm alignment hardfault

527件の閲覧回数
ola_gook
Contributor III

Hi,

I am upgrading a project from DS3.4 to DS3.6 and have a problem.

DS3.6 example and system files all use dtcm as stack area, whereas 3.4 used sram. This makes sense and I would prefer to use dtcm also in my project.

However, as my SW uses numerous memcpy with stack as destination and sometimes with unaligned data, I get hardfaults when calling memcpy.

If I understand correctly, the dtcm is aligned differently than sram and that this cannot be changed.

Is there a way around this or do I need to replace all my memcpy calls with an aligned alternative memcpy?

 

タグ(3)
0 件の賞賛
返信
2 返答(返信)

509件の閲覧回数
ola_gook
Contributor III

Managed to pin it down a bit. It turns out that it is not the memcpy that fails but rather setting up the parameters for memcpy, specifically the misaligned destination address. This is unfortunate because it means I cannot replace the memcpy with an alternative.

Making a hardcoded memcpy to the same address works, but not the parameterised destination address. (Breakpoint at the instruction causing the hardfault.)

 

ola_gook_1-1743425825005.png

Regards,

/Ola

タグ(3)
0 件の賞賛
返信

481件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

DTCM memory does not have any limitation for read/write accesses in the meaning of data aligment. There is only write access size requirements for ECC initialization that is 64-bit for SRAM and 32-bit for DTCM, but during runtime data accesses may be on any size and alignment.

0 件の賞賛
返信