[fpc-pascal] FPC Embedded DMA with STM32?

turro75 valerio.turrini at gmail.com
Sun May 10 18:09:57 CEST 2015


Thanks Jeppe,  Solved!

it was a problem in the TDMAChannel declaration which I modified without
rebuilding the fpc 

here the produced asm code:

# [39] Serial1.print(' 0x'+hexstr(longword(DMA1_Channel1.CNDTR),8));
	ldr	r0,.Lj98
	*ldrh	r1,[r0]*
	mov	r2,#0
	sub	r0,r11,#560
	mov	r3,#8
	bl	SYSTEM_$$_HEXSTR$QWORD$BYTE$$SHORTSTRING
	sub	r3,r11,#560
	ldr	r2,.Lj84
	sub	r0,r11,#304
	mov	r1,#255
	bl	fpc_shortstr_concat
	sub	r1,r11,#304
	ldr	r0,.Lj25
	ldr	r0,[r0]
	bl	HWSERIAL$_$TSTM32SERIAL_$__$$_PRINT$SHORTSTRING
# [40] Serial1.print(' 0x'+hexstr(longword(DMA1_CNDTR1),8));
	ldr	r0,.Lj98
	*ldr	r1,[r0]*
	mov	r2,#0
	sub	r0,r11,#560
	mov	r3,#8
	bl	SYSTEM_$$_HEXSTR$QWORD$BYTE$$SHORTSTRING
	sub	r3,r11,#560
	ldr	r2,.Lj84
	sub	r0,r11,#304
	mov	r1,#255
	bl	fpc_shortstr_concat
	sub	r1,r11,#304
	ldr	r0,.Lj25
	ldr	r0,[r0]
	bl	HWSERIAL$_$TSTM32SERIAL_$__$$_PRINT$SHORTSTRING


the only difference is the ldrh instruction which means halfword, in fact
the original TDMAChannel declares CCR and CDNTR as word, changing them to
longword and after rebuilding the fpc everything is working with channel
array!



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FPC-Embedded-DMA-with-STM32-tp5721684p5721689.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list